From e235701fe273de90049041bbb3f017e53ba2b37d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Sun, 18 May 2025 01:01:00 -0400 Subject: [PATCH] * Sun May 18 2025 Jean-Philippe Pialasse 11.0.0-10.sme - add pollinterval setting [SME: 13006] - update config for Nut 2.8.2 [SME: 12657] --- root/etc/e-smith/templates/etc/ups/ups.conf/UPS | 5 +++++ .../share/smanager/themes/default/public/js/nutups.js | 5 ++++- smeserver-nutUPS.spec | 10 +++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/root/etc/e-smith/templates/etc/ups/ups.conf/UPS b/root/etc/e-smith/templates/etc/ups/ups.conf/UPS index 0dfa1ff..62f26da 100644 --- a/root/etc/e-smith/templates/etc/ups/ups.conf/UPS +++ b/root/etc/e-smith/templates/etc/ups/ups.conf/UPS @@ -1,4 +1,9 @@ { + my $poll = $nut{pollInterval} || '2'; + if ($poll ne '2') { + $OUT .= "pollinterval = $poll\n"; + } + my @upses = grep(/^nut-driver\@[a-zA-Z0-9_-]+$/, $DB->keys); foreach my $ups ( sort {$a cmp $b} @upses ) { diff --git a/root/usr/share/smanager/themes/default/public/js/nutups.js b/root/usr/share/smanager/themes/default/public/js/nutups.js index 0cc01a8..4f96db8 100644 --- a/root/usr/share/smanager/themes/default/public/js/nutups.js +++ b/root/usr/share/smanager/themes/default/public/js/nutups.js @@ -1,13 +1,16 @@ $(document).ready(function() { function toggleUPSClasses() { var selectedOption = $('#Nutmode_select').val(); + var upsModelValue = $('#UPS_Model_select').val().toLowerCase(); // Get the current value from UPS_Model $('.masterups').toggle(selectedOption === 'netserver' || selectedOption === 'standalone'); // Show/Hide masterups based on Net Server or Standalone $('.secondaryups').toggle(selectedOption === 'netserver' ); // Show/Hide Secondary logins for net server $('.slaveups').toggle(selectedOption === 'netclient'); // Show/Hide slaveups based on Net Client - + $('.generics').toggle(selectedOption !== 'netclient' && upsModelValue === 'genericups' ); + // Enable/Disable inputs based on the selected option $('.masterups input').prop('disabled', !(selectedOption === 'netserver' || selectedOption === 'standalone')); $('.slaveups input').prop('disabled', selectedOption !== 'netclient'); + $('.generics input').prop('disabled', selectedOption === 'netclient'); } function toggleGenerics() { diff --git a/smeserver-nutUPS.spec b/smeserver-nutUPS.spec index d64ef1a..4abb613 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 9 +%define release 10 Version: %{version} Release: %{release}%{?dist} License: GPL @@ -26,12 +26,12 @@ A module which configures the Network UPS Tools suite for operation with the SME server software. %changelog +* Sun May 18 2025 Jean-Philippe Pialasse 11.0.0-10.sme +- add pollinterval setting [SME: 13006] +- update config for Nut 2.8.2 [SME: 12657] + * Tue Mar 18 2025 Jean-Philippe Pialasse 11.0.0-9.sme - update config for Nut 2.8.2 [SME: 12657] - TODO review master/slave mode - TODO convert master/slave to primary/secondary - TODO convert to new config data + migrate - TODO event and action * Wed Mar 05 2025 Brian Read 11.0.0-8.sme - typo in lex file [SME: 12949]