diff --git a/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Wireguard/wireguard_en.lex b/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Wireguard/wireguard_en.lex index 198537e..73e644c 100644 --- a/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Wireguard/wireguard_en.lex +++ b/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Wireguard/wireguard_en.lex @@ -46,10 +46,10 @@ 'wrg_ERROR_WRONG_ACCT_TYPE' => 'The associated account shoult be a user or admin account.', 'wrg_ERROR_OCCURED' => 'An error occured', 'wrg_CLIENTS_ALREADY_CONFIGURED' => 'You can not alter the server ip, mask, private and public key as there are already some clients configured.', -'wrg_NO_CONF' => 'No configured client', +'wrg_NO_CONF' => 'No configured clients', 'wrg_INTERFACE' => 'Interface', 'wrg_CANCELLED' => 'Operation cancelled', 'wrg_SUCCESSFULLY_MODIFIED_CONF' => 'Client configuration successfully modified', 'wrg_SUCCESSFULLY_REMOVED_CONF' => 'Client successfully removed', 'wrg_SUCCESSFULLY_ADDED_CONF' => 'New client successfully added', -'wrg_SUCCESSFULLY_UPDATED_CONF' => 'Server configuration successfully modified', +'wrg_SUCCESSFULLY_UPDATED_CONF' => 'Server configuration successfully modified', \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/partials/_wrg_list.html.ep b/root/usr/share/smanager/themes/default/templates/partials/_wrg_list.html.ep index 7ce35f4..6705f09 100644 --- a/root/usr/share/smanager/themes/default/templates/partials/_wrg_list.html.ep +++ b/root/usr/share/smanager/themes/default/templates/partials/_wrg_list.html.ep @@ -1,73 +1,74 @@
-

<%=l 'wrg_DESC_MAIN_PAGE'%>

+

<%= l 'wrg_DESC_MAIN_PAGE' %>

- %= form_for 'wireguard' => (method => 'POST') => begin - %= hidden_field 'trt' => 'UPD' -

<%=l 'wrg_LABEL_CONFIG'%>

- %= submit_button l('wrg_EDIT_CONFIG'), class => 'action' - % end + %= form_for 'wireguard' => (method => 'POST') => begin + %= hidden_field 'trt' => 'UPD' +

<%= l 'wrg_LABEL_CONFIG' %>

+ %= submit_button l('wrg_EDIT_CONFIG'), class => 'action' + % end -

- %=l 'wrg_INTERFACE' - wg0

+

+ %= l 'wrg_INTERFACE' + wg0

-

- %=l 'wrg_LABEL_STATUS' - - %= $wrg_datas->{sstatus} -

+

+ %= l 'wrg_LABEL_STATUS' + + %= $wrg_datas->{sstatus} +

-

- %=l 'wrg_PUBLIC_KEY' - - %= $wrg_datas->{wgpub} -

+

+ %= l 'wrg_PUBLIC_KEY' + + %= $wrg_datas->{wgpub} +

-

- %=l 'wrg_IP' - - %= $wrg_datas->{wgip}.'/'.$wrg_datas->{wgmask} -

+

+ %= l 'wrg_IP' + + %= $wrg_datas->{wgip}.'/'.$wrg_datas->{wgmask} +

-

- %=l 'wrg_PORT' - - %= $wrg_datas->{wgport} -

+

+ %= l 'wrg_PORT' + + %= $wrg_datas->{wgport} +

