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>
<div class="row g-3 align-items-center">
<div class="row g-3 align-items-center">
<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 class="col-auto">
% param 'SetsNumber' => $bac_datas->{setsNumber} unless param 'SetsNumber';
%= text_field 'SetsNumber', size => '3'
</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'
<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>
<br>
<div class="row g-3 align-items-center">
<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 class="col-auto">
% 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';
%= 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 class="col-auto">
<%= l 'AM/PM:' %>
</div>
<div class="col-auto">
% 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>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<%= l 'bac_WORKSTN_TIMEOUT' %>
<label for="inputWorkstationTimeout" class="col-form-label"><%= l 'bac_WORKSTN_TIMEOUT' %></label>
</div>
<div class="col-auto">
% 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>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<%= l 'bac_INC_ONLY_TIMEOUT' %>
</div>
<div class="col-auto">
% if ( $bac_datas->{incOnlyTimeout} eq 'checked' ) {
<input type='checkbox' name='IncOnlyTimeout' checked >
% } else {
%= check_box 'IncOnlyTimeout'
% }
% if ( $bac_datas->{incOnlyTimeout} eq 'checked' ) {
<input type='checkbox' name='IncOnlyTimeout' aria-describedby="enabled" checked >
% } else {
<input type='checkbox' name='IncOnlyTimeout' aria-describedby="disabled">
% }
</div>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<%= l 'bac_COMPRESSION_LEVEL' %>
<label for="inputBackupCompression" class="col-form-label"><%= l 'bac_COMPRESSION_LEVEL' %></label>
</div>
<div class="col-auto">
% 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>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<%= l 'bac_FULL_ONLY_ON' %>

View File

@ -72,11 +72,11 @@
% my $removable = $localnetwork->prop('Removable') || "yes";
% my $system = $localnetwork->prop('SystemLocalNetwork') || "no";
% if ( $system eq "yes" ) { $removable = "no"; }
<tr>
<td><%= $localnetwork->key %>
<td><%= $localnetwork->prop('Mask') %>
<td><%= $num_hosts %>
<td><%= $localnetwork->prop('Router') %>
<tr class="align-middle">
<td><%= $localnetwork->key %></td>
<td><%= $localnetwork->prop('Mask') %></td>
<td><%= $num_hosts %></td>
<td><%= $localnetwork->prop('Router') %></td>
% my $actionRemove = '&nbsp;';
% if ($removable eq "yes") {
%my $remove_text = l('REMOVE'); # Localized text

View File

@ -1,51 +1,61 @@
<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>
<p>
<span class="">
%=l 'prt_PRINTER_NAME', class => ""
</span>
<span class="">
%= text_field 'Name', class => ""
</span>
</p>
<form action="/smanager/printers2" method="POST">
<p>
<span class="">
%=l 'DESCRIPTION_BRIEF', class => ""
</span>
<span class="">
%= text_field 'Description', class => ""
</span>
</p>
<br>
<p>
<span class="">
%=l 'LOCATION', class => ""
</span>
<span class="">
%= select_field 'Location' => $c->printerLocation_list(), class => ""
</span>
</p>
<div>
<%= l 'prt_CREATE_NEW_DESC' %>
</div>
<p>
<br><br>
%= submit_button "$btn", class => ""
</p>
<br>
%= hidden_field 'trt' => $prt_datas->{trt}
<div class="row g-3 align-items-center">
<div class="col-md-1">
<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>
% end
<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>

View File

@ -1,30 +1,38 @@
<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}%>
(<%=$prt_datas->{description}%>)
<h2><%= l 'prt_REMOVE_PRINTER' %></h2>
<form action="/smanager/printers2" method="POST">
<br>
%=l 'prt_SPOOL_FILE_WARNING'
<div>
<%= l 'prt_ABOUT_TO_REMOVE'%> <%=$prt_datas->{printer}%> (<%=$prt_datas->{description}%>)
</div>
<br>
%=l 'prt_ARE_YOU_SURE'
</p>
<div class="text-danger">
<%= l 'prt_SPOOL_FILE_WARNING' %>
</div>
<p>
<br>
%= submit_button "$btn", class => ""
</p>
<div>
<%= l 'prt_ARE_YOU_SURE' %>
</div>
<br>
%= hidden_field 'trt' => $prt_datas->{trt}
%= 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>

View File

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

View File

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

View File

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

View File

@ -88,7 +88,7 @@
% my ($net, $mask) = split '/', $val;
% $mask = '255.255.255.255' unless ($mask);
% my ($numhosts,$a,$b) = esmith::util::computeHostRange($net,$mask);
<tr>
<tr class="align-middle">
<td><%= $net %></td>
<td><%= $mask %></td>
<td><%= $numhosts %></td>
@ -119,7 +119,7 @@
<br><br>
<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>
</div>
<div class="col-auto">
@ -130,7 +130,7 @@
<br>
<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>
</div>
<div class="col-auto">

View File

@ -1,6 +1,6 @@
%define name smeserver-manager-AdminLTE
%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
Name: %{name}
Version: %{version}
@ -29,6 +29,12 @@ AdminLTE is an html framework for admin consoles
wget https://github.com/ColorlibHQ/AdminLTE/archive/master.zip
%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
- Update flag detection JS [SME: 13039]
- Tweak login template