🔄Cache + Settings work

This commit is contained in:
jokob-sk
2024-08-03 21:07:12 +10:00
parent 4b2b8d6dd1
commit 1f7a38593d
17 changed files with 370 additions and 329 deletions

View File

@@ -259,7 +259,8 @@ function addList(element, clearInput = true) {
.attr("value", input)
.text(input);
const el = $(`#${toId}`).append(newOption);
// add new option
$(`#${toId}`).append(newOption);
// clear input
if (clearInput) {
@@ -269,6 +270,7 @@ function addList(element, clearInput = true) {
// Initialize interaction options only for the newly added option
initListInteractionOptions(newOption);
// flag something changes to prevent navigating from page
settingsChanged();
}
@@ -279,31 +281,6 @@ function removeFromList(element) {
.find("option:last")
.remove();
}
// ---------------------------------------------------------
function addInterface() {
ipMask = $("#ipMask").val();
ipInterface = $("#ipInterface").val();
full = ipMask + " --interface=" + ipInterface;
console.log(full);
if (ipMask == "" || ipInterface == "") {
showModalOk(
"Validation error",
"Specify both, the network mask and the interface"
);
} else {
$("#SCAN_SUBNETS").append(
$("<option disabled></option>").attr("value", full).text(full)
);
$("#ipMask").val("");
$("#ipInterface").val("");
settingsChanged();
}
}
// -------------------------------------------------------------------
// Function to remove an item from the select element
@@ -555,7 +532,7 @@ function generateOptionsOrSetOptions(
transformers = [] // Transformers to be applied to the values
) {
console.log(codeName);
// console.log(codeName);
// NOTE {value} options to replace with a setting or SQL value are handled in the cacheSettings() function
options = arrayToObject(createArray(getSettingOptions(codeName)))