+
- - - - +
- %=l 'wrg_PUBLIC_KEY' - - %=l 'wrg_INFO' - - %=l 'wrg_ENDPOINT' - - %=l 'wrg_VPN_IP' - - %=l 'wrg_LATEST_HANDSHAKE' - - %=l 'wrg_RECEIVED' - - %=l 'wrg_SENT' - - %=l 'wrg_KEEPALIVE' -
+ + + - % if (scalar @$wgstatus > 0) { - % foreach my $list (@$wgstatus) { - % #public-key | private-key | listen-port |persistent-keepalive - % my @line = split(' ',$list); - % next if $line[1] eq $wrg_datas->{wgpub}; - % my ($ginfo, $user); - % $ginfo = $c->get_wgs_info('info', "$line[3]"); - % $user = $c->get_wgs_info('user', "$line[3]"); - % use POSIX qw( strftime ); - % my $dateR= ($line[4] ) ? strftime("%Y-%m-%d %H:%M:%S", localtime($line[4])) : " "; - + % if (scalar @$wgstatus > 0) { + % foreach my $list (@$wgstatus) { + % #public-key | private-key | listen-port |persistent-keepalive + % my @line = split(' ',$list); + % next if $line[1] eq $wrg_datas->{wgpub}; + % my ($ginfo, $user); + % $ginfo = $c->get_wgs_info('info', "$line[3]"); + % $user = $c->get_wgs_info('user', "$line[3]"); + % use POSIX qw( strftime ); + % my $dateR= ($line[4] ) ? strftime("%Y-%m-%d %H:%M:%S", localtime($line[4])) : " "; + %= t td => (class => 'sme-border') => $line[0] %= t td => (class => 'sme-border') => "$user : $ginfo" %= t td => (class => 'sme-border') => $line[2] @@ -76,55 +77,56 @@ %= t td => (class => 'sme-border') => $line[5] %= t td => (class => 'sme-border') => $line[6] %= t td => (class => 'sme-border') => $line[7] - - % } - % } -
+ %= l 'wrg_PUBLIC_KEY' + + %= l 'wrg_INFO' + + %= l 'wrg_ENDPOINT' + + %= l 'wrg_VPN_IP' + + %= l 'wrg_LATEST_HANDSHAKE' + + %= l 'wrg_RECEIVED' + + %= l 'wrg_SENT' + + %= l 'wrg_KEEPALIVE' +
+ + % } + % } + - %= form_for 'wireguard' => (method => 'POST') => begin -
-

<%=l 'wrg_LABEL_CLIENTS'%>

- %= hidden_field 'trt' => 'NEW' - %= submit_button l('wrg_ADD_CLIENT'), class => 'action' - % end - - % if ( scalar @$wgconf == 0 ) { - %=l 'wrg_NO_CONF' - % } else { - - - - - % foreach my $conf (@$wgconf) { - % my $status = $c->l(uc($conf->prop('status') || 'enabled')); - - %= t td => (class => 'sme-border') => $conf->key - %= t td => (class => 'sme-border') => $conf->prop('user') || '' - %= t td => (class => 'sme-border') => $conf->prop('info') || '' - %= t td => (class => 'sme-border') => $status - % my $action = - % "" . l('wrg_QRCODE') . ""; - - % $action = - % "" . l('MODIFY') . ""; - - % $action = - % "" . l('REMOVE') . ""; - - - % } - -
- %=l 'wrg_CONF_NAME' - - %=l 'wrg_USER' - - %=l 'wrg_INFO' - - %=l 'wrg_LABEL_STATUS' - - %=l 'ACTION' -
<%= $c->render_to_string(inline => $action) %><%= $c->render_to_string(inline => $action) %><%= $c->render_to_string(inline => $action) %>
- %} + %= form_for 'wireguard' => (method => 'POST') => begin
-
+

<%= l 'wrg_LABEL_CLIENTS' %>

