11.0.0-44.sme Tidy up Nut Panels

This commit is contained in:
John Crisp 2025-07-06 17:25:17 +02:00
parent 305e7b75d2
commit 142c05fbd7
7 changed files with 178 additions and 168 deletions

View File

@ -110,7 +110,11 @@ html {
} */ } */
.user-table-max-width {
.user-table-max-wdith {
max-width: 50%; max-width: 50%;
} }
.nutTable tr td:nth-child(1){
width:30%;
}

View File

@ -23,21 +23,6 @@
%= include 'common_js' %= include 'common_js'
%= include 'common_css' %= include 'common_css'
<!-- should move the JS in here to a proper file if required -->
%# if (config 'hasJquery') {
%#= include 'partials/_js_imports'
%# }
<!-- Custom overrides js/css? -->
<!-- This needs refining - do contribs add in their own stuff?? -->
<!-- This needs refining -->
<!-- the sections below should add the correct JS/CSS per panel -->
%# if ($c->current_route eq 'nutups') {
%#= include 'partials/_nutups_overrides'
%# }
%# panel specific css file %# panel specific css file
% my $controller = stash('controller'); % my $controller = stash('controller');
% if ($controller) { % if ($controller) {
@ -48,8 +33,6 @@
% } % }
% } % }
</head> </head>
<body class="sidebar-expand-lg bg-body-tertiary app-loaded"> <body class="sidebar-expand-lg bg-body-tertiary app-loaded">

View File

@ -10,8 +10,8 @@
% if (config->{debug} == 1) { % if (config->{debug} == 1) {
<pre> <pre>
%= dumper $c->current_route <%= dumper $c->current_route %>
%= dumper $nut_data->{trt} <%= dumper $nut_data->{trt} %>
</pre> </pre>
% } % }
@ -22,28 +22,26 @@
% } % }
%if ($c->stash('first')) { %if ($c->stash('first')) {
<br><p> <br>
<div>
<%=$c->render_to_string(inline =>$c->l($c->stash('first'))) %> <%=$c->render_to_string(inline =>$c->l($c->stash('first'))) %>
</p> </div>
%} elsif ($c->stash('success')) { % } elsif ($c->stash('success')) {
<div class="text-success"> <div class="text-success">
<h2><%=$c->l('nut_Status_Report') %></h2> <h2><%=$c->l('nut_Status_Report') %></h2>
<div> <div>
<%= $c->l($c->stash('success')); %> <%= $c->l($c->stash('success')); %>
</div> </div>
</div> </div>
<br> % } elsif ($c->stash('error')) {
%} elsif ($c->stash('error')) {
<div class="text-danger"> <div class="text-danger">
<h2><%=$c->l('nut_Error_Status_Report') %></h2> <h2><%=$c->l('nut_Error_Status_Report') %></h2>
<div> <div>
<%= $c->l($c->stash('error')); %> <%= $c->l($c->stash('error')); %>
</div> </div>
</div> </div>
<br> % }
%}
%#Routing to partials according to trt parameter. %#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' %#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") { % if ($nut_data->{trt} eq "STATUS") {
<%= include 'partials/_nut_STATUS' %> <%= include 'partials/_nut_STATUS' %>
%} % }
<br> <br>
% if ($nut_data->{trt} eq "CONFIG") { % if ($nut_data->{trt} eq "CONFIG") {
<%= include 'partials/_nut_CONFIG' %> <%= include 'partials/_nut_CONFIG' %>
%} % }
<br>
</div> </div>

View File

