From 91105c83c9edc7796cfacd4680c53d4db2d0fbdd Mon Sep 17 00:00:00 2001 From: John Crisp Date: Thu, 12 Jun 2025 18:52:32 +0200 Subject: [PATCH] Finish Backup add Printers and small tweaks --- .../templates/back_workstn_configure1.html.ep | 70 ++++++--- .../templates/partials/_ln_list.html.ep | 20 +-- .../templates/partials/_prt_add.html.ep | 90 +++++++----- .../templates/partials/_prt_del.html.ep | 40 +++-- .../templates/partials/_prt_list.html.ep | 138 ++++++++---------- .../templates/partials/_usr_list.html.ep | 4 +- .../AdminLTE/templates/printers.html.ep | 8 +- .../AdminLTE/templates/remoteaccess.html.ep | 6 +- smeserver-manager-AdminLTE.spec | 8 +- 9 files changed, 210 insertions(+), 174 deletions(-) diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/back_workstn_configure1.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/back_workstn_configure1.html.ep index e176568..279c1a7 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/back_workstn_configure1.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/back_workstn_configure1.html.ep @@ -148,77 +148,99 @@
-
+
- <%= l 'bac_NUMBER_OF_SETS' %> +
% param 'SetsNumber' => $bac_datas->{setsNumber} unless param 'SetsNumber'; - %= text_field 'SetsNumber', size => '3' -
-
- <%= l 'bac_NUMBER_OF_FILES_IN_SET' %> -
-
- % param 'Filesinset' => $bac_datas->{filesinset} unless param 'Filesinset'; - %= text_field 'Filesinset', size => '3' +
+ + +
+
- <%= l 'bac_WORKSTN_BACKUP_TIME' %> + +
+
+ % param 'Filesinset' => $bac_datas->{filesinset} unless param 'Filesinset'; + +
+
+ + + + +
+ +
+
+ +
% param 'BackupwkHour' => $bac_datas->{hour} unless param 'BackupwkHour'; - %= text_field 'BackupwkHour', size => '2' + +
+
% param 'BackupwkMin' => $bac_datas->{min} unless param 'BackupwkMin'; - %= text_field 'BackupwkMin', size => '2' +
<%= l 'AM/PM:' %>
% param 'BackupwkAMPM' => $bac_datas->{ampm} unless param 'BackupwkAMPM'; - %= select_field 'BackupwkAMPM' => ['AM', 'PM'], class => "form-select" + <%= select_field 'BackupwkAMPM' => ['AM', 'PM'], class => "form-select" %>
+
+
- <%= l 'bac_WORKSTN_TIMEOUT' %> +
% param 'BackupwkTimeout' => $bac_datas->{timeout} unless param 'BackupwkTimeout'; - %= text_field 'BackupwkTimeout', size => '2' +
+
+
<%= l 'bac_INC_ONLY_TIMEOUT' %>
-
- % if ( $bac_datas->{incOnlyTimeout} eq 'checked' ) { - - % } else { - %= check_box 'IncOnlyTimeout' - % } + % if ( $bac_datas->{incOnlyTimeout} eq 'checked' ) { + + % } else { + + % }
+
+
- <%= l 'bac_COMPRESSION_LEVEL' %> +
% param 'Compression' => $bac_datas->{compression} unless param 'Compression'; - %= text_field 'Compression', size => '1' +
+
+
<%= l 'bac_FULL_ONLY_ON' %> diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_ln_list.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_ln_list.html.ep index 5839f0e..66b051b 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_ln_list.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_ln_list.html.ep @@ -8,7 +8,7 @@ % my %ret; % unless (length($retref)) {%ret = (ret=>"");} % else {%ret = %$retref;} - + %# my $element_count = scalar(@ret); @@ -40,9 +40,9 @@ % }

- + % my $btn = l('ln_LOCALNETWORK_ADD'); - +
@@ -50,7 +50,7 @@

