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-wdith {
.user-table-max-width {
max-width: 50%;
}
.nutTable tr td:nth-child(1){
width:30%;
}

View File

@ -23,21 +23,6 @@
%= include 'common_js'
%= 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
% my $controller = stash('controller');
% if ($controller) {
@ -48,8 +33,6 @@
% }
% }
</head>
<body class="sidebar-expand-lg bg-body-tertiary app-loaded">

View File

@ -10,8 +10,8 @@
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $nut_data->{trt}
<%= dumper $c->current_route %>
<%= dumper $nut_data->{trt} %>
</pre>
% }
@ -22,9 +22,10 @@
% }
%if ($c->stash('first')) {
<br><p>
<br>
<div>
<%=$c->render_to_string(inline =>$c->l($c->stash('first'))) %>
</p>
</div>
% } elsif ($c->stash('success')) {
<div class="text-success">
@ -33,8 +34,6 @@
<%= $c->l($c->stash('success')); %>
</div>
</div>
<br>
% } elsif ($c->stash('error')) {
<div class="text-danger">
<h2><%=$c->l('nut_Error_Status_Report') %></h2>
@ -42,7 +41,6 @@
<%= $c->l($c->stash('error')); %>
</div>
</div>
<br>
% }
%#Routing to partials according to trt parameter.
@ -57,10 +55,11 @@
<br>
% if ($nut_data->{trt} eq "CONFIG") {
<%= include 'partials/_nut_CONFIG' %>
% }
<br>
</div>

View File

@ -3,16 +3,9 @@
%#
<div>
<!-- reetp This needs fixing -->
<!--
<script>
window.onload = function() {
SelectInput();
};
</script>
-->
% if (config->{debug} == 0) {
% if (config->{debug} == 1) {
<pre>
%= dumper $nut_data
</pre>
@ -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' %>
</div>
</div>
@ -51,12 +44,15 @@
<div class="col-auto">
% 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" %>
</div>
</div>
<br><br>
<div class="masterups">
<div class="secondaryups">
<h2><%=l('nut_if_Net_Server')%></h2>
<br>
@ -67,7 +63,7 @@
</div>
<div class="col-auto">
% 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>
@ -87,6 +83,11 @@
</div>
-->
</div>
</div>
<div>
<h2>UPS Model</h2>
<br>
@ -97,7 +98,7 @@
<div class="col-auto">
% 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"
<%= select_field 'UPS_Model' => \@UPS_Model_options, class => "form-select", id => 'UPS_Model_select' %>
</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} %>" >
</div>
</div>
</div>
<br><br>
</div>
<div class="slaveups">
<h2><%=l('nut_if_Net_Client')%></h2>
@ -121,11 +125,11 @@
<div class="row g-3 align-items-center">
<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 class="col-auto">
% param 'SlaveUPS_Name' => $nut_data->{SlaveUPS_Name} unless param 'SlaveUPS_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} %>" >
% param 'ClientUPS_Name' => $nut_data->{ClientUPS_Name} unless param 'ClientUPS_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>
@ -133,11 +137,23 @@
<div class="row g-3 align-items-center">
<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 class="col-auto">
% param 'SlaveUPS_Pass' => $nut_data->{SlaveUPS_Pass} unless param 'SlaveUPS_Pass';
<input type="password" name="SlaveUPS_Pass" id="SlaveUPSPassword" class="form-control" aria-describedby="Slave UPS Password" value="<%= $nut_data->{SlaveUPS_Pass} %>">
% param 'ClientUPS_User' => $nut_data->{ClientUPS_User} unless param 'ClientUPS_User';
<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>
<!-- reetp fix toggle password -->
<!-- <div class="col-auto">
@ -145,12 +161,15 @@
</div>
-->
</div>
</div>
<br><br>
<div class="generics">
<h2><%=l('nut_if_genericups')%></h2>
<br>
<br><br>
<div class="row g-3 align-items-center">
<div class="col-md-1">
@ -186,6 +205,8 @@
</div>
</div>
</div>
<br>
% param 'trt' => $nut_data->{trt} unless param 'trt';
@ -199,8 +220,8 @@
</div>
</div>
%# Probably finally by a submit.
</form>
<br>
</div>

View File

@ -13,27 +13,26 @@
% if (config->{debug} == 1) {
<pre>
%= dumper $nut_data
<%= dumper $nut_data %>
</pre>
% }
% 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';
%= hidden_field 'trt' => $nut_data->{trt}
<%= hidden_field 'trt' => $nut_data->{trt} %>
%# Inputs etc in here.
<div class="">
<a href='nutupsd?trt=CONFIG' class="">
%= l('nut_Configure_NutUPS')
<div>
<a href='nutupsd?trt=CONFIG'>
<%= l ('nut_Configure_NutUPS') %>
</a>
%#= link_to l('nut_Configure_NutUPS'), 'nutupsd?trt=CONFIG' , class=> 'link link1'
</div>
<br>
<h2><%= l ('nut_Status_of_the_controlled_UPS')%></h2>
@ -41,6 +40,8 @@
<%= l ('nut_Descriptive_paragraph') %>
</div>
<br>
<!--
<span class="">
%=l('nut_Status_(from_upsc)')
@ -52,8 +53,9 @@
<br>
-->
%= include 'partials/_nut_UPS_STATUS'
<%= include 'partials/_nut_UPS_STATUS' %>
%# Probably finally by a submit.
%end
</form>
</div>

View File

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

View File

@ -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 <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
- Make buttons smaller
- Fix mail_data instances