+ %= hidden_field 'trt' => 'NEW' + %= submit_button l('wrg_ADD_CLIENT'), class => 'action' + % end + + % if ( scalar @$wgconf == 0 ) { + %= l 'wrg_NO_CONF' + % } else { +
+ + + + + % foreach my $conf (@$wgconf) { + % my $status = $c->l(uc($conf->prop('status') || 'enabled')); + + %= t td => (class => 'sme-border') => $conf->key + %= t td => (class => 'sme-border') => $conf->prop('user') || '' + %= t td => (class => 'sme-border') => $conf->prop('info') || '' + %= t td => (class => 'sme-border') => $status + % my $action = + % "" . l('wrg_QRCODE') . ""; + + % $action = + % "" . l('MODIFY') . ""; + + % $action = + % "" . l('REMOVE') . ""; + + + % } + +
+ %= l 'wrg_CONF_NAME' + + %= l 'wrg_USER' + + %= l 'wrg_INFO' + + %= l 'wrg_LABEL_STATUS' + + %= l 'ACTION' +
<%= $c->render_to_string(inline => $action) %><%= $c->render_to_string(inline => $action) %><%= $c->render_to_string(inline => $action) %>
+ % } +
+ \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/partials/_wrg_mod.html.ep b/root/usr/share/smanager/themes/default/templates/partials/_wrg_mod.html.ep index 3b70ba8..20c2ad5 100644 --- a/root/usr/share/smanager/themes/default/templates/partials/_wrg_mod.html.ep +++ b/root/usr/share/smanager/themes/default/templates/partials/_wrg_mod.html.ep @@ -1,94 +1,103 @@ + +Mojolicious Template Code Formatter vmojofmt 0.1.9 +Input data: +Upload a file: +(none) +Remove empty lines from output +Formatted Output: +Output Syntax: +
- %= form_for '/wireguard2' => (method => 'POST') => begin -

- %=l 'wrg_DESC_MODIFY_CLIENT_PAGE' -

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

+ %= l 'wrg_DESC_MODIFY_CLIENT_PAGE' +

+
-

- %=l 'wrg_DESC_CONF_NAME' -

+

+ %= l 'wrg_DESC_CONF_NAME' +

-

- %=l 'wrg_CONF_NAME' - - %= $wrg_datas->{wgconf} -

+

+ %= l 'wrg_CONF_NAME' + + %= $wrg_datas->{wgconf} +

-

- %=l 'wrg_DESC_SELECT_ACCOUNT' -

+

+ %= l 'wrg_DESC_SELECT_ACCOUNT' +

-

- %=l 'wrg_SELECT_ACCOUNT' - - % param 'Account' => $wrg_datas->{account} unless param 'Account'; - %= select_field 'Account' => $c->get_existing_accounts(), class => 'input' -

+

+ %= l 'wrg_SELECT_ACCOUNT' + + % param 'Account' => $wrg_datas->{account} unless param 'Account'; + %= select_field 'Account' => $c->get_existing_accounts(), class => 'input' +

-

- %=l 'wrg_DESC_INFO_ACC_WIREGUARD' -

+

+ %= l 'wrg_DESC_INFO_ACC_WIREGUARD' +

-

- %=l 'wrg_INFO_ACC_WIREGUARD' - - % param 'Info' => $wrg_datas->{info} unless param 'Info'; - %=text_field 'Info' => size => '45', class => 'input' -

- -

- %=l 'wrg_DESC_PRIVATE' -

+

+ %= l 'wrg_INFO_ACC_WIREGUARD' + + % param 'Info' => $wrg_datas->{info} unless param 'Info'; + %= text_field 'Info' => size => '45', class => 'input' +

-

- %=l 'wrg_LABEL_PRIVATE' - - % param 'Private' => $wrg_datas->{private} unless param 'Private'; - %=text_field 'Private' => size => '45', class => 'input' -

- -

- %=l 'wrg_DESC_PUBLIC' -

+

+ %= l 'wrg_DESC_PRIVATE' +

-

- %=l 'wrg_LABEL_PUBLIC' - - % param 'Public' => $wrg_datas->{public} unless param 'Public'; - %=text_field 'Public' => size => '45', class => 'input' -

- -

- %=l 'wrg_DESC_STATUS' -

+

+ %= l 'wrg_LABEL_PRIVATE' + + % param 'Private' => $wrg_datas->{private} unless param 'Private'; + %= text_field 'Private' => size => '45', class => 'input' +

-

