diff --git a/root/usr/share/smanager/lib/SrvMngr/Controller/Nutups-Custom.pm b/root/usr/share/smanager/lib/SrvMngr/Controller/Nutups-Custom.pm
index c24b370..9631996 100644
--- a/root/usr/share/smanager/lib/SrvMngr/Controller/Nutups-Custom.pm
+++ b/root/usr/share/smanager/lib/SrvMngr/Controller/Nutups-Custom.pm
@@ -77,7 +77,7 @@ my $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
#'Data1'=>'Data for STATUS', #Example
# fields from Inputs in STATUS $fields['STATUS']
'UPSStatus'=>$c->get_ups_status(),
-
+ 'ups_data' => $c->get_ups_status_as_hash()
);
return %ret;
}
@@ -239,6 +239,16 @@ sub get_ups_status {
}
}
+sub get_ups_status_as_hash {
+ $c = shift;
+ $string = $c->get_ups_status();
+ my %hash;
+ while ($string =~ /^(.+?):\s*(.+)$/mg) {
+ $hash{$1} = $2;
+ }
+ return \%hash
+}
+
sub get_status_from_device {
my ($c,$device) = @_;
my $command = '/usr/bin/upsc';
diff --git a/root/usr/share/smanager/themes/default/templates/partials/_nut_STATUS.html.ep b/root/usr/share/smanager/themes/default/templates/partials/_nut_STATUS.html.ep
index 68bc844..5c6f435 100644
--- a/root/usr/share/smanager/themes/default/templates/partials/_nut_STATUS.html.ep
+++ b/root/usr/share/smanager/themes/default/templates/partials/_nut_STATUS.html.ep
@@ -35,13 +35,17 @@
%=l('nut_Descriptive_paragraph')
-
+
+
+
+ %= include 'partials/_nut_UPS_STATUS'
%# Probably finally by a submit.
%end
diff --git a/root/usr/share/smanager/themes/default/templates/partials/_nut_UPS_STATUS.html.ep b/root/usr/share/smanager/themes/default/templates/partials/_nut_UPS_STATUS.html.ep
index 7de670f..76b5e53 100644
--- a/root/usr/share/smanager/themes/default/templates/partials/_nut_UPS_STATUS.html.ep
+++ b/root/usr/share/smanager/themes/default/templates/partials/_nut_UPS_STATUS.html.ep
@@ -1,6 +1,3 @@
-% layout 'default';
-% title 'UPS Status';
-
UPS Status
%= stylesheet '/css/nut_ups-status-page.css'
@@ -8,42 +5,42 @@
Device Information
- Manufacturer: | <%= $ups_data->{'device.mfr'} %> |
- Model: | <%= $ups_data->{'device.model'} %> |
- Serial: | <%= $ups_data->{'device.serial'} %> |
- Type: | <%= $ups_data->{'device.type'} %> |
+ Manufacturer: | <%= $nut_data->{'ups_data'}->{'device.mfr'} %> |
+ Model: | <%= $nut_data->{'ups_data'}->{'device.model'} %> |
+ Serial: | <%= $nut_data->{'ups_data'}->{'device.serial'} %> |
+ Type: | <%= $nut_data->{'ups_data'}->{'device.type'} %> |
Battery Status
- Charge: | <%= $ups_data->{'battery.charge'} %>% |
- Runtime: | <%= sprintf("%.2f", $ups_data->{'battery.runtime'} / 60) %> minutes |
- Voltage: | <%= $ups_data->{'battery.voltage'} %>V |
- Type: | <%= $ups_data->{'battery.type'} %> |
+ Charge: | <%= $nut_data->{'ups_data'}->{'battery.charge'} %>% |
+ Runtime: | <%= sprintf("%.2f", $nut_data->{'ups_data'}->{'battery.runtime'} / 60) %> minutes |
+ Voltage: | <%= $nut_data->{'ups_data'}->{'battery.voltage'} %>V |
+ Type: | <%= $nut_data->{'ups_data'}->{'battery.type'} %> |
Input Power
- Voltage: | <%= $ups_data->{'input.voltage'} %>V |
- Nominal Voltage: | <%= $ups_data->{'input.voltage.nominal'} %>V |
- Sensitivity: | <%= $ups_data->{'input.sensitivity'} %> |
- Transfer High: | <%= $ups_data->{'input.transfer.high'} %>V |
- Transfer Low: | <%= $ups_data->{'input.transfer.low'} %>V |
+ Voltage: | <%= $nut_data->{'ups_data'}->{'input.voltage'} %>V |
+ Nominal Voltage: | <%= $nut_data->{'ups_data'}->{'input.voltage.nominal'} %>V |
+ Sensitivity: | <%= $nut_data->{'ups_data'}->{'input.sensitivity'} %> |
+ Transfer High: | <%= $nut_data->{'ups_data'}->{'input.transfer.high'} %>V |
+ Transfer Low: | <%= $nut_data->{'ups_data'}->{'input.transfer.low'} %>V |
UPS Status
- Status: | <%= $ups_data->{'ups.status'} %> |
- Load: | <%= $ups_data->{'ups.load'} %>% |
- Beeper: | <%= $ups_data->{'ups.beeper.status'} %> |
- Firmware: | <%= $ups_data->{'ups.firmware'} %> |
- Test Result: | <%= $ups_data->{'ups.test.result'} %> |
+ Status: | <%= $nut_data->{'ups_data'}->{'ups.status'} %> |
+ Load: | <%= $nut_data->{'ups_data'}->{'ups.load'} %>% |
+ Beeper: | <%= $nut_data->{'ups_data'}->{'ups.beeper.status'} %> |
+ Firmware: | <%= $nut_data->{'ups_data'}->{'ups.firmware'} %> |
+ Test Result: | <%= $nut_data->{'ups_data'}->{'ups.test.result'} %> |
diff --git a/smeserver-nutUPS.spec b/smeserver-nutUPS.spec
index 0ecab99..740bf9a 100644
--- a/smeserver-nutUPS.spec
+++ b/smeserver-nutUPS.spec
@@ -4,7 +4,7 @@ Summary: SME server - nut UPS interaction module
%define name smeserver-nutUPS
Name: %{name}
%define version 11.0.0
-%define release 6
+%define release 7
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@@ -25,6 +25,9 @@ A module which configures the Network UPS Tools suite for operation with
the SME server software.
%changelog
+* Mon Mar 03 2025 Brian Read 11.0.0-7.sme
+- Enhance UPS Status screen [SME: ]
+
* Mon Mar 03 2025 Brian Read 11.0.0-6.sme
- Add in SM2 NutUPS configuration and status panel [SME: 12949]