Finish Backup add Printers and small tweaks

This commit is contained in:
John Crisp 2025-06-12 18:52:32 +02:00
parent f3295483b2
commit 91105c83c9
9 changed files with 210 additions and 174 deletions

View File

@ -148,77 +148,99 @@
<br> <br>
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-2"> <div class="col-md-2">
<%= l 'bac_NUMBER_OF_SETS' %> <label for="inputNumberofSets" class="col-form-label"><%= l 'bac_NUMBER_OF_SETS' %></label>
</div> </div>
<div class="col-auto"> <div class="col-auto">
% param 'SetsNumber' => $bac_datas->{setsNumber} unless param 'SetsNumber'; % param 'SetsNumber' => $bac_datas->{setsNumber} unless param 'SetsNumber';
%= text_field 'SetsNumber', size => '3' <input type="text" name="SetsNumber" id="inputNumberofSets" class="form-control" maxlength="3" size="3" aria-describedby="Number of sets" value="<%= $bac_datas->{setsNumber} %>">
</div>
<div class="col-auto">
<%= l 'bac_NUMBER_OF_FILES_IN_SET' %>
</div>
<div class="col-auto">
% param 'Filesinset' => $bac_datas->{filesinset} unless param 'Filesinset';
%= text_field 'Filesinset', size => '3'
</div> </div>
</div> </div>
<br>
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-2"> <div class="col-md-2">
<%= l 'bac_WORKSTN_BACKUP_TIME' %> <label for="inputFilesinSet" class="col-form-label"><%= l 'bac_NUMBER_OF_FILES_IN_SET' %></label>
</div>
<div class="col-auto">
% param 'Filesinset' => $bac_datas->{filesinset} unless param 'Filesinset';
<input type="text" name="Filesinset" id="inputFilesinSet" class="form-control" maxlength="3" size="3" aria-describedby="Files in set" value="<%= $bac_datas->{filesinset} %>">
</div>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<label for="inputWorkstationBackupHour" class="col-form-label"><%= l 'bac_WORKSTN_BACKUP_TIME' %></label>
<label for="inputWorkstationBackupMin" class="col-form-label"></label>
</div> </div>
<div class="col-auto"> <div class="col-auto">
% param 'BackupwkHour' => $bac_datas->{hour} unless param 'BackupwkHour'; % param 'BackupwkHour' => $bac_datas->{hour} unless param 'BackupwkHour';
%= text_field 'BackupwkHour', size => '2' <input type="text" name="BackupwkHour" id="inputWorkstationBackupHour" class="form-control" maxlength="2" size="4" aria-describedby="Backup Hour" value="<%= $bac_datas->{hour} %>">
</div>
<div class="col-auto">
% param 'BackupwkMin' => $bac_datas->{min} unless param 'BackupwkMin'; % param 'BackupwkMin' => $bac_datas->{min} unless param 'BackupwkMin';
%= text_field 'BackupwkMin', size => '2' <input type="text" name="BackupwkMin" id="inputWorkstationBackupMin" class="form-control" maxlength="2" size="4" aria-describedby="Backup Minute" value="<%= $bac_datas->{min} %>">
</div> </div>
<div class="col-auto"> <div class="col-auto">
<%= l 'AM/PM:' %> <%= l 'AM/PM:' %>
</div> </div>
<div class="col-auto"> <div class="col-auto">
% param 'BackupwkAMPM' => $bac_datas->{ampm} unless param 'BackupwkAMPM'; % param 'BackupwkAMPM' => $bac_datas->{ampm} unless param 'BackupwkAMPM';
%= select_field 'BackupwkAMPM' => ['AM', 'PM'], class => "form-select" <%= select_field 'BackupwkAMPM' => ['AM', 'PM'], class => "form-select" %>
</div> </div>
</div> </div>
<br>
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-2"> <div class="col-md-2">
<%= l 'bac_WORKSTN_TIMEOUT' %> <label for="inputWorkstationTimeout" class="col-form-label"><%= l 'bac_WORKSTN_TIMEOUT' %></label>
</div> </div>
<div class="col-auto"> <div class="col-auto">
% param 'BackupwkTimeout' => $bac_datas->{timeout} unless param 'BackupwkTimeout'; % param 'BackupwkTimeout' => $bac_datas->{timeout} unless param 'BackupwkTimeout';
%= text_field 'BackupwkTimeout', size => '2' <input type="text" name="BackupwkTimeout" id="inputWorkstationTimeout" class="form-control" maxlength="2" size="2" aria-describedby="Workstation Timeout" value="<%= $bac_datas->{timeout} %>">
</div> </div>
</div> </div>
<br>
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-2"> <div class="col-md-2">
<%= l 'bac_INC_ONLY_TIMEOUT' %> <%= l 'bac_INC_ONLY_TIMEOUT' %>
</div> </div>
<div class="col-auto"> <div class="col-auto">
% if ( $bac_datas->{incOnlyTimeout} eq 'checked' ) { % if ( $bac_datas->{incOnlyTimeout} eq 'checked' ) {
<input type='checkbox' name='IncOnlyTimeout' checked > <input type='checkbox' name='IncOnlyTimeout' aria-describedby="enabled" checked >
% } else { % } else {
%= check_box 'IncOnlyTimeout' <input type='checkbox' name='IncOnlyTimeout' aria-describedby="disabled">
% } % }
</div> </div>
</div> </div>
<br>
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-2"> <div class="col-md-2">
<%= l 'bac_COMPRESSION_LEVEL' %> <label for="inputBackupCompression" class="col-form-label"><%= l 'bac_COMPRESSION_LEVEL' %></label>
</div> </div>
<div class="col-auto"> <div class="col-auto">
% param 'Compression' => $bac_datas->{compression} unless param 'Compression'; % param 'Compression' => $bac_datas->{compression} unless param 'Compression';
%= text_field 'Compression', size => '1' <input type="text" name="Compression" id="inputBackupCompression" class="form-control" maxlength="1" size="1" aria-describedby="Compression level" value="<%= $bac_datas->{compression} %>">
</div> </div>
</div> </div>
<br>
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-2"> <div class="col-md-2">
<%= l 'bac_FULL_ONLY_ON' %> <%= l 'bac_FULL_ONLY_ON' %>

