2 Commits

Author SHA1 Message Date
32cfcf5ed3 * Fri Jun 13 2025 Brian Read <brianr@koozali.org> 11.0.0-17.sme
- Fix return from function in Nutups-custom [SME: 13042]
- Check Seconds left for zero before dividing by 60
2025-06-13 11:46:19 +01:00
f58cc8a22f * Fri Jun 13 2025 Brian Read <brianr@koozali.org> 11.0.0-16.sme
- Change Navigation weighting for SM2 [SME: 12996]
2025-06-13 05:51:55 +01:00
4 changed files with 23 additions and 6 deletions

View File

@@ -117,7 +117,7 @@ our $cdb;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return $ret;
return %ret;
}
sub get_selected_CONFIG {
@@ -125,7 +125,7 @@ our $cdb;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return $ret;
return %ret;
}
@@ -279,4 +279,4 @@ sub get_status_from_device {
}
1;
1;

View File

@@ -5,7 +5,7 @@ package SrvMngr::Controller::Nutups;
#----------------------------------------------------------------------
# heading : System
# description : NutUPS configuration
# navigation : 4000 700
# navigation : 4000 900
#
# name : nutups, method : get, url : /nutups, ctlact : Nutups#main
# name : nutupsu, method : post, url : /nutupsu, ctlact : Nutups#do_update

View File

@@ -16,7 +16,17 @@
<h2>Battery Status</h2>
<table>
<tr><td>Charge:</td><td><%= $nut_data->{'ups_data'}->{'battery.charge'} %>%</td></tr>
<tr><td>Runtime:</td><td><%= sprintf("%.2f", $nut_data->{'ups_data'}->{'battery.runtime'} / 60) %> minutes</td></tr>
%#<tr><td>Runtime:</td><td><%= sprintf("%.2f", $nut_data->{'ups_data'}->{'battery.runtime'} / 60) %> minutes</td></tr>
<td>Runtime:</td>
<td>
<%
my $runtime = $nut_data->{'ups_data'}->{'battery.runtime'};
my $runtime_minutes = (defined $runtime && $runtime =~ /^\d+(\.\d+)?$/)
? sprintf("%.2f", $runtime / 60)
: 'N/A';
%>
<%= $runtime_minutes %> minutes
</td>
<tr><td>Voltage:</td><td><%= $nut_data->{'ups_data'}->{'battery.voltage'} %>V</td></tr>
<tr><td>Type:</td><td><%= $nut_data->{'ups_data'}->{'battery.type'} %></td></tr>
</table>

View File

@@ -4,7 +4,7 @@ Summary: SME server - nut UPS interaction module
%define name smeserver-nutUPS
Name: %{name}
%define version 11.0.0
%define release 15
%define release 17
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@@ -26,6 +26,13 @@ A module which configures the Network UPS Tools suite for operation with
the SME server software.
%changelog
* Fri Jun 13 2025 Brian Read <brianr@koozali.org> 11.0.0-17.sme
- Fix return from function in Nutups-custom [SME: 13042]
- Check Seconds left for zero before dividing by 60
* Fri Jun 13 2025 Brian Read <brianr@koozali.org> 11.0.0-16.sme
- Change Navigation weighting for SM2 [SME: 12996]
* Wed Jun 11 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-15.sme
- open db flat file using UTF8 [SME: 13035]