Updated remote access and flag JS

This commit is contained in:
John Crisp 2025-06-11 11:58:16 +02:00
parent 22fbb582d2
commit eb05438d80
2 changed files with 52 additions and 39 deletions

View File

@ -263,8 +263,12 @@ document.addEventListener('DOMContentLoaded', () => {
function displayLocaleAndFlag() {
// Get the browser locale
const userLocale = navigator.language || navigator.userLanguage;
const userLocale = navigator.languages && navigator.languages.length
? navigator.languages[0]
: navigator.language;
//alert(`User Locale: ${userLocale}`); // Alert the detected locale
//console.log(navigator.languages); // Log language to console
const { flag, isUnknown, countryCode } = getFlagEmoji(userLocale);

View File

@ -28,7 +28,8 @@
<form action="/smanager/remoteaccess" method="POST">
% my $ipsec = $c->get_ipsecrw_status();
% if ( $ipsec ) {
<!-- reetp not tested -->
% if ( $ipsec) {
<h2><%= l 'rma_TITLE_IPSECRW' %></h2>
<div>
@ -56,7 +57,7 @@
<br><br>
<!--<hr class="" />-->
%}
% }
<!-- percequ include 'partials/_rma_pptp' -->
@ -109,16 +110,20 @@
<b><%= l('rma_NO_ENTRIES_YET'); %></b>
% }
<br>
<div>
<%= l 'rma_DESC_VALID_FROM_ENTRIES' %>
</div>
<br><br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<%= l 'NETWORK' %>
<label for="inputNetwork" class="col-form-label"><%= l 'NETWORK' %></label>
</div>
<div class="col-auto">
<%= text_field 'ValidFromNetwork', class => "" %>
<input type="text" name="ValidFromNetwork" id="inputNetwork" class="form-control" aria-describedby="Network">
</div>
</div>
@ -126,15 +131,17 @@
<div class="row g-3 align-items-center">
<div class="col-md-2">
<%= l 'rma_SUBNET_MASK' %>
<label for="inputSubnetMask" class="col-form-label"><%= l 'rma_SUBNET_MASK' %></label>
</div>
<div class="col-auto">
<%= text_field 'ValidFromMask', class => "" %>
<input type="text" name="ValidFromMask" id="inputSubnetMask" class="form-control" aria-describedby="Subnet">
</div>
</div>
<!--<hr class="" />-->
<br><br>
<h2><%= l 'rma_TITLE_SSH' %></h2>
<br>
@ -183,11 +190,11 @@
<div class="row g-3 align-items-center">
<div class="col-md-2">
<%= l 'rma_LABEL_SSH_PORT' %>
<label for="inputSSHPort" class="col-form-label"><%= l 'rma_LABEL_SSH_PORT' %></label>
</div>
<div class="col-auto">
<div class="col-sm-1">
% param 'SshTCPPort' => $c->get_ssh_port() unless param 'SshTCPPort';
<%= text_field 'SshTCPPort' %>
<input type="text" name="SshTCPPort" id="inputSSHPort" class="form-control" aria-describedby="SSH Port" value="<%= $c->get_ssh_port() %>">
</div>
</div>
@ -195,8 +202,10 @@
<!--<hr class="" />-->
<br><br>
<h2><%= l 'rma_TITLE_FTP_ACCESS' %></h2>
<br>
<div>
<%= $c->render_to_string(inline => $c->l('rma_DESC_FTP_ACCESS')); %>
</div>