- %=l 'wrg_LABEL_STATUS' - - % param 'Status' => $wrg_datas->{status} unless param 'Status'; - %= select_field 'Status' => [[ (l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input' -

+

+ %= l 'wrg_DESC_PUBLIC' +

-

- %=l 'wrg_DESC_ALLOWEDIPS' -

+

+ %= l 'wrg_LABEL_PUBLIC' + + % param 'Public' => $wrg_datas->{public} unless param 'Public'; + %= text_field 'Public' => size => '45', class => 'input' +

-

- %=l 'wrg_LABEL_ALLOWEDIPS' - - % param 'Allowedips' => $wrg_datas->{allowedips} unless param 'Allowedips'; - %=text_field 'Allowedips' => size => '45', class => 'input' -

- -
- %= submit_button l('MODIFY'), name => 'modify', class => 'action' -
+

+ %= l 'wrg_DESC_STATUS' +

- %= hidden_field 'trt' => $wrg_datas->{trt} - %= hidden_field 'Wgconf' => $wrg_datas->{wgconf} - - % end +

+ %= l 'wrg_LABEL_STATUS' + + % param 'Status' => $wrg_datas->{status} unless param 'Status'; + %= select_field 'Status' => [[ (l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input' +

-
+

+ %= l 'wrg_DESC_ALLOWEDIPS' +

+ +

+ %= l 'wrg_LABEL_ALLOWEDIPS' + + % param 'Allowedips' => $wrg_datas->{allowedips} unless param 'Allowedips'; + %= text_field 'Allowedips' => size => '45', class => 'input' +

+ +
+ %= submit_button l('MODIFY'), name => 'modify', class => 'action' +
+ + %= hidden_field 'trt' => $wrg_datas->{trt} + %= hidden_field 'Wgconf' => $wrg_datas->{wgconf} + + % end + + \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/partials/_wrg_rem.html.ep b/root/usr/share/smanager/themes/default/templates/partials/_wrg_rem.html.ep index 0b4f493..ad98bc2 100644 --- a/root/usr/share/smanager/themes/default/templates/partials/_wrg_rem.html.ep +++ b/root/usr/share/smanager/themes/default/templates/partials/_wrg_rem.html.ep @@ -1,30 +1,38 @@
- %= form_for '/wireguard2' => (method => 'POST') => begin -

- %=l 'wrg_DESC_REMOVE_CLIENT' -

+ %= form_for '/wireguard2' => (method => 'POST') => begin +

+ %= l 'wrg_DESC_REMOVE_CLIENT' +

-


- %=l 'wrg_CONF_NAME' - - %= $wrg_datas->{account} -

+

+ %= l 'wrg_USER' + + %= $wrg_datas->{account} +

-

- %=l 'COMMENT' - - %= $wrg_datas->{wgcomment} -

+

+ %= l 'wrg_CONF_NAME' + + %= $wrg_datas->{wgconf} + +

-
- %= submit_button l('REMOVE'), name => 'remove', class => 'action left-btn' - %= submit_button l('CANCEL'), name => 'cancel', class => 'action center-btn' -
+

+ %= l 'COMMENT' + + %= $wrg_datas->{wgcomment} + +

+ +
+ %= submit_button l('REMOVE'), name => 'remove', class => 'action left-btn' + %= submit_button l('CANCEL'), name => 'cancel', class => 'action center-btn' +
+ + %= hidden_field 'trt' => $wrg_datas->{trt} + %= hidden_field 'Wgconf' => $wrg_datas->{wgconf} - %= hidden_field 'trt' => $wrg_datas->{trt} - %= hidden_field 'Wgconf' => $wrg_datas->{account} - % end -
\ No newline at end of file + \ No newline at end of file diff --git a/smeserver-wireguard.spec b/smeserver-wireguard.spec index 9fbb896..8010c75 100644 --- a/smeserver-wireguard.spec +++ b/smeserver-wireguard.spec @@ -1,4 +1,4 @@ -%define release 25 +%define release 26 %define version 1.0 %define debug_package %{nil} @@ -61,6 +61,9 @@ fi %changelog +* Fri Sep 26 2025 Brian Read 1.0-26.sme +- Fix remove logic, add in user name to rem panel re-format templates, add space to list panel [SME: 13168] + * Thu Sep 25 2025 Brian Read 1.0-25.sme - Sort outy Remove panel placement and operation of buttons [SME: 13168]