From 266d8b279c630ebd081970cfa40f8cd1ca85c0e3 Mon Sep 17 00:00:00 2001 From: John Crisp Date: Sun, 18 May 2025 22:58:06 +0200 Subject: [PATCH] Hosts done and a few tweaks --- .../templates/partials/_grp_list.html.ep | 7 +- .../templates/partials/_hos_del.html.ep | 25 +- .../templates/partials/_hos_list.html.ep | 123 ++++---- .../templates/partials/_hos_ulc.html.ep | 30 +- .../templates/partials/_hos_upd.html.ep | 85 +++--- .../templates/partials/_iba_list.html.ep | 4 +- .../templates/partials/_usr_list.html.ep | 289 +++++++++--------- smeserver-manager-AdminLTE.spec | 5 +- 8 files changed, 282 insertions(+), 286 deletions(-) diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_list.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_list.html.ep index eec8c77..4dc35b8 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_list.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_list.html.ep @@ -4,14 +4,15 @@

-
- +
+
+
<%= hidden_field 'trt' => 'ADD' %>
-

<%=l 'grp_CURRENT_LIST' %>

+

<%= l 'grp_CURRENT_LIST' %>



% my $numGroups = @$groups; % if ($numGroups == 0){ diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_del.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_del.html.ep index 33fd675..3f169de 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_del.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_del.html.ep @@ -3,27 +3,32 @@ % my $btn = l('REMOVE');
- %#= form_for '/hostentriesd' => (method => 'POST') => begin - +

<%= l 'hos_REMOVE_TITLE'%>

- - <%= $c->l('hos_REMOVE_PAGE_DESCRIPTION', $hos_datas->{hostname}); %> - + +
+ +
+ <%= $c->l('hos_REMOVE_PAGE_DESCRIPTION', $hos_datas->{hostname}); %> +
+ +
+ <%= l 'hos_ABOUT_TO_REMOVE' %> +

+
- - - %= hidden_field 'trt' => $hos_datas->{trt} - %= hidden_field 'Hostname' => $hos_datas->{hostname} - %# end + <%= hidden_field 'trt' => $hos_datas->{trt} %> + <%= hidden_field 'Hostname' => $hos_datas->{hostname} %> +
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_list.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_list.html.ep index 5be25ad..32de2b4 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_list.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_list.html.ep @@ -3,81 +3,72 @@ % my $btn = l('hos_ADD_HOSTNAME');
- %#= form_for '/hostentries' => (method => 'POST') => begin -
- - %= hidden_field 'trt' => $hos_datas->{trt} - - %# end + <%= hidden_field 'trt' => $hos_datas->{trt} %>
- % my %dom_hos = %{$dom_hosts}; - % foreach my $domain ( sort ( keys %dom_hos ) ) { + % my %dom_hos = %{$dom_hosts}; + % foreach my $domain ( sort ( keys %dom_hos ) ) { -
+
+ <%= $c->l('hos_CURRENT_HOSTNAMES_FOR_LOCAL_DOMAIN', $domain); %> +
- - <%= $c->l('hos_CURRENT_HOSTNAMES_FOR_LOCAL_DOMAIN', $domain); %> - + + + + + + + + + + + -
- -
<%= l 'hos_HOSTNAME' %><%= l 'hos_HOSTTYPE' %><%= l 'IP_ADDRESS_OR_FQDN' %><%= l 'hos_ETHERNET_ADDRESS' %><%= l 'COMMENT' %><%= l 'ACTION' %>
- - - - - - - - - - - - - % foreach (@{$dom_hos{$domain}{'HOSTS'}}) { - - - - - - - - - - % } - -
<%= l 'hos_HOSTNAME' %><%= l 'hos_HOSTTYPE' %><%= l 'IP_ADDRESS_OR_FQDN' %><%= l 'hos_ETHERNET_ADDRESS' %><%= l 'COMMENT' %><%= l 'ACTION' %>
<%= $_->{'HostName'}; %><%= $_->{'HostType'}; %><%= $_->{'IP'}; %><%= $_->{'MACAddress'}; %><%= $_->{'Comment'}; %> - %my ($actionModify, $actionRemove) = ' '; - %my $static = $_->{'static'} || "no"; - %if ($static ne 'yes') { - %my $modify_text = l('MODIFY'); # Localized text - %my $csrf_token = "TOKEN"; # CSRF token for security - %my $hostentries_name = $_->{'HostName'}; # hostentries name extracted from the data structure - %$actionModify = qq{ - % - % - % - %}; - %my $remove_text = l('REMOVE'); # Localized text - %$csrf_token = "TOKEN"; # CSRF token for security - %#my $hostentries_name = $_->{'HostName'}; # hostentries name extracted from the data structure - %$actionRemove = qq{ - % - % - % - %}; - %} - <%= $c->render_to_string(inline => $actionModify) %> <%= $c->render_to_string(inline => $actionRemove) %> -
+ + % foreach (@{$dom_hos{$domain}{'HOSTS'}}) { + + <%= $_->{'HostName'}; %> + <%= $_->{'HostType'}; %> + <%= $_->{'IP'}; %> + <%= $_->{'MACAddress'}; %> + <%= $_->{'Comment'}; %> + + % my ($actionModify, $actionRemove) = ' '; + % my $static = $_->{'static'} || "no"; + % if ($static ne 'yes') { + %my $modify_text = l('MODIFY'); # Localized text + %my $csrf_token = "TOKEN"; # CSRF token for security + %my $hostentries_name = $_->{'HostName'}; # hostentries name extracted from the data structure + %$actionModify = qq{ + % + % + % + %}; + %my $remove_text = l('REMOVE'); # Localized text + %$csrf_token = "TOKEN"; # CSRF token for security + %#my $hostentries_name = $_->{'HostName'}; # hostentries name extracted from the data structure + %$actionRemove = qq{ + % + % + % + %}; + % } + <%= $c->render_to_string(inline => $actionModify) %> + <%= $c->render_to_string(inline => $actionRemove) %> + + + % } + + % }
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_ulc.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_ulc.html.ep index 098cb66..a576907 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_ulc.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_ulc.html.ep @@ -4,16 +4,14 @@ % my $btn = l('NEXT');
- %#= form_for '/hostentriesd' => (method => 'POST') => begin

% if ( $hos_datas->{trt} eq "ALC" ) { - %=l 'hos_CREATE_TYPE' - % } else { - %=l 'hos_MODIFY_TYPE' - % $btn = l('MODIFY'); +

<%=l 'hos_CREATE_TYPE' %>

+ % } else { +

<%=l 'hos_MODIFY_TYPE' %>

+ % $btn = l('MODIFY'); % } -
<%= l 'hos_LOCAL_PAGE_DESCRIPTION' %> @@ -22,6 +20,7 @@
<%= l 'hos_LOCAL_IP_DESCRIPTION' %>
+
<%= l 'hos_LOCAL_IP' %>
@@ -40,8 +39,8 @@
- % param 'Macaddress' => $hos_datas->{macaddress} unless param 'Macaddress'; - <%= text_field 'Macaddress' %> + % param 'Macaddress' => $hos_datas->{macaddress} unless param 'Macaddress'; + <%= text_field 'Macaddress' %>
@@ -50,15 +49,14 @@
- %= hidden_field 'trt' => $hos_datas->{trt} - %= hidden_field 'Hostname' => $hos_datas->{hostname} - %= hidden_field 'Name' => $hos_datas->{name} - %= hidden_field 'Domain' => $hos_datas->{domain} - %= hidden_field 'Comment'=> $hos_datas->{comment} - %= hidden_field 'Hosttype'=> $hos_datas->{hosttype} - %= hidden_field 'Externalip' => $hos_datas->{externalip} + <%= hidden_field 'trt' => $hos_datas->{trt} %> + <%= hidden_field 'Hostname' => $hos_datas->{hostname} %> + <%= hidden_field 'Name' => $hos_datas->{name} %> + <%= hidden_field 'Domain' => $hos_datas->{domain} %> + <%= hidden_field 'Comment'=> $hos_datas->{comment} %> + <%= hidden_field 'Hosttype'=> $hos_datas->{hosttype} %> + <%= hidden_field 'Externalip' => $hos_datas->{externalip} %> - %#end
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_upd.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_upd.html.ep index 31a2a23..5e9761f 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_upd.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_hos_upd.html.ep @@ -3,60 +3,74 @@ % my $btn = l('NEXT');
- %#= form_for '/hostentriesd' => (method => 'POST') => begin -

% if ( $hos_datas->{trt} eq "ADD" ) { - <%=l 'hos_CREATE_TITLE' %> +

<%=l 'hos_CREATE_TITLE' %>

% } else { - <%=l 'hos_MODIFY_TITLE' %> +

<%=l 'hos_MODIFY_TITLE' %>

% $btn = l('MODIFY'); % } - - -
<%= l 'hos_HOSTNAME_DESCRIPTION' %>
-
<%=l 'hos_HOSTNAME' %>
- +
+ <%= l 'hos_HOSTNAME_DESCRIPTION' %> +
+
+
+
+ <%=l 'hos_HOSTNAME' %> +
+
% if ( $hos_datas->{trt} eq "ADD" ) { % param 'Name' => $hos_datas->{name} unless param 'Name'; <%= text_field 'Name' %> % } else { - %= hidden_field 'Name' => $hos_datas->{name} + <%= hidden_field 'Name' => $hos_datas->{name} %> <%= $hos_datas->{name} %> % } -
- -
- <%= l 'DOMAIN' %> +
-
+
+ +
+
+ <%= l 'DOMAIN' %> +
+ +
% if ( $hos_datas->{trt} eq "ADD" ) { % param 'Domain' => $hos_datas->{domain} unless param 'Domain'; <%= select_field 'Domain', $c->domains_list() %> % } else { - %= hidden_field 'Domain' => $hos_datas->{domain} + <%= hidden_field 'Domain' => $hos_datas->{domain} %> <%= $hos_datas->{domain} %> % } -
- -
- <%= $c->l('COMMENT', ''); %> +
-
- % param 'Comment' => $hos_datas->{comment} unless param 'Comment'; - <%= text_field 'Comment' %> +
+ +
+
+ +
+
+ % param 'Comment' => $hos_datas->{comment} unless param 'Comment'; + + +
-
+
+ +
+
<%=l 'LOCATION' %> -
- -
- % param 'Hosttype' => $hos_datas->{hosttype} unless param 'Hosttype'; - %= select_field 'Hosttype', $c->hosttype_list(), class => "" +
+
+ % param 'Hosttype' => $hos_datas->{hosttype} unless param 'Hosttype'; + <%= select_field 'Hosttype', $c->hosttype_list(), class => "form-select"; %> +

@@ -66,14 +80,13 @@
- - %= hidden_field 'trt' => $hos_datas->{trt} - %= hidden_field 'Hostname' => $hos_datas->{hostname} - %= hidden_field 'Internalip' => $hos_datas->{internalip} - %= hidden_field 'Externalip' => $hos_datas->{externalip} - %= hidden_field 'Macaddress' => $hos_datas->{macaddress} - %#end + <%= hidden_field 'trt' => $hos_datas->{trt} %> + <%= hidden_field 'Hostname' => $hos_datas->{hostname} %> + <%= hidden_field 'Internalip' => $hos_datas->{internalip} %> + <%= hidden_field 'Externalip' => $hos_datas->{externalip} %> + <%= hidden_field 'Macaddress' => $hos_datas->{macaddress} %> +
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_iba_list.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_iba_list.html.ep index 3318d7d..b08f892 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_iba_list.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_iba_list.html.ep @@ -25,7 +25,7 @@
% my $numIbays = @$ibays; - % if ($numIbays == 0){ + % if ($numIbays == 0) { <%= l 'iba_NO_IBAYS' %> % } else { @@ -50,7 +50,7 @@ <%= $ibay->key %> <%= $ibay->prop('Name') %> - + % my ($actionModify, $actionResetPw, $actionRemove) = ' '; % if ($modifiable eq 'yes') { %my $modify_text = l('MODIFY'); # Localized text 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 a2f47b1..b54fbe8 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 @@ -3,174 +3,159 @@ % my $btn = l('usr_ADD_USER');
- %#= form_for '/useraccounts' => (method => 'POST') => begin - -
- -
- -
+
+
+ +
- %# end
- %= $c->render_to_string(inline => $c->l('usr_FIRSTPAGE_DESC')) + <%= $c->render_to_string(inline => $c->l('usr_FIRSTPAGE_DESC')) %>
- - + %#= dumper @$users - % my $numUsers = @$users; - % if ($numUsers == 0){ - %=l 'usr_NO_USER_ACCOUNTS' - % } else { + % my $numUsers = @$users; + % if ($numUsers == 0) { + <%=l 'usr_NO_USER_ACCOUNTS' %> + % } else {
- - - - - - - - - - - - - % foreach my $user (@$users) { +
- %=l 'ACCOUNT' - - %=l 'USER_NAME' - - %=l 'usr_VPN_CLIENT_ACCESS' - - %=l 'usr_FORWARDING_ADDRESS' - - %=l 'ACTION' -
+ + + + + + + + + + - % my $username = $user->key(); - % my $first = $user->prop('FirstName'); - % my $last = $user->prop('LastName'); - % my $lockable = $user->prop('Lockable') || 'yes'; - % my $removable = $user->prop('Removable') || 'yes'; - % my $fwd = (($user->prop('EmailForward') || 'local') =~ m/^forward|both$/) ? - % $user->prop('ForwardAddress') : ''; - % my $vpnaccess = $user->prop('VPNClientAccess') || 'no'; - % $vpnaccess = $vpnaccess eq 'yes' ? $c->l('YES') : $c->l('NO'); - % my $password_set = $user->prop('PasswordSet'); - % my $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure - % my $csrf_token = "TOKEN"; # CSRF token for security - % my $modify_text = l('MODIFY'); # Localized text - % my $remove_text = l('REMOVE'); # Localized text - % my $password_text = l("PASSWORD_RESET"); - % my $lock_text = l('usr_LOCK'); # Localized text - % my $roundcube_text = l('Webmail'); # Localized text - % my ($actionModify, $actionLock, $actionResetPw, $actionRemove,$actionroundcube) = ' '; - % my $thisdomain = $c->req->url->to_abs->host; - - - - - - - - % if ($useraccounts_user_name eq 'admin') { - %$actionModify = qq{ - % - % - % - %}; - %$actionResetPw = qq{ - % - % - % - %}; - % } else { - %$actionModify = qq{ - % - % - % - %}; - % } + % foreach my $user (@$users) { + + % my $username = $user->key(); + % my $first = $user->prop('FirstName'); + % my $last = $user->prop('LastName'); + % my $lockable = $user->prop('Lockable') || 'yes'; + % my $removable = $user->prop('Removable') || 'yes'; + % my $fwd = (($user->prop('EmailForward') || 'local') =~ m/^forward|both$/) ? + % $user->prop('ForwardAddress') : ''; + % my $vpnaccess = $user->prop('VPNClientAccess') || 'no'; + % $vpnaccess = $vpnaccess eq 'yes' ? $c->l('YES') : $c->l('NO'); + % my $password_set = $user->prop('PasswordSet'); + % my $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure + % my $csrf_token = "TOKEN"; # CSRF token for security + % my $modify_text = l('MODIFY'); # Localized text + % my $remove_text = l('REMOVE'); # Localized text + % my $password_text = l("PASSWORD_RESET"); + % my $lock_text = l('usr_LOCK'); # Localized text + % my $roundcube_text = l('Webmail'); # Localized text + % my ($actionModify, $actionLock, $actionResetPw, $actionRemove,$actionroundcube) = ' '; + % my $thisdomain = $c->req->url->to_abs->host; + + + + + + + + % if ($useraccounts_user_name eq 'admin') { + %$actionModify = qq{ + % + % + % + %}; + %$actionResetPw = qq{ + % + % + % + %}; + % } else { + %$actionModify = qq{ + % + % + % + %}; + % } - % if ($password_set ne 'yes') { + % if ($password_set ne 'yes') { - - %#$actionLock = l('ACCOUNT_LOCKED'); - - %$actionLock = qq{ - % - % - % - %}; - %$actionResetPw = qq{ - % - % - % + + %#$actionLock = l('ACCOUNT_LOCKED'); + + %$actionLock = qq{ + % + % + % + %}; + %$actionResetPw = qq{ + % + % + % + %}; + + % } elsif ($useraccounts_user_name ne 'admin') { + %$actionLock = qq{ + % + % + % + %}; + %$actionResetPw = qq{ + % + % + % + %}; + % } + + % if ( $removable eq 'yes' ) { + %$actionRemove = qq{ + % + % + % + %}; + % } + + + % $actionroundcube = qq{ + % + % + % %}; - % } elsif ($useraccounts_user_name ne 'admin') { - %$actionLock = qq{ - % - % - % - %}; - %$actionResetPw = qq{ - % - % - % - %}; - % } - - % if ( $removable eq 'yes' ) { - %$actionRemove = qq{ - % - % - % - %}; - % } - - - % $actionroundcube = qq{ - % - % - % - %}; - - - - - - - - % } - + + + + + + + % } +
<%=l 'ACCOUNT' %><%=l 'USER_NAME' %><%=l 'usr_VPN_CLIENT_ACCESS' %><%=l 'usr_FORWARDING_ADDRESS' %><%= l 'ACTION' %>
<%= $username %><%=$first %> <%=$last %><%= $vpnaccess %><%= $fwd %>
<%= $username %><%= $first %> <%=$last %><%= $vpnaccess %><%= $fwd %><%= $c->render_to_string(inline => $actionModify) %><%= $c->render_to_string(inline => $actionResetPw) %><%= $c->render_to_string(inline => $actionLock) %><%= $c->render_to_string(inline => $actionRemove) %><%= $c->render_to_string(inline => $actionroundcube) %>
<%= $c->render_to_string(inline => $actionModify) %><%= $c->render_to_string(inline => $actionResetPw) %><%= $c->render_to_string(inline => $actionLock) %><%= $c->render_to_string(inline => $actionRemove) %><%= $c->render_to_string(inline => $actionroundcube) %>
-
+ - <%} %> + % } - %= hidden_field 'trt' => $usr_datas->{trt} + <%= hidden_field 'trt' => $usr_datas->{trt} %> diff --git a/smeserver-manager-AdminLTE.spec b/smeserver-manager-AdminLTE.spec index 7c66a75..26539ef 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 21 +%define release 22 Summary: AdminLTE is an html framework for admin consoles - this rpm adds it to smeserver manager2 Name: %{name} Version: %{version} @@ -26,6 +26,9 @@ AdminLTE is an html framework for admin consoles wget https://github.com/ColorlibHQ/AdminLTE/archive/master.zip %changelog +* Sun May 18 2025 John Crisp 11.0.0-22.sme +- Hosts done and a few tweaks + * Sun May 18 2025 John Crisp 11.0.0-21.sme - Directory updated. More odd fixes.