From 142c05fbd77f882b44ae9ca259d069c744a1660f Mon Sep 17 00:00:00 2001 From: John Crisp Date: Sun, 6 Jul 2025 17:25:17 +0200 Subject: [PATCH] 11.0.0-44.sme Tidy up Nut Panels --- .../public/koozali/css/adminlte.koozali.css | 8 +- .../templates/layouts/AdminLTE.html.ep | 17 -- .../themes/AdminLTE/templates/nutups.html.ep | 25 +- .../templates/partials/_nut_CONFIG.html.ep | 243 ++++++++++-------- .../templates/partials/_nut_STATUS.html.ep | 36 +-- .../partials/_nut_UPS_STATUS.html.ep | 12 +- smeserver-manager-AdminLTE.spec | 5 +- 7 files changed, 178 insertions(+), 168 deletions(-) diff --git a/root/usr/share/smanager/themes/AdminLTE/public/koozali/css/adminlte.koozali.css b/root/usr/share/smanager/themes/AdminLTE/public/koozali/css/adminlte.koozali.css index c9c891e..d06388c 100644 --- a/root/usr/share/smanager/themes/AdminLTE/public/koozali/css/adminlte.koozali.css +++ b/root/usr/share/smanager/themes/AdminLTE/public/koozali/css/adminlte.koozali.css @@ -110,7 +110,11 @@ html { } */ - -.user-table-max-wdith { +.user-table-max-width { max-width: 50%; } + + +.nutTable tr td:nth-child(1){ + width:30%; +} diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/layouts/AdminLTE.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/layouts/AdminLTE.html.ep index c4a0cc8..a049403 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/layouts/AdminLTE.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/layouts/AdminLTE.html.ep @@ -23,21 +23,6 @@ %= include 'common_js' %= include 'common_css' - - %# if (config 'hasJquery') { - %#= include 'partials/_js_imports' - %# } - - - - - - - - %# if ($c->current_route eq 'nutups') { - %#= include 'partials/_nutups_overrides' - %# } - %# panel specific css file % my $controller = stash('controller'); % if ($controller) { @@ -48,8 +33,6 @@ % } % } - - diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/nutups.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/nutups.html.ep index 11b0813..3428a46 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/nutups.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/nutups.html.ep @@ -10,8 +10,8 @@ % if (config->{debug} == 1) {
-            %= dumper $c->current_route
-            %= dumper $nut_data->{trt}
+            <%= dumper $c->current_route %>
+            <%= dumper $nut_data->{trt} %>
         
% } @@ -22,28 +22,26 @@ % } %if ($c->stash('first')) { -

+
+

<%=$c->render_to_string(inline =>$c->l($c->stash('first'))) %> -

+
- %} elsif ($c->stash('success')) { + % } elsif ($c->stash('success')) {

<%=$c->l('nut_Status_Report') %>

<%= $c->l($c->stash('success')); %>
-
- - %} elsif ($c->stash('error')) { + % } elsif ($c->stash('error')) {

<%=$c->l('nut_Error_Status_Report') %>

<%= $c->l($c->stash('error')); %>
-
- %} + % } %#Routing to partials according to trt parameter. %#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement' @@ -52,14 +50,15 @@ % if ($nut_data->{trt} eq "STATUS") { <%= include 'partials/_nut_STATUS' %> - %} + % }
% if ($nut_data->{trt} eq "CONFIG") { - <%= include 'partials/_nut_CONFIG' %> - %} + % } + +
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_CONFIG.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_CONFIG.html.ep index b4c1469..472b7f2 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_CONFIG.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_CONFIG.html.ep @@ -3,16 +3,9 @@ %#
- - - % if (config->{debug} == 0) { + + % if (config->{debug} == 1) {
             %= dumper $nut_data
         
@@ -38,7 +31,7 @@ %# param 'status' => $nut_data->{status} unless param 'status'; % my @status_options = selected_field([['Disabled' => 'disabled'], ['Enabled' => 'enabled']], $nut_data->{status}); - <%= select_field 'status' => @status_options, class => "form-select" %> + <%= select_field 'status' => @status_options, class => "form-select", id => 'status_select' %>
@@ -51,139 +44,167 @@
% my @Nutmode_options = [['Standalone' => 'standalone'], ['Net Server' => 'netserver'], ['Net Client ' => 'netclient']]; % param 'Nutmode' => $nut_data->{Nutmode} unless param 'Nutmode'; - <%= select_field 'Nutmode' => @Nutmode_options, class => "form-select" %> + <%= select_field 'Nutmode' => @Nutmode_options, class => "input form-select", id => "Nutmode_select" %>


-

<%=l('nut_if_Net_Server')%>

+
+
-
+

<%=l('nut_if_Net_Server')%>

-
-
- +
+ +
+
+ +
+
+ % param 'MasterUPS_Name' => $nut_data->{MasterUPS_Name} unless param 'MasterUPS_Name'; + +
+
+ +
+ +
+
+ +
+
+ % param 'MasterUPS_Password' => $nut_data->{MasterUPS_Password} unless param 'MasterUPS_Password'; + +
+ + +
-
- % param 'MasterUPS_Name' => $nut_data->{MasterUPS_Name} unless param 'MasterUPS_Name'; - + +
+ +

UPS Model

+ +
+ +
+
+ <%= l ('nut_UPS_Model') %> +
+
+ % my @UPS_Model_options = $c->get_model_options(); + % param 'UPS_Model' => $nut_data->{UPS_Model} unless param 'UPS_Model'; + <%= select_field 'UPS_Model' => \@UPS_Model_options, class => "form-select", id => 'UPS_Model_select' %> +
+
+ +
+ +
+
+ +
+
+ % param 'UPS_Device' => $nut_data->{UPS_Device} unless param 'UPS_Device'; + +
+
+
-
+
-
-
- -
-
- % param 'MasterUPS_Password' => $nut_data->{MasterUPS_Password} unless param 'MasterUPS_Password'; - -
- - -
+

<%=l('nut_if_Net_Client')%>

-
+
-
-
- <%= l ('nut_UPS_Model') %> +
+
+ +
+
+ % param 'ClientUPS_Name' => $nut_data->{ClientUPS_Name} unless param 'ClientUPS_Name'; + +
-
- % my @UPS_Model_options = $c->get_model_options(); - % param 'UPS_Model' => $nut_data->{UPS_Model} unless param 'UPS_Model'; - %= select_field 'UPS_Model' => \@UPS_Model_options, class => "form-select" -
-
-
+
-
-
- +
+
+ +
+
+ % param 'ClientUPS_User' => $nut_data->{ClientUPS_User} unless param 'ClientUPS_User'; + +
-
- % param 'UPS_Device' => $nut_data->{UPS_Device} unless param 'UPS_Device'; - + +
+ +
+
+ +
+
+ % param 'ClientUPS_Pass' => $nut_data->{ClientUPS_Pass} unless param 'ClientUPS_Pass'; + +
+ +


-

<%=l('nut_if_Net_Client')%>

+
-
+

<%=l('nut_if_genericups')%>

-
-
- +

+ +
+
+ +
+
+ % param 'UPS_gen_Type' => $nut_data->{UPS_gen_Type} unless param 'UPS_gen_Type'; + +
-
- % param 'SlaveUPS_Name' => $nut_data->{SlaveUPS_Name} unless param 'SlaveUPS_Name'; - -
-
-
+
-
-
- +
+
+ +
+
+ % param 'UPS_gen_Mfr' => $nut_data->{UPS_gen_Mfr} unless param 'UPS_gen_Mfr'; + +
-
- % param 'SlaveUPS_Pass' => $nut_data->{SlaveUPS_Pass} unless param 'SlaveUPS_Pass'; - -
- - -
-

+
-

<%=l('nut_if_genericups')%>

- -
- -
-
- +
+
+ +
+
+ % param 'UPS_gen_Model' => $nut_data->{UPS_gen_Model} unless param 'UPS_gen_Model'; + +
-
- % param 'UPS_gen_Type' => $nut_data->{UPS_gen_Type} unless param 'UPS_gen_Type'; - -
-
-
- -
-
- -
-
- % param 'UPS_gen_Mfr' => $nut_data->{UPS_gen_Mfr} unless param 'UPS_gen_Mfr'; - -
-
- -
- -
-
- -
-
- % param 'UPS_gen_Model' => $nut_data->{UPS_gen_Model} unless param 'UPS_gen_Model'; - -

@@ -199,8 +220,8 @@
- %# Probably finally by a submit. +
\ No newline at end of file diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_STATUS.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_STATUS.html.ep index 1c44526..5de19d7 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_STATUS.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_STATUS.html.ep @@ -3,37 +3,36 @@ %#
- + --> % if (config->{debug} == 1) {
-            %= dumper $nut_data
+            <%= dumper $nut_data %>
         
% } % my $btn = l('nut_APPLY'); - %= form_for "nutupsu" => (method => 'POST') => begin + +
% param 'trt' => $nut_data->{trt} unless param 'trt'; - %= hidden_field 'trt' => $nut_data->{trt} + <%= hidden_field 'trt' => $nut_data->{trt} %> + %# Inputs etc in here. -
- - - - %= l('nut_Configure_NutUPS') - +
+ + <%= l ('nut_Configure_NutUPS') %> + %#= link_to l('nut_Configure_NutUPS'), 'nutupsd?trt=CONFIG' , class=> 'link link1' - -
+

<%= l ('nut_Status_of_the_controlled_UPS')%>

@@ -41,7 +40,9 @@ <%= l ('nut_Descriptive_paragraph') %>
- + --> - %= include 'partials/_nut_UPS_STATUS' + <%= include 'partials/_nut_UPS_STATUS' %> %# Probably finally by a submit. - %end +
+
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_UPS_STATUS.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_UPS_STATUS.html.ep index 043bf06..fb94a57 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_UPS_STATUS.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_nut_UPS_STATUS.html.ep @@ -1,11 +1,9 @@ -

UPS Status

- -%= stylesheet '/css/nut_ups-status-page.css' +

UPS Status

Device Information

- +
@@ -29,7 +27,7 @@

Battery Status

-
Manufacturer: <%= $nut_data->{'ups_data'}->{'device.mfr'} %>
+
@@ -53,7 +51,7 @@

Input Power

-
Charge: <%= $nut_data->{'ups_data'}->{'battery.charge'} %>%
+
@@ -81,7 +79,7 @@

UPS Status

-
Voltage: <%= $nut_data->{'ups_data'}->{'input.voltage'} %>V
+
diff --git a/smeserver-manager-AdminLTE.spec b/smeserver-manager-AdminLTE.spec index cb1fb82..8606ebb 100644 --- a/smeserver-manager-AdminLTE.spec +++ b/smeserver-manager-AdminLTE.spec @@ -1,6 +1,6 @@ %define name smeserver-manager-AdminLTE %define version 11.0.0 -%define release 43 +%define release 44 Summary: AdminLTE is an html framework for admin consoles - this rpm adds it to smeserver manager2 Name: %{name} @@ -29,6 +29,9 @@ AdminLTE is an html framework for admin consoles wget https://github.com/ColorlibHQ/AdminLTE/archive/master.zip %changelog +* Sun Jul 06 2025 John Crisp 11.0.0-44.sme +- Tidy up Nut panels + * Sun Jul 06 2025 John Crisp 11.0.0-43.sme - Make buttons smaller - Fix mail_data instances
Status: <%= $nut_data->{'ups_data'}->{'ups.status'} %>