Commit cc6530f6 authored by Franco Fichtner's avatar Franco Fichtner

widgets: apply whitespace cleanups

parent 8be7fb86
......@@ -4,4 +4,4 @@
$installed_packages_title = "Installed Packages";
$installed_packages_title_link = "pkg_mgr_installed.php";
?>
\ No newline at end of file
?>
......@@ -2,4 +2,4 @@
//set variable for custom title
$interface_statistics_title = "Interface Statistics";
$interface_statistics_title_link = "status_interfaces.php";
?>
\ No newline at end of file
?>
......@@ -3,4 +3,4 @@
$interfaces_title = "Interfaces";
$interfaces_title_link = "status_interfaces.php";
?>
\ No newline at end of file
?>
......@@ -3,4 +3,4 @@
$log_title = "Firewall Logs";
$log_title_link = "diag_logs_filter.php";
?>
\ No newline at end of file
?>
<?php
$openvpn_title = "OpenVPN";
$openvpn_title_link = "status_openvpn.php";
?>
\ No newline at end of file
?>
......@@ -4,4 +4,4 @@
$services_status_title = "Services Status";
$services_status_title_link = "status_services.php";
?>
\ No newline at end of file
?>
<?php
/*
$Id: thermal_sensors.inc
File location:
File location:
\usr\local\www\widgets\include\
Used by:
......@@ -22,6 +22,6 @@ function getThermalSensorsData() {
$_gb = exec("/sbin/sysctl -a | grep temperature", $dfout);
$thermalSensorsData = join("|", $dfout);
return $thermalSensorsData;
}
?>
......@@ -4,4 +4,4 @@
$wake_on_lan_title = "Wake On Lan";
$wake_on_lan_title_link = "services_wol.php";
?>
\ No newline at end of file
?>
......@@ -2,8 +2,8 @@ function updateIpsec(){
selectIntLink = "ipsecDetailed";
ipsecsettings = "ipsecDetail=";
ipsecsettings += d.getElementById(selectIntLink).checked;
selectIntLink = "ipsec-config";
textlink = d.getElementById(selectIntLink);
textlink.value = ipsecsettings;
}
\ No newline at end of file
}
/*
$Id: thermal_sensors.js
Description:
Description:
Javascript functions to get and show thermal sensors data in thermal_sensors.widget.php.
NOTE: depends on proper cofing in System >> Advanced >> Miscellaneous tab >> Thermal Sensors section.
File location:
File location:
\usr\local\www\widgets\javascript\
Used by:
\usr\local\www\widgets\widgets\thermal_sensors.widget.php
......@@ -36,7 +36,7 @@
function showThermalSensorsData() {
//get data from thermal_sensors.widget.php
url = "/widgets/widgets/thermal_sensors.widget.php?getThermalSensorsData=1"
url = "/widgets/widgets/thermal_sensors.widget.php?getThermalSensorsData=1"
//IE fix to disable cache when using http:// , just append timespan
+ new Date().getTime();
......@@ -48,12 +48,12 @@ function showThermalSensorsData() {
},
error: function(jqXHR, status, error){
buildThermalSensorsDataRaw(
"Error getting data from [thermal_sensors.widget.php] - |" +
"status: [" + (status || "") + "]|" +
"Error getting data from [thermal_sensors.widget.php] - |" +
"status: [" + (status || "") + "]|" +
"error: [" + (error || "") + "]");
}
});
//call itself in 11 seconds
window.setTimeout(showThermalSensorsData, 11000);
}
......@@ -69,14 +69,14 @@ function buildThermalSensorsData(thermalSensorsData) {
}
function buildThermalSensorsDataRaw(thermalSensorsData) {
var thermalSensorsContent = "";
if (thermalSensorsData && thermalSensorsData != "") {
thermalSensorsContent = thermalSensorsData.replace(/\|/g, "<br />");
//rawData = thermalSensorsData.split("|").join("<br />");
}
loadThermalSensorsContainer(thermalSensorsContent);
}
......@@ -88,7 +88,7 @@ function loadThermalSensorsContainer (thermalSensorsContent) {
} else {
jQuery('#thermalSensorsContainer').html("No Thermal Sensors data available.<br /><br />");
jQuery('<div/>').html(
"<span>* You can configure a proper Thermal Sensor / Module under <br />" +
"<span>* You can configure a proper Thermal Sensor / Module under <br />" +
"&nbsp;&nbsp;&nbsp;<a href='system_advanced_misc.php'>System &gt; Advanced &gt; Miscellaneous : Thermal Sensors section</a>.</span>"
).appendTo('#thermalSensorsContainer');
}
......@@ -100,51 +100,51 @@ function buildThermalSensorsDataGraph(thermalSensorsData) {
var normalColor = "LimeGreen";
var normalColorShadowTop = "Lime";
var normalColorShadowBottom = "Green";
var warningColor = "Orange";
var warningColorShadowBottom = "Chocolate";
var criticalColor = "Red";
var criticalColorShadowBottom = "DarkRed";
//local variables
var barBgColor = normalColor; //green/normal as default
var barBgColorShadowTop = normalColorShadowTop; //green/normal as default
var barBgColorShadowBottom = normalColorShadowBottom; //green/normal as default
var thermalSensorsArray = new Array();
if (thermalSensorsData && thermalSensorsData != ""){
thermalSensorsArray = thermalSensorsData.split("|");
}
var thermalSensorsHTMLContent = "";
var itemsToPulsate = new Array();
//generate graph for each temperature sensor and append to thermalSensorsHTMLContent string
for (var i = 0; i < thermalSensorsArray.length; i++) {
var sensorDataArray = thermalSensorsArray[i].split(":");
var sensorName = sensorDataArray[0].trim();
var thermalSensorValue = getThermalSensorValue(sensorDataArray[1]);
var pulsateTimes = 0;
var pulsateDuration = 0;
var warningTempThresholdPosition = 0;
var criticalTempThresholdPosition = 0;
//NOTE: the following variables are declared/set in "thermal_sensors.widget.php":
// thermal_sensors_widget_coreWarningTempThreshold, thermal_sensors_widget_coreCriticalTempThreshold,
//NOTE: the following variables are declared/set in "thermal_sensors.widget.php":
// thermal_sensors_widget_coreWarningTempThreshold, thermal_sensors_widget_coreCriticalTempThreshold,
// thermal_sensors_widget_zoneWarningTempThreshold, thermal_sensors_widget_zoneCriticalTempThreshold
// thermal_sensors_widget_pulsateWarning, thermal_sensors_widget_pulsateCritical
//set graph color and pulsate parameters
if (sensorName.indexOf("cpu") > -1) { //check CPU Threshold config settings
warningTempThresholdPosition = thermal_sensors_widget_coreWarningTempThreshold;
criticalTempThresholdPosition = thermal_sensors_widget_coreCriticalTempThreshold;
if (thermalSensorValue < thermal_sensors_widget_coreWarningTempThreshold) {
barBgColor = normalColor;
barBgColorShadowTop = normalColorShadowTop;
......@@ -165,21 +165,21 @@ function buildThermalSensorsDataGraph(thermalSensorsData) {
pulsateDuration = thermal_sensors_widget_pulsateCritical ? 900 : 0;
}
} else { //assuming sensor is for a zone, check Zone Threshold config settings
warningTempThresholdPosition = thermal_sensors_widget_zoneWarningTempThreshold;
criticalTempThresholdPosition = thermal_sensors_widget_zoneCriticalTempThreshold;
if (thermalSensorValue < thermal_sensors_widget_zoneWarningTempThreshold) {
barBgColor = normalColor;
barBgColorShadowTop = normalColorShadowTop;
barBgColorShadowBottom = normalColorShadowBottom;
pulsateTimes = 0;
pulsateDuration = 0;
} else if (thermalSensorValue >= thermal_sensors_widget_zoneWarningTempThreshold
} else if (thermalSensorValue >= thermal_sensors_widget_zoneWarningTempThreshold
&& thermalSensorValue < thermal_sensors_widget_zoneCriticalTempThreshold) {
barBgColor = warningColor;
barBgColorShadowTop = warningColor;
barBgColorShadowBottom = warningColorShadowBottom;
......@@ -187,7 +187,7 @@ function buildThermalSensorsDataGraph(thermalSensorsData) {
pulsateDuration = thermal_sensors_widget_pulsateWarning ? 900 : 0;
} else { // thermalSensorValue > thermal_sensors_widget_zoneCriticalTempThreshold
barBgColor = criticalColor;
barBgColorShadowTop = criticalColor;
barBgColorShadowBottom = criticalColorShadowBottom;
......@@ -203,44 +203,44 @@ function buildThermalSensorsDataGraph(thermalSensorsData) {
//build temperature item/row for a sensor
//NOTE: additional styles are set in 'thermal_sensors.widget.php'
var thermalSensorRow = "<div class='thermalSensorRow' id='thermalSensorRow" + i + "' >" +
var thermalSensorRow = "<div class='thermalSensorRow' id='thermalSensorRow" + i + "' >" +
//sensor name and temperature value
" <div class='thermalSensorTextShell'><div class='thermalSensorText' id='thermalSensorText" + i + "'>" + sensorName + ": </div><div class='thermalSensorValue' id='thermalSensorValue" + i + "'>" + thermalSensorValue + " &deg;C</div></div>" +
" <div class='thermalSensorTextShell'><div class='thermalSensorText' id='thermalSensorText" + i + "'>" + sensorName + ": </div><div class='thermalSensorValue' id='thermalSensorValue" + i + "'>" + thermalSensorValue + " &deg;C</div></div>" +
//temperature bar
" <div class='thermalSensorBarShell' id='thermalSensorBarShell" + i + "' >" +
" <div class='thermalSensorBar' id='thermalSensorBar" + i + "' style='background-color: " + barBgColor + "; border-top-color: " + barBgColorShadowTop + "; border-bottom-color: " + barBgColorShadowBottom + "; width:" + thermalSensorValue + "%;' ></div>" +
" <div class='thermalSensorBarShell' id='thermalSensorBarShell" + i + "' >" +
" <div class='thermalSensorBar' id='thermalSensorBar" + i + "' style='background-color: " + barBgColor + "; border-top-color: " + barBgColorShadowTop + "; border-bottom-color: " + barBgColorShadowBottom + "; width:" + thermalSensorValue + "%;' ></div>" +
//threshold targets (warning and critical)
" <div class='thermalSensorWarnThresh' id='thermalSensorWarnThresh" + i + "' style='left:" + warningTempThresholdPosition + "%;' ></div>" +
" <div class='thermalSensorCritThresh' id='thermalSensorCritThresh" + i + "' style='left:" + criticalTempThresholdPosition + "%;' ></div>" +
" <div class='thermalSensorWarnThresh' id='thermalSensorWarnThresh" + i + "' style='left:" + warningTempThresholdPosition + "%;' ></div>" +
" <div class='thermalSensorCritThresh' id='thermalSensorCritThresh" + i + "' style='left:" + criticalTempThresholdPosition + "%;' ></div>" +
//temperature scale (max 100 C)
" <div class='thermal_sensors_widget_scale000'></div>" +
" <div class='thermal_sensors_widget_scale010'></div>" +
" <div class='thermal_sensors_widget_scale020'></div>" +
" <div class='thermal_sensors_widget_scale030'></div>" +
" <div class='thermal_sensors_widget_scale040'></div>" +
" <div class='thermal_sensors_widget_scale050'></div>" +
" <div class='thermal_sensors_widget_scale060'></div>" +
" <div class='thermal_sensors_widget_scale070'></div>" +
" <div class='thermal_sensors_widget_scale080'></div>" +
" <div class='thermal_sensors_widget_scale090'></div>" +
" <div class='thermal_sensors_widget_scale100'></div>" +
" <div class='thermal_sensors_widget_mark100'>100&deg;</div>" +
" </div>" +
" <div class='thermal_sensors_widget_scale000'></div>" +
" <div class='thermal_sensors_widget_scale010'></div>" +
" <div class='thermal_sensors_widget_scale020'></div>" +
" <div class='thermal_sensors_widget_scale030'></div>" +
" <div class='thermal_sensors_widget_scale040'></div>" +
" <div class='thermal_sensors_widget_scale050'></div>" +
" <div class='thermal_sensors_widget_scale060'></div>" +
" <div class='thermal_sensors_widget_scale070'></div>" +
" <div class='thermal_sensors_widget_scale080'></div>" +
" <div class='thermal_sensors_widget_scale090'></div>" +
" <div class='thermal_sensors_widget_scale100'></div>" +
" <div class='thermal_sensors_widget_mark100'>100&deg;</div>" +
" </div>" +
"</div>";
//collect parameters for warning/critical items we need to pulsate
if (pulsateTimes > 0) {
var params = i + "|" + barBgColor + "|" + pulsateTimes + "|" + pulsateDuration;
itemsToPulsate.push(params);
}
//append HTML item
thermalSensorsHTMLContent = thermalSensorsHTMLContent + thermalSensorRow;
}
//load generated graph into thermalSensorsContainer (DIV defined in "thermal_sensors.widget.php")
loadThermalSensorsContainer(thermalSensorsHTMLContent);
if (itemsToPulsate.length > 0) {
//pulsate/flash warning/critical items we collected
pulsateThermalSensorsItems(itemsToPulsate);
......@@ -248,10 +248,10 @@ function buildThermalSensorsDataGraph(thermalSensorsData) {
}
function pulsateThermalSensorsItems(itemsToPulsate) {
//pulsate/flash warning/critical items we collected
for (var i = 0; i < itemsToPulsate.length; i++) {
var pulsateParams = itemsToPulsate[i].split("|");
var rowNum = parseInt(pulsateParams[0]);
//var textColor = pulsateParams[1];
......@@ -260,20 +260,20 @@ function pulsateThermalSensorsItems(itemsToPulsate) {
//pulsate temp Value
var divThermalSensorValue = jQuery("#thermalSensorValue" + rowNum); //get temp value by id
divThermalSensorValue.effect("pulsate", {
divThermalSensorValue.effect("pulsate", {
times: pulsateTimes
,easing: 'linear' //'easeInExpo'
,easing: 'linear' //'easeInExpo'
}, pulsateDuration);
////set Temp Value color
//divThermalSensorValue.css( { color: textColor } );
//divThermalSensorValue.css( { color: textColor } );
//pulsate temp Bar
var divThermalSensorBar = jQuery("#thermalSensorBar" + rowNum); //get temp bar by id
divThermalSensorBar.effect("pulsate", {
divThermalSensorBar.effect("pulsate", {
times: pulsateTimes
,easing: 'linear' //'easeInExpo'
,easing: 'linear' //'easeInExpo'
}, pulsateDuration);
}
}
......
function trafficshowDiv(incDiv,swapButtons){
//appear element
selectedDiv = incDiv + "graphdiv";
jQuery('#' + selectedDiv).show();
d = document;
jQuery('#' + selectedDiv).show();
d = document;
if (swapButtons){
selectIntLink = selectedDiv + "-min";
textlink = d.getElementById(selectIntLink);
textlink.style.display = "inline";
textlink.style.display = "inline";
selectIntLink = selectedDiv + "-open";
textlink = d.getElementById(selectIntLink);
textlink.style.display = "none";
}
document.iform["shown[" + incDiv + "]"].value = "show";
}
function trafficminimizeDiv(incDiv,swapButtons){
//fade element
selectedDiv = incDiv + "graphdiv";
jQuery('#' + selectedDiv).hide();
d = document;
jQuery('#' + selectedDiv).hide();
d = document;
if (swapButtons){
selectIntLink = selectedDiv + "-open";
textlink = d.getElementById(selectIntLink);
textlink.style.display = "inline";
textlink.style.display = "inline";
selectIntLink = selectedDiv + "-min";
textlink = d.getElementById(selectIntLink);
textlink.style.display = "none";
}
}
document.iform["shown[" + incDiv + "]"].value = "hide";
}
<?php
<?php
/*
captive_portal_status.widget.php
Copyright (C) 2007 Sam Wenham
......@@ -6,20 +6,20 @@
status_captiveportal.php
part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
......@@ -63,15 +63,15 @@ $a_cp =& $config['captiveportal'];
$cpdb_all = array();
foreach ($a_cp as $cpzone => $cp) {
$cpdb_handle = new OPNsense\CaptivePortal\DB($cpzone);
$cpdb_handle = new OPNsense\CaptivePortal\DB($cpzone);
$order = "";
$order = "";
if ($_GET['order']) {
if ($_GET['order'] == "ip") $order = "ip";
else if ($_GET['order'] == "mac") $order = "mac";
else if ($_GET['order'] == "user") $order = "username";
}
$cpdb = $cpdb_handle->listClients(array(),"and",array($order) ) ;
$cpdb_all[$cpzone] = $cpdb;
}
......
......@@ -126,5 +126,3 @@ $counter = 1;
</tr>
<?php } // foreach ?>
</table>
......@@ -77,12 +77,12 @@ require_once("/usr/local/www/widgets/include/interfaces.inc");
<?php if($ifinfo['status'] == "up" || $ifinfo['status'] == "associated") { ?>
<td class="listr" align="center">
<span id="<?php echo $ifname;?>" class="glyphicon glyphicon-arrow-up text-success"></span>
</td>
<?php } else if ($ifinfo['status'] == "no carrier") { ?>
<td class="listr" align="center">
<span id="<?php echo $ifname;?>" class="glyphicon glyphicon-arrow-down text-danger"></span>
</td>
<?php } else if ($ifinfo['status'] == "down") { ?>
<td class="listr" align="center">
......@@ -94,13 +94,13 @@ require_once("/usr/local/www/widgets/include/interfaces.inc");
</td>
<td class="vncellt">
<?php if($ifinfo['ipaddr'] != "") { ?>
<div id="<?php echo $ifname;?>-ip" style="display:inline"><?=htmlspecialchars($ifinfo['ipaddr']);?> </div>
<br />
<div id="<?php echo $ifname;?>-ip" style="display:inline"><?=htmlspecialchars($ifinfo['ipaddr']);?> </div>
<br />
<?php }
if ($ifinfo['ipaddrv6'] != "") { ?>
<div id="<?php echo $ifname;?>-ipv6" style="display:inline"><?=htmlspecialchars($ifinfo['ipaddrv6']);?> </div>
<?php } ?>
</td>
</tr>
<?php }//end for each ?>
<?php }//end for each ?>
</table>
......@@ -84,7 +84,7 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<table class="table table-striped" width="100%" border="0" cellspacing="0" cellpadding="0" summary="interfaces statistics">
<tr><td class="widgetsubheader" style="height:25px">&nbsp;&nbsp;&nbsp;</td></tr>
<tr>
<td><b><?php echo gettext('Packets In')?></b></td>
<td><b><?php echo gettext('Packets In')?></b></td>
</tr>
<tr>
<td><b><?php echo gettext('Packets Out')?></b></td>
......@@ -111,12 +111,12 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<table class="table table-striped" width="100%" border="0" cellspacing="0" cellpadding="0" summary="the stats">
<tr>
<?php
$interface_names = array();
foreach ($ifdescrs as $ifdescr => $ifname):
$ifinfo = get_interface_info($ifdescr);
if ($ifinfo['status'] != "down"){ ?>
<td class="widgetsubheader nowrap" style="height:25px">
<b><?=htmlspecialchars($ifname);?></b>
$interface_names = array();
foreach ($ifdescrs as $ifdescr => $ifname):
$ifinfo = get_interface_info($ifdescr);
if ($ifinfo['status'] != "down"){ ?>
<td class="widgetsubheader nowrap" style="height:25px">
<b><?=htmlspecialchars($ifname);?></b>
</td>
<?php
//build array of interface names
......@@ -135,9 +135,9 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<tr>
<?php
$counter = 2;
foreach ($array_out_packets as $data): ?>
......@@ -147,10 +147,10 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<?php
<?php
$counter = 3;
foreach ($array_in_bytes as $data): ?>
<td class="listr nowrap" id="stat<?php echo $counter;?>" style="height:25px">
......@@ -159,9 +159,9 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<tr>
<?php
$counter = 4;
foreach ($array_out_bytes as $data): ?>
......@@ -171,9 +171,9 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<tr>
<?php
$counter = 5;
foreach ($array_in_errors as $data): ?>
......@@ -183,11 +183,11 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<?php
$counter = 6;
<?php
$counter = 6;
foreach ($array_out_errors as $data): ?>
<td class="listr nowrap" id="stat<?php echo $counter;?>" style="height:25px">
<?=htmlspecialchars($data);?>
......@@ -195,11 +195,11 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<?php
$counter = 7;
<?php
$counter = 7;
foreach ($array_collisions as $data): ?>
<td class="listr nowrap" id="stat<?php echo $counter;?>" style="height:25px">
<?=htmlspecialchars($data);?>
......
......@@ -172,7 +172,7 @@ if (isset($config['ipsec']['phase1'])){?>
<?php
if (is_array($mobile['pool'])):
foreach ($mobile['pool'] as $pool):
if (is_array($pool['lease'])):
if (is_array($pool['lease'])):
foreach ($pool['lease'] as $muser) : ?>
<div style="display:table-row;">
<div class="listlr" style="display:table-cell;width:139px">
......
......@@ -14,7 +14,7 @@
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
......
......@@ -146,7 +146,7 @@ if($_REQUEST['updateme']) {
<td width="40%" class="vncellt">Clock location</td>
<td width="60%" class="listr">
<a target="_gmaps" href="http://maps.google.com/?q=<?php echo $gps_lat; ?>,<?php echo $gps_lon; ?>">
<?php
<?php
echo sprintf("%.5f", $gps_lat) . " " . $gps_la . ", " . sprintf("%.5f", $gps_lon) . " " . $gps_lo; ?>
</a>
<?php if (isset($gps_alt)) {echo " (" . $gps_alt . " " . $gps_alt_unit . " alt.)";} ?>
......@@ -156,10 +156,10 @@ if($_REQUEST['updateme']) {
<tr>
<td width="40%" class="vncellt">Satellites</td>
<td width="60%" class="listr">
<?php
<?php
if (isset($gps_satview)) {echo 'in view ' . intval($gps_satview);}
if (isset($gps_sat) && isset($gps_satview)) {echo ', ';}
if (isset($gps_sat)) {echo 'in use ' . $gps_sat;}
if (isset($gps_sat)) {echo 'in use ' . $gps_sat;}
?>
</td>
</tr>
......@@ -167,7 +167,7 @@ if($_REQUEST['updateme']) {
<?php endif; ?>
</tbody>
</table>
<?php
<?php
exit;
}
......@@ -266,7 +266,7 @@ History: 1.0 2000-05-09 GIF-image digits
cookies to work around Win IE stale-time bug
2.1 2002-10-12 Noted Mozilla 1.0 compatibility; released PHP version.
2.1.1 2002-10-20 Fixed octal bug in the PHP translation; the number of
minutes & seconds were misinterpretes when less than 10
minutes & seconds were misinterpretes when less than 10
2.1.2 2003-08-07 The previous fix had introduced a bug when the
minutes or seconds were exactly 0. Thanks to Man Bui
for reporting the bug.
......@@ -356,7 +356,7 @@ function clockTimeString(inHours, inMinutes, inSeconds) {
}
function clockDisplayTime(inHours, inMinutes, inSeconds) {
clockWriteToDiv("ClockTime", clockTimeString(inHours, inMinutes, inSeconds));
}
......@@ -416,7 +416,7 @@ function clockUpdate()
{
var lastLocalTime = localTime;
localTime = (new Date()).getTime();
/* Sanity-check the diff. in local time between successive calls;
reload if user has reset system clock */
if (clockOffset == null) {
......@@ -431,11 +431,11 @@ function clockUpdate()
location.reload(); // will refresh time values in cookies
}
else {
// Compute what time would be on server
// Compute what time would be on server
var serverTime = new Date(localTime + clockOffset);
clockDisplayTime(serverTime.getHours(), serverTime.getMinutes(),
serverTime.getSeconds());
// Reschedule this func to run on next even clockIncrementMillis boundary
clockTimerID = setTimeout("clockUpdate()",
clockIncrementMillis - (serverTime.getTime() % clockIncrementMillis));
......
......@@ -2,7 +2,7 @@
/*
Copyright (C) 2014 Deciso B.V.
Copyright 2007 Scott Dale
Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
and Jonathan Watt <jwatt@jwatt.org>.
All rights reserved.
......@@ -42,10 +42,10 @@ if($_POST['action'] == 'pkg_update') {
$shell = new Core\Shell();
// execute shell command and collect (only valid) info into named array
$shell->exec("/usr/local/opnsense/scripts/pkg_updatecheck.sh",false,false,$shell_output);
}
}
if (file_exists($file_pkg_status)) {
$json = file_get_contents($file_pkg_status);
$pkg_status = json_decode($json,true);
}
......@@ -65,7 +65,7 @@ if($_REQUEST['getupdatestatus']) {
echo "<span class='text-danger'>".gettext("Unknown")."</span><br/><span class='btn-link' onclick='checkupdate()'>".gettext("Click to check now")."</span>";
}
exit;
}
}
$curcfg = $config['system']['firmware'];
......@@ -74,7 +74,7 @@ $filesystems = get_mounted_filesystems();
?>
<script type="text/javascript">
//<![CDATA[
jQuery(function() {
jQuery(function() {
jQuery("#statePB").css( { width: '<?php echo get_pfstate(true); ?>%' } );
jQuery("#mbufPB").css( { width: '<?php echo get_mbuf(true); ?>%' } );
jQuery("#cpuPB").css( { width:0 } );
......@@ -89,7 +89,7 @@ $filesystems = get_mounted_filesystems();
jQuery("#swapUsagePB").css( { width: '<?php echo swap_usage(); ?>%' } );
<?php endif; ?>
<?php if (get_temp() != ""): ?>
jQuery("#tempPB").css( { width: '<?php echo get_temp(); ?>%' } );
jQuery("#tempPB").css( { width: '<?php echo get_temp(); ?>%' } );
<?php endif; ?>
});
//]]>
......@@ -154,7 +154,7 @@ $filesystems = get_mounted_filesystems();
<tr>
<td width="25%" class="vncellt"><?=gettext("CPU Type");?></td>
<td width="75%" class="listr">
<?php
<?php
echo (htmlspecialchars(get_single_sysctl("hw.model")));
?>
<div id="cpufreq"><?= get_cpufreq(); ?></div>
......@@ -191,7 +191,7 @@ $filesystems = get_mounted_filesystems();
}
?>
</td>
</tr>
</tr>
<?php if ($config['revision']): ?>
<tr>
<td width="25%" class="vncellt"><?=gettext("Last config change");?></td>
......@@ -209,10 +209,10 @@ $filesystems = get_mounted_filesystems();
<span class="sr-only"></span>
</div>
</div>
<span id="pfstateusagemeter"><?= $pfstateusage.'%'; ?></span> (<span id="pfstate"><?= htmlspecialchars($pfstatetext); ?></span>)
<br />
<a href="diag_dump_states.php"><?=gettext("Show states");?></a>
<br />
<a href="diag_dump_states.php"><?=gettext("Show states");?></a>
</td>
</tr>
<tr>
......@@ -222,7 +222,7 @@ $filesystems = get_mounted_filesystems();
$mbufstext = get_mbuf();
$mbufusage = get_mbuf(true);
?>
<div class="progress">
<div id="mbufPB" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
<span class="sr-only"></span>
......@@ -236,7 +236,7 @@ $filesystems = get_mounted_filesystems();
<td width="25%" class="vncellt"><?=gettext("Temperature");?></td>
<td width="75%" class="listr">
<?php $TempMeter = $temp = get_temp(); ?>
<div class="progress">
<div id="tempPB" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
<span class="sr-only"></span>
......@@ -255,7 +255,7 @@ $filesystems = get_mounted_filesystems();
<tr>
<td width="25%" class="vncellt"><?=gettext("CPU usage");?></td>
<td width="75%" class="listr">
<div class="progress">
<div id="cpuPB" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
<span class="sr-only"></span>
......@@ -322,7 +322,7 @@ $filesystems = get_mounted_filesystems();
success:function(html) {
//alert(html);
getstatus();
}
});
}
......
......@@ -110,16 +110,16 @@ if (isset($a_config["scale_type"])) {
<?php foreach ($ifdescrs as $ifname => $ifdescr) { ?>
<input type="hidden" name="shown[<?= $ifname ?>]" value="<?= $shown[$ifname] ? "show" : "hide" ?>" />
<?php } ?>
<table class="table table-striped">
<tbody>
<tbody>
<tr>
<td>
Default AutoScale:
</td>
</tr>
<?php
<?php
$scale_type_up="checked=\"checked\"";
$scale_type_follow="";
if (isset($config["widgets"]["trafficgraphs"]["scale_type"])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment