Remove headfings in Error and status and sort out non global opening of DBs

This commit is contained in:
2025-03-31 19:03:54 +01:00
105 changed files with 146 additions and 1239 deletions

9
Targets/Nutups/Nutups-Custom.pm Normal file → Executable file
View File

@@ -191,12 +191,17 @@ sub get_model_options {
return ['Error occurred'];
}
<<<<<<< HEAD
# Remove "/usr/sbin" from the front of each line
=======
# Remove "/usr/sbin/" from the front of each line
>>>>>>> 75aaf422042b2af06071fd64175eb15f6c4ae92b
s{^/usr/sbin/}{} for @output;
# Trim whitespace from each element and return the array
chomp(@output); # Remove newline characters from each line
return @output; # Return the array of modified output lines
<<<<<<< HEAD
}
sub get_ups_details {
@@ -230,5 +235,7 @@ sub get_ups_details {
}
return $formatted_output;
=======
>>>>>>> 75aaf422042b2af06071fd64175eb15f6c4ae92b
}
1;
1;

0
Targets/Nutups/Nutups.pm Normal file → Executable file
View File

2
Targets/Nutups/_nut_CONFIG.html.ep Normal file → Executable file
View File

@@ -137,4 +137,4 @@
%# Probably finally by a submit.
%end
</div>
</div>

4
Targets/Nutups/_nut_STATUS.html.ep Normal file → Executable file
View File

@@ -7,7 +7,7 @@
SelectInput();
};
</script>
% if ($config->{debug} == 1) {
% if (config->{debug} == 1) {
<pre>
%= dumper $nut_data
</pre>
@@ -45,4 +45,4 @@
%# Probably finally by a submit.
%end
</div>
</div>

0
Targets/Nutups/nutups.css Normal file → Executable file
View File

4
Targets/Nutups/nutups.html.ep Normal file → Executable file
View File

@@ -8,7 +8,7 @@
%= javascript '/js/nutups.js'
<div id="module" class="module Nutups-panel">
% if ($config->{debug} == 1) {
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $nut_data->{trt}
@@ -55,4 +55,4 @@
</div>
%end
%end

0
Targets/Nutups/nutups.js Normal file → Executable file
View File

0
Targets/Nutups/nutups_en.lex Normal file → Executable file
View File

27
Targets/Nutups/spec.nutUPS Executable file
View File

@@ -0,0 +1,27 @@
main page = status
config page:
-nut status : enable/disabled
nut mode : standalone|netserver|netclient
if netclient mode
ask for SlaveUPS "UPSNAME@IP" and SlavePass ""
set Master as no when saving
if standalone or netserver
either use default value for NUT device, or allow to set them
${nut-driver@UPS }{Model} usbhid-ups you can use a drop-down listing all the device rpm -ql nut|grep /usr/sbin
${nut-driver@UPS }{Device} auto
only if Model genericups:
${nut-driver@UPS }{Type}
${nut-driver@UPS }{mfr}
${nut-driver@UPS }{mdl}
on saving set nut{Master} to yes if mode standalone or netserver
if mode=netserver set nut{access} to private otherwise set as localhost
run signal-event nut-conf
if enabled the status page could return upsc UPS@localhost, or if slave upsc UPSNAME@IP
if netclient set nut-monitor status to enabled and set status disabled to nut-server and all existing nut-driver@* ( we can set multiple via cli, so a loop would be great there)
if standalone|netserver then enable all nut related service if nut enabled
if nut disabled then set all related services to disabled