strings cleanup, small fixes

This commit is contained in:
jokob-sk
2025-07-29 07:25:22 +10:00
parent d08368e4f5
commit bf679cdc5d
5 changed files with 25 additions and 26 deletions

View File

@@ -148,10 +148,7 @@ function main () {
//initialize the table headers in the correct order //initialize the table headers in the correct order
var availableColumns = getSettingOptions("UI_device_columns").split(","); var availableColumns = getSettingOptions("UI_device_columns").split(",");
headersDefaultOrder = availableColumns.map(val => getString(val)); headersDefaultOrder = availableColumns.map(val => getString(val));
console.log(headersDefaultOrder);
var selectedColumns = JSON.parse(getSetting("UI_device_columns").replace(/'/g, '"')); var selectedColumns = JSON.parse(getSetting("UI_device_columns").replace(/'/g, '"'));
@@ -353,8 +350,6 @@ function initFilters() {
// Clear any existing filters in the DOM // Clear any existing filters in the DOM
$('#columnFilters').empty(); $('#columnFilters').empty();
console.log(displayedFilters);
// Ensure displayedFilters is an array and not empty // Ensure displayedFilters is an array and not empty
if (Array.isArray(displayedFilters) && displayedFilters.length > 0) { if (Array.isArray(displayedFilters) && displayedFilters.length > 0) {
$('#columnFiltersWrap').removeClass("hidden"); $('#columnFiltersWrap').removeClass("hidden");
@@ -690,8 +685,6 @@ function initializeDatatable (status) {
return JSON.stringify(query); // Send the JSON request return JSON.stringify(query); // Send the JSON request
}, },
"dataSrc": function (json) { "dataSrc": function (json) {
console.log(json);
// Set the total number of records for pagination // Set the total number of records for pagination
json.recordsTotal = json.devices.count || 0; json.recordsTotal = json.devices.count || 0;
json.recordsFiltered = json.devices.count || 0; json.recordsFiltered = json.devices.count || 0;

View File

@@ -437,7 +437,7 @@
if(archivedCount > 0) if(archivedCount > 0)
{ {
$('#showArchivedNumber').text(`(${archivedCount})`); $('#showArchivedNumber').text(`(${archivedCount})`);
} }
if(offlineCount > 0) if(offlineCount > 0)
@@ -968,7 +968,6 @@ $(window).on('resize', function () {
// init pop up hover boxes for device details // init pop up hover boxes for device details
initHoverNodeInfo(); initHoverNodeInfo();
// display toggles
$(document).ready(function () { $(document).ready(function () {
// Restore cached values on load // Restore cached values on load
const cachedOffline = getCache('showOffline'); const cachedOffline = getCache('showOffline');
@@ -981,12 +980,34 @@ $(document).ready(function () {
$('input[name="showArchived"]').prop('checked', cachedArchived === 'true'); $('input[name="showArchived"]').prop('checked', cachedArchived === 'true');
} }
// Function to enable/disable showArchived based on showOffline
function updateArchivedToggle() {
const isOfflineChecked = $('input[name="showOffline"]').is(':checked');
const archivedToggle = $('input[name="showArchived"]');
if (!isOfflineChecked) {
archivedToggle.prop('checked', false);
archivedToggle.prop('disabled', true);
setCache('showArchived', false);
} else {
archivedToggle.prop('disabled', false);
}
}
// Initial state on load
updateArchivedToggle();
// Bind change event for both toggles // Bind change event for both toggles
$('input[name="showOffline"], input[name="showArchived"]').on('change', function () { $('input[name="showOffline"], input[name="showArchived"]').on('change', function () {
const name = $(this).attr('name'); const name = $(this).attr('name');
const value = $(this).is(':checked'); const value = $(this).is(':checked');
setCache(name, value); setCache(name, value);
// Update state of showArchived if showOffline changed
if (name === 'showOffline') {
updateArchivedToggle();
}
// Refresh page after a brief delay to ensure cache is written // Refresh page after a brief delay to ensure cache is written
setTimeout(() => { setTimeout(() => {
location.reload(); location.reload();
@@ -994,6 +1015,7 @@ $(document).ready(function () {
}); });
}); });
</script> </script>

View File

@@ -5,14 +5,6 @@
"API_TOKEN_name": "API-Schlüssel", "API_TOKEN_name": "API-Schlüssel",
"API_display_name": "API", "API_display_name": "API",
"API_icon": "<i class=\"fa fa-arrow-down-up-across-line\"></i>", "API_icon": "<i class=\"fa fa-arrow-down-up-across-line\"></i>",
"APPRISE_HOST_description": "Apprise host URL starting with <code>http://</code> or <code>https://</code>. (do not forget to include <code>/notify</code> at the end)",
"APPRISE_HOST_name": "Apprise host URL",
"APPRISE_PAYLOAD_description": "Select the payload type sent to Apprise. For example <code>html</code> works well with emails, <code>text</code> with chat apps, such as Telegram.",
"APPRISE_PAYLOAD_name": "Payload type",
"APPRISE_SIZE_description": "The maximum size of the apprise payload as number of characters in the passed string. If above limit, it will be truncated and a <code>(text was truncated)</code> message is appended.",
"APPRISE_SIZE_name": "Max payload size",
"APPRISE_URL_description": "Apprise notification target URL. For example for Telegram it would be <code>tgram://{bot_token}/{chat_id}</code>.",
"APPRISE_URL_name": "Apprise notification URL",
"About_Design": "Entworfen für:", "About_Design": "Entworfen für:",
"About_Exit": "Abmelden", "About_Exit": "Abmelden",
"About_Title": "Netzwerksicherheitsscanner und Benachrichtigungsframework", "About_Title": "Netzwerksicherheitsscanner und Benachrichtigungsframework",

View File

@@ -5,14 +5,6 @@
"API_TOKEN_name": "Token de la API", "API_TOKEN_name": "Token de la API",
"API_display_name": "API", "API_display_name": "API",
"API_icon": "<i class=\"fa fa-arrow-down-up-across-line\"></i>", "API_icon": "<i class=\"fa fa-arrow-down-up-across-line\"></i>",
"APPRISE_HOST_description": "URL del host de Apprise que comienza con <code>http://</code> o <code>https://</code>. (no olvide incluir <code>/notify</code> al final)",
"APPRISE_HOST_name": "URL del host de Apprise",
"APPRISE_PAYLOAD_description": "Seleccione el tipo de carga útil enviada a Apprise. Por ejemplo, <code>html</code> funciona bien con correos electrónicos, <code>text</code> con aplicaciones de chat, como Telegram.",
"APPRISE_PAYLOAD_name": "Tipo de carga",
"APPRISE_SIZE_description": "El tamaño máximo de la carga útil de información como número de caracteres en la cadena pasada. Si supera el límite, se truncará y se agregará un mensaje <code>(text was truncated)</code>.",
"APPRISE_SIZE_name": "Tamaño máximo de carga útil",
"APPRISE_URL_description": "Informar de la URL de destino de la notificación. Por ejemplo, para Telegram sería <code>tgram://{bot_token}/{chat_id}</code>.",
"APPRISE_URL_name": "URL de notificación de Apprise",
"About_Design": "Diseñado para:", "About_Design": "Diseñado para:",
"About_Exit": "Salir", "About_Exit": "Salir",
"About_Title": "Escáner de seguridad de la red y marco de notificaciones", "About_Title": "Escáner de seguridad de la red y marco de notificaciones",

0
front/php/templates/language/fr_fr.json Normal file → Executable file
View File