- + % my $numlocalnetworks = @$localnetworks; % if ($numlocalnetworks == 0) { <%= l 'ln_LOCAL_NETWORK_NONE' %> @@ -72,11 +72,11 @@ % my $removable = $localnetwork->prop('Removable') || "yes"; % my $system = $localnetwork->prop('SystemLocalNetwork') || "no"; % if ( $system eq "yes" ) { $removable = "no"; } - - <%= $localnetwork->key %> - <%= $localnetwork->prop('Mask') %> - <%= $num_hosts %> - <%= $localnetwork->prop('Router') %> + + <%= $localnetwork->key %> + <%= $localnetwork->prop('Mask') %> + <%= $num_hosts %> + <%= $localnetwork->prop('Router') %> % my $actionRemove = ' '; % if ($removable eq "yes") { %my $remove_text = l('REMOVE'); # Localized text @@ -97,6 +97,6 @@ <%= hidden_field 'trt' => $ln_datas->{trt} %> % } - +
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_add.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_add.html.ep index 923b43a..ee0a735 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_add.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_add.html.ep @@ -1,51 +1,61 @@
- % my $btn = l('ADD'); +

<%=l 'prt_CREATE_NEW_PRINTER' %>

- %= form_for '/printers2' => (method => 'POST') => begin -

-

- %=l 'prt_CREATE_NEW_PRINTER' -

-
- %=l 'prt_CREATE_NEW_DESC' -


-

- - %=l 'prt_PRINTER_NAME', class => "" - - - %= text_field 'Name', class => "" - -

+
-

- - %=l 'DESCRIPTION_BRIEF', class => "" - - - %= text_field 'Description', class => "" - -

+
-

- - %=l 'LOCATION', class => "" - - - %= select_field 'Location' => $c->printerLocation_list(), class => "" - -

+
+ <%= l 'prt_CREATE_NEW_DESC' %> +
-

-

- %= submit_button "$btn", class => "" -

+
- %= hidden_field 'trt' => $prt_datas->{trt} - - % end +
+
+ +
+
+ +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+ <%= l 'LOCATION'%> +
+
+ <%= select_field 'Location' => $c->printerLocation_list(), class => "form-select" %> +
+
+ +

+ + <%= hidden_field 'trt' => $prt_datas->{trt} %> + + % my $btn = l('ADD'); + +
+
+ +
+
+
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_del.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_del.html.ep index 58206dc..50d9320 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_del.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_del.html.ep @@ -1,30 +1,38 @@
- % my $btn = l('REMOVE'); - %= form_for '/printers2' => (method => 'POST') => begin -

-

- %=l 'prt_REMOVE_PRINTER' -

-

- <%=l 'prt_ABOUT_TO_REMOVE'%> <%=$prt_datas->{printer}%> - (<%=$prt_datas->{description}%>) +

<%= l 'prt_REMOVE_PRINTER' %>

+ +
+
- %=l 'prt_SPOOL_FILE_WARNING' +
+ <%= l 'prt_ABOUT_TO_REMOVE'%> <%=$prt_datas->{printer}%> (<%=$prt_datas->{description}%>) +
+
- %=l 'prt_ARE_YOU_SURE' -

+
+ <%= l 'prt_SPOOL_FILE_WARNING' %> +
-


- %= submit_button "$btn", class => "" -

+
+ <%= l 'prt_ARE_YOU_SURE' %> +
+ +
%= hidden_field 'trt' => $prt_datas->{trt} %= hidden_field 'printer' => $prt_datas->{printer} - % end + % my $btn = l('REMOVE'); + +
+
+ +
+
+
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_list.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_list.html.ep index ac7db49..a552f5d 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_list.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_prt_list.html.ep @@ -1,82 +1,72 @@
- % my $btn = l('prt_INITIAL_BTN'); - - %= form_for '/printers' => (method => 'POST') => begin - - %= hidden_field 'trt' => 'ADD' - -


- %= submit_button "$btn", class => "" -

- % end -

-

- %=l 'prt_CURRENT_LIST' -

+
+ + % my $btn = l('prt_INITIAL_BTN'); + <%= hidden_field 'trt' => 'ADD' %> + +
+
+ +
+
+
+ +
+ +

<%= l 'prt_CURRENT_LIST' %>



- % my $numPrinters = @$printerDrivers; - % if ($numPrinters == 0){ - %=l 'prt_NO_PRINTERS' - % } else { - - - - - - - - - - - - - % 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); - - %= 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 - - - % } - -
- %=l 'NAME' - - %=l 'DESCRIPTION' - - %=l 'LOCATION' - - %=l 'prt_REMOTE_ADDRESS' - - %=l 'prt_REMOTE_NAME' - - %=l 'ACTION' -
- %my $remove_text = l('REMOVE'); # Localized text - %my $csrf_token = "TOKEN"; # CSRF token for security - %my $printer_name = $printer->key; - %my $actionRemove = qq{ - % - % - % - %}; - <%= $c->render_to_string(inline => $actionRemove) %> -
- <%} %> -

+ + % my $numPrinters = @$printerDrivers; + % if ($numPrinters == 0){ + <%= l 'prt_NO_PRINTERS' %> + % } else { + + + + + + + + + + + + + % 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); + + + + + + + + + + % } + +
<%= l 'NAME' %><%= l 'DESCRIPTION' %><%= l 'LOCATION' %><%= l 'prt_REMOTE_ADDRESS' %><%= l 'prt_REMOTE_NAME' %><%= l 'ACTION' %>
<%= $printer->key %><%= $printer->prop('Description') %><%= $printer->prop('Location') %><%= $address %><%= $remoteName %> + % my $remove_text = l('REMOVE'); # Localized text + % my $csrf_token = "TOKEN"; # CSRF token for security + % my $printer_name = $printer->key; + % my $actionRemove = qq{ + % + % + % + % }; + <%= $c->render_to_string(inline => $actionRemove) %> +
+ % } +
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_usr_list.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_usr_list.html.ep index b54fbe8..e56989f 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_usr_list.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_usr_list.html.ep @@ -22,7 +22,7 @@
- + @@ -54,7 +54,7 @@ % my ($actionModify, $actionLock, $actionResetPw, $actionRemove,$actionroundcube) = ' '; % my $thisdomain = $c->req->url->to_abs->host; - + diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/printers.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/printers.html.ep index e9a2aec..257c65f 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/printers.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/printers.html.ep @@ -5,10 +5,10 @@
%if (config->{debug} == 1) { -
- %= dumper $c->current_route - %= dumper $prt_datas -
+
+            %= dumper $c->current_route
+            %= dumper $prt_datas
+        
% } % if ( stash 'error' ) { diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/remoteaccess.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/remoteaccess.html.ep index 406512d..8b630b8 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/remoteaccess.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/remoteaccess.html.ep @@ -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); -
+ @@ -119,7 +119,7 @@

-
+
@@ -130,7 +130,7 @@
-
+
diff --git a/smeserver-manager-AdminLTE.spec b/smeserver-manager-AdminLTE.spec index a9163ba..0fc11d2 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 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 11.0.0-35.sme +- Finish backup panels +- Finish printer panels +- Tidy Local Networks +- Small layout tweaks + * Wed Jun 11 2025 John Crisp 11.0.0-34.sme - Update flag detection JS [SME: 13039] - Tweak login template
<%=l 'ACCOUNT' %> <%=l 'USER_NAME' %> <%=l 'usr_VPN_CLIENT_ACCESS' %>
<%= $username %> <%= $first %> <%=$last %> <%= $vpnaccess %>
<%= $net %> <%= $mask %> <%= $numhosts %>