View File

@ -8,7 +8,7 @@
% my %ret; % my %ret;
% unless (length($retref)) {%ret = (ret=>"");} % unless (length($retref)) {%ret = (ret=>"");}
% else {%ret = %$retref;} % else {%ret = %$retref;}
<!-- So at this point the next section is only relevant it ret is not defined --> <!-- So at this point the next section is only relevant it ret is not defined -->
%# my $element_count = scalar(@ret); %# my $element_count = scalar(@ret);
@ -40,9 +40,9 @@
% } % }
<br><br> <br><br>
% my $btn = l('ln_LOCALNETWORK_ADD'); % my $btn = l('ln_LOCALNETWORK_ADD');
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-2"> <div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= $btn %></button> <button type="submit" class="btn btn-primary"><%= $btn %></button>
@ -50,7 +50,7 @@
</div> </div>
<br> <br>
% my $numlocalnetworks = @$localnetworks; % my $numlocalnetworks = @$localnetworks;
% if ($numlocalnetworks == 0) { % if ($numlocalnetworks == 0) {
<%= l 'ln_LOCAL_NETWORK_NONE' %> <%= l 'ln_LOCAL_NETWORK_NONE' %>
@ -72,11 +72,11 @@
% my $removable = $localnetwork->prop('Removable') || "yes"; % my $removable = $localnetwork->prop('Removable') || "yes";
% my $system = $localnetwork->prop('SystemLocalNetwork') || "no"; % my $system = $localnetwork->prop('SystemLocalNetwork') || "no";
% if ( $system eq "yes" ) { $removable = "no"; } % if ( $system eq "yes" ) { $removable = "no"; }
<tr> <tr class="align-middle">
<td><%= $localnetwork->key %> <td><%= $localnetwork->key %></td>
<td><%= $localnetwork->prop('Mask') %> <td><%= $localnetwork->prop('Mask') %></td>
<td><%= $num_hosts %> <td><%= $num_hosts %></td>
<td><%= $localnetwork->prop('Router') %> <td><%= $localnetwork->prop('Router') %></td>
% my $actionRemove = '&nbsp;'; % my $actionRemove = '&nbsp;';
% if ($removable eq "yes") { % if ($removable eq "yes") {
%my $remove_text = l('REMOVE'); # Localized text %my $remove_text = l('REMOVE'); # Localized text
@ -97,6 +97,6 @@
</table> </table>
<%= hidden_field 'trt' => $ln_datas->{trt} %> <%= hidden_field 'trt' => $ln_datas->{trt} %>
% } % }
</form> </form>
</div> </div>

View File

@ -1,51 +1,61 @@
<div> <div>
% my $btn = l('ADD'); <h2><%=l 'prt_CREATE_NEW_PRINTER' %></h2>
%= form_for '/printers2' => (method => 'POST') => begin
<p>
<h2>
%=l 'prt_CREATE_NEW_PRINTER'
</h2>
<br>
%=l 'prt_CREATE_NEW_DESC'
</p>
<br> <br>
<p> <form action="/smanager/printers2" method="POST">
<span class="">
%=l 'prt_PRINTER_NAME', class => ""
</span>
<span class="">
%= text_field 'Name', class => ""
</span>
</p>
<p> <br>
<span class="">
%=l 'DESCRIPTION_BRIEF', class => ""
</span>
<span class="">
%= text_field 'Description', class => ""
</span>
</p>
<p> <div>
<span class=""> <%= l 'prt_CREATE_NEW_DESC' %>
%=l 'LOCATION', class => "" </div>
</span>
<span class="">
%= select_field 'Location' => $c->printerLocation_list(), class => ""
</span>
</p>
<p> <br>
<br><br>
%= submit_button "$btn", class => ""
</p>
%= hidden_field 'trt' => $prt_datas->{trt} <div class="row g-3 align-items-center">
<div class="col-md-1">
% end <label for="inputPrinterName" class="col-form-label"><%= l 'prt_PRINTER_NAME' %></label>
</div>
<div class="col-auto">
<input type="text" name="Name" id="inputPrinterName" class="form-control" aria-describedby="Printer Name">
</div>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-1">
<label for="inputPrinterDesc" class="col-form-label"><%= l 'DESCRIPTION_BRIEF' %></label>
</div>
<div class="col-auto">
<input type="text" name="Description" id="inputPrinterDesc" class="form-control" aria-describedby="Printer Description">
</div>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-1">
<%= l 'LOCATION'%>
</div>
<div class="col-auto">
<%= select_field 'Location' => $c->printerLocation_list(), class => "form-select" %>
</div>
</div>
<br><br>
<%= hidden_field 'trt' => $prt_datas->{trt} %>
% my $btn = l('ADD');
<div class="row g-3 align-items-center">
<div class="col-md-1">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
</form>
</div> </div>

View File

@ -1,30 +1,38 @@
<div> <div>
% my $btn = l('REMOVE');
%= form_for '/printers2' => (method => 'POST') => begin
<p>
<h2>
%=l 'prt_REMOVE_PRINTER'
</h2>
<br><br>
<%=l 'prt_ABOUT_TO_REMOVE'%> <%=$prt_datas->{printer}%> <h2><%= l 'prt_REMOVE_PRINTER' %></h2>
(<%=$prt_datas->{description}%>)
<form action="/smanager/printers2" method="POST">
<br> <br>
%=l 'prt_SPOOL_FILE_WARNING' <div>
<%= l 'prt_ABOUT_TO_REMOVE'%> <%=$prt_datas->{printer}%> (<%=$prt_datas->{description}%>)
</div>
<br> <br>
%=l 'prt_ARE_YOU_SURE' <div class="text-danger">
</p> <%= l 'prt_SPOOL_FILE_WARNING' %>
</div>
<p>
<br> <br>
%= submit_button "$btn", class => ""
</p>
<div>
<%= l 'prt_ARE_YOU_SURE' %>
</div>
<br>
%= hidden_field 'trt' => $prt_datas->{trt} %= hidden_field 'trt' => $prt_datas->{trt}
%= hidden_field 'printer' => $prt_datas->{printer} %= hidden_field 'printer' => $prt_datas->{printer}
% end % my $btn = l('REMOVE');
<div class="row g-3 align-items-center">
<div class="col-md-1">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
</form>
</div> </div>

View File

@ -1,82 +1,72 @@
<div> <div>
% my $btn = l('prt_INITIAL_BTN');
%= form_for '/printers' => (method => 'POST') => begin
%= hidden_field 'trt' => 'ADD'
<p>
<br> <br>
%= submit_button "$btn", class => ""
</p>
% end
<p> <form action="/smanager/printers" method="POST">
<h2>
%=l 'prt_CURRENT_LIST' % my $btn = l('prt_INITIAL_BTN');
</h2> <%= hidden_field 'trt' => 'ADD' %>
<div class="row g-3 align-items-center">
<div class="col-md-1">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
</form>
<br>
<h2><%= l 'prt_CURRENT_LIST' %></h2>
<br><br> <br><br>
% my $numPrinters = @$printerDrivers;
% if ($numPrinters == 0){ % my $numPrinters = @$printerDrivers;
%=l 'prt_NO_PRINTERS' % if ($numPrinters == 0){
% } else { <%= l 'prt_NO_PRINTERS' %>
<table class="table table-bordered"> % } else {
<thead> <table class="table table-bordered">
<tr> <thead>
<th class=""> <tr>
%=l 'NAME' <th><%= l 'NAME' %></th>
</th> <th><%= l 'DESCRIPTION' %></th>
<th class=""> <th><%= l 'LOCATION' %></th>
%=l 'DESCRIPTION' <th><%= l 'prt_REMOTE_ADDRESS' %></th>
</th> <th><%= l 'prt_REMOTE_NAME' %></th>
<th class=""> <th><%= l 'ACTION' %></th>
%=l 'LOCATION' </tr>
</th> </thead>
<th class=""> <tbody>
%=l 'prt_REMOTE_ADDRESS' % foreach my $printer (@$printerDrivers) {
</th> % my $address = ($printer->prop('Location') eq 'remote')
<th class=""> % ? $printer->prop('Address') : 'N/A';
%=l 'prt_REMOTE_NAME' % my $remoteName = ($printer->prop('Location') eq 'remote')
</th> % ? $printer->prop('RemoteName') : 'N/A';
<th class=""> % $remoteName = 'raw' unless ($remoteName);
%=l 'ACTION'
</th> <tr class="align-middle">
</tr> <td><%= $printer->key %></td>
</thead> <td><%= $printer->prop('Description') %></td>
<tbody> <td><%= $printer->prop('Location') %></td>
% foreach my $printer (@$printerDrivers) <td><%= $address %></td>
% { <td><%= $remoteName %></td>
% my $address = ($printer->prop('Location') eq 'remote') <td>
% ? $printer->prop('Address') : 'N/A'; % my $remove_text = l('REMOVE'); # Localized text
% my $remoteName = ($printer->prop('Location') eq 'remote') % my $csrf_token = "TOKEN"; # CSRF token for security
% ? $printer->prop('RemoteName') : 'N/A'; % my $printer_name = $printer->key;
% $remoteName = 'raw' unless ($remoteName); % my $actionRemove = qq{
<tr> % <a href="printers2?CsrfDef=$csrf_token&trt=DEL&&printer=$printer_name">
%= t td => (class => "") => $printer->key % <button type='button' class="btn btn-primary" title='$remove_text' >
%= t td => (class => "") => $printer->prop('Description') % $remove_text
%= t td => (class => "") => $printer->prop('Location') % </button>
%= t td => (class => "") => $address % </a>
%= t td => (class => "") => $remoteName % };
<td class=""> <%= $c->render_to_string(inline => $actionRemove) %>
%my $remove_text = l('REMOVE'); # Localized text </td>
%my $csrf_token = "TOKEN"; # CSRF token for security </tr>
%my $printer_name = $printer->key; % }
%my $actionRemove = qq{ </tbody>
% <a href="printers2?CsrfDef=$csrf_token&trt=DEL&&printer=$printer_name"> </table>
% <button type='button' class="" title='$remove_text' > % }
% $remove_text
% </button>
% </a>
%};
<%= $c->render_to_string(inline => $actionRemove) %>
</td>
</tr>
% }
</tbody>
</table>
<%} %>
</p>
</div> </div>

View File

@ -22,7 +22,7 @@
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr class=""> <tr>
<th><%=l 'ACCOUNT' %></th> <th><%=l 'ACCOUNT' %></th>
<th><%=l 'USER_NAME' %></th> <th><%=l 'USER_NAME' %></th>
<th><%=l 'usr_VPN_CLIENT_ACCESS' %></th> <th><%=l 'usr_VPN_CLIENT_ACCESS' %></th>
@ -54,7 +54,7 @@
% my ($actionModify, $actionLock, $actionResetPw, $actionRemove,$actionroundcube) = '&nbsp;'; % my ($actionModify, $actionLock, $actionResetPw, $actionRemove,$actionroundcube) = '&nbsp;';
% my $thisdomain = $c->req->url->to_abs->host; % my $thisdomain = $c->req->url->to_abs->host;
<tr> <tr class="align-middle">
<td><%= $username %></td> <td><%= $username %></td>
<td><%= $first %>&nbsp<%=$last %></td> <td><%= $first %>&nbsp<%=$last %></td>
<td><%= $vpnaccess %></td> <td><%= $vpnaccess %></td>

View File

@ -5,10 +5,10 @@
<div class="card-body"> <div class="card-body">
%if (config->{debug} == 1) { %if (config->{debug} == 1) {
<div> <pre>
%= dumper $c->current_route %= dumper $c->current_route
%= dumper $prt_datas %= dumper $prt_datas
</div> </pre>
% } % }
% if ( stash 'error' ) { % if ( stash 'error' ) {

View File

@ -88,7 +88,7 @@
% my ($net, $mask) = split '/', $val; % my ($net, $mask) = split '/', $val;
% $mask = '255.255.255.255' unless ($mask); % $mask = '255.255.255.255' unless ($mask);
% my ($numhosts,$a,$b) = esmith::util::computeHostRange($net,$mask); % my ($numhosts,$a,$b) = esmith::util::computeHostRange($net,$mask);
<tr> <tr class="align-middle">
<td><%= $net %></td> <td><%= $net %></td>
<td><%= $mask %></td> <td><%= $mask %></td>
<td><%= $numhosts %></td> <td><%= $numhosts %></td>
@ -119,7 +119,7 @@
<br><br> <br><br>
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-2"> <div class="col-md-1">
<label for="inputNetwork" class="col-form-label"><%= l 'NETWORK' %></label> <label for="inputNetwork" class="col-form-label"><%= l 'NETWORK' %></label>
</div> </div>
<div class="col-auto"> <div class="col-auto">
@ -130,7 +130,7 @@
<br> <br>
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-2"> <div class="col-md-1">
<label for="inputSubnetMask" class="col-form-label"><%= l 'rma_SUBNET_MASK' %></label> <label for="inputSubnetMask" class="col-form-label"><%= l 'rma_SUBNET_MASK' %></label>
</div> </div>
<div class="col-auto"> <div class="col-auto">

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 34 %define release 35
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}
Version: %{version} Version: %{version}
@ -29,6 +29,12 @@ 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
* Thu Jun 12 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-35.sme
- Finish backup panels
- Finish printer panels
- Tidy Local Networks
- Small layout tweaks
* Wed Jun 11 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-34.sme * Wed Jun 11 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-34.sme
- Update flag detection JS [SME: 13039] - Update flag detection JS [SME: 13039]
- Tweak login template - Tweak login template