diff --git a/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/flag-by-locale.js b/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/flag-by-locale.js index 7cc4348..b48aafb 100644 --- a/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/flag-by-locale.js +++ b/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/flag-by-locale.js @@ -208,7 +208,7 @@ document.addEventListener('DOMContentLoaded', () => { //if (!response.ok) throw new Error('Country not found'); //const data = await response.json(); //// Return the name in the native language - //return data[0].name.common; + //return data[0].name.common; //} catch (error) { //console.error(error); //return 'Unknown Country'; @@ -222,7 +222,7 @@ document.addEventListener('DOMContentLoaded', () => { function getCountryCodeFromLanguage(language) { return languageToCountryMap[language] ? languageToCountryMap[language].code : null; } - + function getCountryNameFromCountryCode(countryCode) { //alert(`Country code: ${countryCode}`); for (const language in languageToCountryMap) { @@ -263,11 +263,15 @@ 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); - + //alert(`Country Code: ${countryCode}, Is Unknown: ${isUnknown}`); // Debug country code and unknown flag status // Display the locale and the corresponding flag (or fallback) @@ -278,7 +282,7 @@ function displayLocaleAndFlag() { fallbackDiv.className = 'fallback-box'; fallbackDiv.textContent = `? ${userLocale.toUpperCase()}`; // Show ? and locale code inside the box document.getElementById('flag-container').appendChild(fallbackDiv); - + // Tooltip for fallback fallbackDiv.title = "Unknown Country"; // Tooltip for fallback //alert('Fallback triggered: Unknown Country'); // Debug fallback @@ -290,7 +294,7 @@ function displayLocaleAndFlag() { flagSpan.textContent = flag; // Use flag emoji flagSpan.title = countryName; // Tooltip for the flag in country language document.getElementById('flag-container').appendChild(flagSpan); - + //alert(`Flag Emoji: ${flag}`); // Debug flag emoji display } } 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 f7e517c..35b575b 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/remoteaccess.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/remoteaccess.html.ep @@ -24,12 +24,13 @@ <% my $btn = l('SAVE'); %> - +
% my $ipsec = $c->get_ipsecrw_status(); - % if ( $ipsec ) { - + + % if ( $ipsec) { +

<%= l 'rma_TITLE_IPSECRW' %>

<%= l 'rma_DESC_IPSECRW' %> @@ -42,7 +43,7 @@ <%= text_field 'IpsecrwSess', class => "" %>

- +
<%= $c->render_to_string(inline => $c->l('rma_DESC_IPSECRW_RESET')); %>
@@ -56,14 +57,14 @@

- %} + % }

<%= $c->l('rma_VALIDFROM_TITLE', $c->l('rma_REMOTE_MANAGEMENT')); %>

- +
- +
<%= l 'rma_VALIDFROM_DESC' %>
@@ -82,7 +83,7 @@ - + % foreach my $val ( @vals ) { % my ($net, $mask) = split '/', $val; % $mask = '255.255.255.255' unless ($mask); @@ -96,9 +97,9 @@ % } - + - + +

+

<%= l 'rma_TITLE_SSH' %>

- +
- +
<%= l 'rma_DESC_SSH' %>
@@ -156,7 +163,7 @@
- +
<%= l 'rma_LABEL_SSH_ADMIN' %> @@ -178,16 +185,16 @@ <%= select_field 'SshPasswordAuthentication' => [[(l 'NO'), 'no'], [(l 'YES'), 'yes']], class => "form-select" %>
- +
- <%= l 'rma_LABEL_SSH_PORT' %> +
-
+
% param 'SshTCPPort' => $c->get_ssh_port() unless param 'SshTCPPort'; - <%= text_field 'SshTCPPort' %> +
@@ -195,12 +202,14 @@ +

<%= l 'rma_TITLE_FTP_ACCESS' %>


+
<%= $c->render_to_string(inline => $c->l('rma_DESC_FTP_ACCESS')); %>
- +
@@ -212,16 +221,16 @@ <%= select_field 'FtpAccess' => $c->networkAccess_list(), class => "form-select" %>
- +

- +
<%= $c->render_to_string(inline => $c->l('rma_DESC_FTP_LOGIN')); %>

- +
<%= l 'rma_LABEL_FTP_LOGIN' %> @@ -237,19 +246,19 @@ % my $mode = $c->get_telnet_mode(); % if ( $mode ne 'off') { - +

<%= l 'rma_TITLE_TELNET_ACCESS' %>

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

- +
<%= l 'rma_LABEL_TELNET_ACCESS' %>