aboutsummaryrefslogtreecommitdiffstats
path: root/packages/nut/status_nut.php
diff options
context:
space:
mode:
authorRyan Wagoner <rsw686@pfsense.org>2007-02-16 16:27:37 +0000
committerRyan Wagoner <rsw686@pfsense.org>2007-02-16 16:27:37 +0000
commit936e4e2958efef52d4ebb77f7ca78726d70b43ef (patch)
tree4fbcdf97331e6f6f4bd7e3926cd3d3b6f42a957f /packages/nut/status_nut.php
parenta00c9bef6c042f15c59b29c55d7cd537c9f032ae (diff)
downloadpfsense-packages-936e4e2958efef52d4ebb77f7ca78726d70b43ef.tar.gz
pfsense-packages-936e4e2958efef52d4ebb77f7ca78726d70b43ef.tar.bz2
pfsense-packages-936e4e2958efef52d4ebb77f7ca78726d70b43ef.zip
-use strong tags in xml for required fields, this was done purposely instead of using the required tag as depending on the monitoring mode local/remote these fields may not be required, however on head you can't save package changes if all required fields are not filled out
-add support for more ups status conditions
Diffstat (limited to 'packages/nut/status_nut.php')
-rw-r--r--packages/nut/status_nut.php46
1 files changed, 31 insertions, 15 deletions
diff --git a/packages/nut/status_nut.php b/packages/nut/status_nut.php
index 42d5979e..2d16c0ec 100644
--- a/packages/nut/status_nut.php
+++ b/packages/nut/status_nut.php
@@ -38,13 +38,13 @@ function tblrow ($name, $value) {
print(<<<EOD
<tr>
<td class="vncellreq" width="100px">{$name}</td>
- <td class="vtable">{$value}</td>
+ <td class="vtable">{$value}{$symbol}</td>
<tr>
EOD
."\n");
}
-function tblrowbar ($name, $value, $red, $yellow, $green) {
+function tblrowbar ($name, $value, $symbol, $red, $yellow, $green) {
$red = explode('-',$red);
$yellow = explode('-',$yellow);
$green = explode('-',$green);
@@ -71,8 +71,8 @@ function tblrowbar ($name, $value, $red, $yellow, $green) {
<td class="vncellreq" width="100px">{$name}</td>
<td class="vtable">
<div style="width: 125px; height: 12px; border-top: thin solid gray; border-bottom: thin solid gray;">
- <div style="width: {$value}%; height: 12px; background-color: {$bgcolor};">
- <div style="text-align: center; color: {$color}">{$value}%</div>
+ <div style="width: {$value}{$symbol}; height: 12px; background-color: {$bgcolor};">
+ <div style="text-align: center; color: {$color}">{$value}{$symbol}</div>
</div>
</div>
</td>
@@ -136,28 +136,44 @@ include("head.inc");
$status = explode(' ',$ups['ups.status']);
foreach($status as $condition) {
+ if($disp_status) $disp_status .= ', ';
switch ($condition) {
- case WAIT:
- $disp_status .= 'Waiting... ';
+ case 'WAIT':
+ $disp_status .= 'Waiting';
break;
- case OL:
- $disp_status .= 'On Line ';
+ case 'OL':
+ $disp_status .= 'On Line';
break;
- case OB:
- $disp_status .= 'On Battery ';
+ case 'OB':
+ $disp_status .= 'On Battery';
break;
- case LB:
- $disp_status .= 'Battery Low ';
+ case 'TRIM':
+ $disp_status .= 'SmartTrim';
break;
+ case 'BOOST':
+ $disp_status .= 'SmartBoost';
+ break;
+ case 'OVER':
+ $disp_status .= 'Overload';
+ break;
+ case 'LB':
+ $disp_status .= 'Battery Low';
+ break;
+ case 'RB':
+ $disp_status .= 'Replace Battery';
+ break;
+ case 'CAL':
+ $disp_status .= 'Calibration';
+ break;
default:
- $disp_status .= $condition.' ';
+ $disp_status .= $condition;
break;
}
}
tblrow('Status:',$disp_status);
- tblrowbar('Load:',$ups['ups.load'],'100-80','79-60','59-0');
- tblrowbar('Battery Charge:',$ups['battery.charge'],'0-29','30-79','80-100');
+ tblrowbar('Load:',$ups['ups.load'],'%','100-80','79-60','59-0');
+ tblrowbar('Battery Charge:',$ups['battery.charge'],'%','0-29','30-79','80-100');
tblrow('Battery Voltage:',$ups['battery.voltage'].'V');
tblrow('Input Voltage:',$ups['input.voltage'].'V');
tblrow('Output Voltage:',$ups['output.voltage'].'V');