@ -3,16 +3,9 @@
%# %#
<div> <div>
<!-- reetp This needs fixing -->
<!--
<script>
window.onload = function() {
SelectInput();
};
</script>
-->
% if (config->{debug} == 0) {
% if (config->{debug} == 1) {
<pre> <pre>
%= dumper $nut_data %= dumper $nut_data
</pre> </pre>
@ -38,7 +31,7 @@
%# param 'status' => $nut_data->{status} unless param 'status'; %# param 'status' => $nut_data->{status} unless param 'status';
% my @status_options = selected_field([['Disabled' => 'disabled'], ['Enabled' => 'enabled']], $nut_data->{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' %>
</div> </div>
</div> </div>
@ -51,12 +44,15 @@
<div class="col-auto"> <div class="col-auto">
% my @Nutmode_options = [['Standalone' => 'standalone'], ['Net Server' => 'netserver'], ['Net Client ' => 'netclient']]; % my @Nutmode_options = [['Standalone' => 'standalone'], ['Net Server' => 'netserver'], ['Net Client ' => 'netclient']];
% param 'Nutmode' => $nut_data->{Nutmode} unless param 'Nutmode'; % 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" %>
</div> </div>
</div> </div>
<br><br> <br><br>
<div class="masterups">
<div class="secondaryups">
<h2><%=l('nut_if_Net_Server')%></h2> <h2><%=l('nut_if_Net_Server')%></h2>
<br> <br>
@ -67,7 +63,7 @@
</div> </div>
<div class="col-auto"> <div class="col-auto">
% param 'MasterUPS_Name' => $nut_data->{MasterUPS_Name} unless param 'MasterUPS_Name'; % param 'MasterUPS_Name' => $nut_data->{MasterUPS_Name} unless param 'MasterUPS_Name';
<input type="text" name="MasterUPS_Name" pattern=".*" size="50" id="inputMasterUPSName" class="form-control" aria-describedby="Master UPS Name" placeholder="ups@localhost" value="<%= $nut_data->{MasterUPS_Name} %>" > <input type="text" name="MasterUPS_Name" pattern=".*" size="50" id="inputMasterUPSName" class="form-control" aria-describedby="Master UPS Name" placeholder="<%= 'ups@'. $nut_data->{'localip'} %>" value="<%= $nut_data->{MasterUPS_Name} %>" >
</div> </div>
</div> </div>
@ -87,6 +83,11 @@
</div> </div>
--> -->
</div> </div>
</div>
<div>
<h2>UPS Model</h2>
<br> <br>
@ -97,7 +98,7 @@
<div class="col-auto"> <div class="col-auto">
% my @UPS_Model_options = $c->get_model_options(); % my @UPS_Model_options = $c->get_model_options();
% param 'UPS_Model' => $nut_data->{UPS_Model} unless param 'UPS_Model'; % param 'UPS_Model' => $nut_data->{UPS_Model} unless param 'UPS_Model';
%= select_field 'UPS_Model' => \@UPS_Model_options, class => "form-select" <%= select_field 'UPS_Model' => \@UPS_Model_options, class => "form-select", id => 'UPS_Model_select' %>
</div> </div>
</div> </div>
@ -112,8 +113,11 @@
<input type="text" name="UPS_Device" pattern=".*" size="50" id="inputUPSDevice" class="form-control" aria-describedby="UPS Device" placeholder="auto (for usb)" value="<%= $nut_data->{UPS_Device} %>" > <input type="text" name="UPS_Device" pattern=".*" size="50" id="inputUPSDevice" class="form-control" aria-describedby="UPS Device" placeholder="auto (for usb)" value="<%= $nut_data->{UPS_Device} %>" >
</div> </div>
</div> </div>
</div>
<br><br> </div>
<div class="slaveups">
<h2><%=l('nut_if_Net_Client')%></h2> <h2><%=l('nut_if_Net_Client')%></h2>
@ -121,11 +125,11 @@
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-1"> <div class="col-md-1">
<label for="inputSlaveUPSDevice" class="col-form-label"><%= l ('nut_SlaveUPS_UPSNAME@IP') %></label> <label for="inputClientUPSDevice" class="col-form-label"><%= l ('nut_SlaveUPS_UPSNAME@IP') %></label>
</div> </div>
<div class="col-auto"> <div class="col-auto">
% param 'SlaveUPS_Name' => $nut_data->{SlaveUPS_Name} unless param 'SlaveUPS_Name'; % param 'ClientUPS_Name' => $nut_data->{ClientUPS_Name} unless param 'ClientUPS_Name';
<input type="text" name="SlaveUPS_Name" pattern=".*" size="50" id="inputSlaveUPSDevice" class="form-control" aria-describedby="Slave UPS Name" placeholder="upsname@IP" value="<%= $nut_data->{SlaveUPS_Name} %>" > <input type="text" name="ClientUPS_Name" pattern=".*" size="50" id="inputClientUPSDevice" class="form-control" aria-describedby="Client UPS Name" placeholder="upsname@IP[:port]" value="<%= $nut_data->{ClientUPS_Name} %>" >
</div> </div>
</div> </div>
@ -133,11 +137,23 @@
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-1"> <div class="col-md-1">
<label for="SlaveUPSPassword" class="col-form-label"><%= l ('nut_SlaveUPS_Password') %></label> <label for="ClientUPSUsername" class="col-form-label"><%= l ('nut_ClientUPS_Username') %></label>
</div> </div>
<div class="col-auto"> <div class="col-auto">
% param 'SlaveUPS_Pass' => $nut_data->{SlaveUPS_Pass} unless param 'SlaveUPS_Pass'; % param 'ClientUPS_User' => $nut_data->{ClientUPS_User} unless param 'ClientUPS_User';
<input type="password" name="SlaveUPS_Pass" id="SlaveUPSPassword" class="form-control" aria-describedby="Slave UPS Password" value="<%= $nut_data->{SlaveUPS_Pass} %>"> <input type="password" name="ClientUPS_User" id="ClientUPSUsername" class="form-control" aria-describedby="Client UPS Username" value="<%= $nut_data->{ClientUPS_User} %>" >
</div>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-1">
<label for="ClientUPSPassword" class="col-form-label"><%= l ('nut_ClientUPS_Password') %></label>
</div>
<div class="col-auto">
% param 'ClientUPS_Pass' => $nut_data->{ClientUPS_Pass} unless param 'ClientUPS_Pass';
<input type="password" name="ClientUPS_Pass" id="ClientUPSPassword" class="form-control" aria-describedby="Client UPS Password" value="<%= $nut_data->{ClientUPS_Pass} %>" >
</div> </div>
<!-- reetp fix toggle password --> <!-- reetp fix toggle password -->
<!-- <div class="col-auto"> <!-- <div class="col-auto">
@ -145,12 +161,15 @@
</div> </div>
--> -->
</div> </div>
</div>
<br><br> <br><br>
<div class="generics">
<h2><%=l('nut_if_genericups')%></h2> <h2><%=l('nut_if_genericups')%></h2>
<br> <br><br>
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-1"> <div class="col-md-1">
@ -186,6 +205,8 @@
</div> </div>
</div> </div>
</div>
<br> <br>
% param 'trt' => $nut_data->{trt} unless param 'trt'; % param 'trt' => $nut_data->{trt} unless param 'trt';
@ -199,8 +220,8 @@
</div> </div>
</div> </div>
%# Probably finally by a submit.
</form> </form>
<br> <br>
</div> </div>

View File

@ -3,37 +3,36 @@
%# %#
<div> <div>
<!-- <!--
<script> <script>
window.onload = function() { window.onload = function() {
SelectInput(); SelectInput();
}; };
</script> </script>
--> -->
% if (config->{debug} == 1) { % if (config->{debug} == 1) {
<pre> <pre>
%= dumper $nut_data <%= dumper $nut_data %>
</pre> </pre>
% } % }
% my $btn = l('nut_APPLY'); % my $btn = l('nut_APPLY');
%= form_for "nutupsu" => (method => 'POST') => begin
<form action="/smanager/nutupsu" method="POST">
% param 'trt' => $nut_data->{trt} unless param 'trt'; % param 'trt' => $nut_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $nut_data->{trt} <%= hidden_field 'trt' => $nut_data->{trt} %>
%# Inputs etc in here. %# Inputs etc in here.
<div class=""> <div>
<a href='nutupsd?trt=CONFIG'>
<%= l ('nut_Configure_NutUPS') %>
<a href='nutupsd?trt=CONFIG' class="">
%= l('nut_Configure_NutUPS')
</a> </a>
%#= link_to l('nut_Configure_NutUPS'), 'nutupsd?trt=CONFIG' , class=> 'link link1' %#= link_to l('nut_Configure_NutUPS'), 'nutupsd?trt=CONFIG' , class=> 'link link1'
</div> </div>
<br>
<h2><%= l ('nut_Status_of_the_controlled_UPS')%></h2> <h2><%= l ('nut_Status_of_the_controlled_UPS')%></h2>
@ -41,7 +40,9 @@
<%= l ('nut_Descriptive_paragraph') %> <%= l ('nut_Descriptive_paragraph') %>
</div> </div>
<!-- <br>
<!--
<span class=""> <span class="">
%=l('nut_Status_(from_upsc)') %=l('nut_Status_(from_upsc)')
</span> </span>
@ -50,10 +51,11 @@
%= text_area 'UPSStatus', cols=>55, rows=>35, Readonly=>'true' %= text_area 'UPSStatus', cols=>55, rows=>35, Readonly=>'true'
</span> </span>
<br> <br>
--> -->
%= include 'partials/_nut_UPS_STATUS' <%= include 'partials/_nut_UPS_STATUS' %>
%# Probably finally by a submit. %# Probably finally by a submit.
%end </form>
</div> </div>

View File

@ -1,11 +1,9 @@
<h1>UPS Status</h1> <h2>UPS Status</h2>
%= stylesheet '/css/nut_ups-status-page.css'
<div class="container-md"> <div class="container-md">
<div> <div>
<h2>Device Information</h2> <h2>Device Information</h2>
<table class="table table-bordered"> <table class="table table-bordered nutTable">
<tr> <tr>
<td>Manufacturer:</td> <td>Manufacturer:</td>
<td><%= $nut_data->{'ups_data'}->{'device.mfr'} %></td> <td><%= $nut_data->{'ups_data'}->{'device.mfr'} %></td>
@ -29,7 +27,7 @@
<div> <div>
<h2>Battery Status</h2> <h2>Battery Status</h2>
<table class="table table-bordered"> <table class="table table-bordered nutTable">
<tr> <tr>
<td>Charge:</td> <td>Charge:</td>
<td><%= $nut_data->{'ups_data'}->{'battery.charge'} %>%</td> <td><%= $nut_data->{'ups_data'}->{'battery.charge'} %>%</td>
@ -53,7 +51,7 @@
<div> <div>
<h2>Input Power</h2> <h2>Input Power</h2>
<table class="table table-bordered"> <table class="table table-bordered nutTable">
<tr> <tr>
<td>Voltage:</td> <td>Voltage:</td>
<td><%= $nut_data->{'ups_data'}->{'input.voltage'} %>V</td> <td><%= $nut_data->{'ups_data'}->{'input.voltage'} %>V</td>
@ -81,7 +79,7 @@
<div> <div>
<h2>UPS Status</h2> <h2>UPS Status</h2>
<table class="table table-bordered"> <table class="table table-bordered nutTable">
<tr> <tr>
<td>Status:</td> <td>Status:</td>
<td><%= $nut_data->{'ups_data'}->{'ups.status'} %></td> <td><%= $nut_data->{'ups_data'}->{'ups.status'} %></td>

View File

@ -1,6 +1,6 @@
%define name smeserver-manager-AdminLTE %define name smeserver-manager-AdminLTE
%define version 11.0.0 %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 Summary: AdminLTE is an html framework for admin consoles - this rpm adds it to smeserver manager2
Name: %{name} Name: %{name}
@ -29,6 +29,9 @@ AdminLTE is an html framework for admin consoles
wget https://github.com/ColorlibHQ/AdminLTE/archive/master.zip wget https://github.com/ColorlibHQ/AdminLTE/archive/master.zip
%changelog %changelog
* Sun Jul 06 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-44.sme
- Tidy up Nut panels
* Sun Jul 06 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-43.sme * Sun Jul 06 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-43.sme
- Make buttons smaller - Make buttons smaller
- Fix mail_data instances - Fix mail_data instances