mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
Remove all/last on Settings
This commit is contained in:
@@ -888,7 +888,7 @@ input[readonly] {
|
||||
background-color: rgb(0, 0, 0);
|
||||
padding: 3px;
|
||||
transition: opacity 0.5s;
|
||||
opacity: 0;
|
||||
opacity: 0.1;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
|
||||
@@ -378,8 +378,6 @@ function showModalFieldInput (title, message, btnCancel=getString('Gen_Cancel'),
|
||||
$(`#${prefix}-cancel`).html (btnCancel);
|
||||
$(`#${prefix}-OK`).html (btnOK);
|
||||
|
||||
console.log(callbackFunction);
|
||||
|
||||
if ( callbackFunction != null)
|
||||
{
|
||||
modalCallbackFunction = callbackFunction;
|
||||
|
||||
@@ -185,15 +185,26 @@
|
||||
// -------------------------------------------------------------------
|
||||
// Function to remove an item from the select element
|
||||
function removeOptionItem(option) {
|
||||
settingsChanged();
|
||||
option.remove();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Update value of an item from the select elemen
|
||||
// Update value of an item from the select element
|
||||
function updateOptionItem(option, value) {
|
||||
settingsChanged();
|
||||
option.html(value);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Remove all options
|
||||
function removeAllOptions(element)
|
||||
{
|
||||
settingsChanged();
|
||||
$(`#${$(element).attr('my-input')}`).empty();
|
||||
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Function to initialize remove functionality on select options
|
||||
|
||||
|
||||
@@ -273,6 +273,7 @@
|
||||
"Events_Tablelenght_all": "Alle",
|
||||
"Events_Title": "Ereignisse",
|
||||
"Gen_Action": "Action",
|
||||
"Gen_Add": "",
|
||||
"Gen_Add_All": "",
|
||||
"Gen_AreYouSure": "Sind Sie sich sicher?",
|
||||
"Gen_Backup": "Sichern",
|
||||
@@ -287,6 +288,7 @@
|
||||
"Gen_Purge": "Aufr\u00e4umen",
|
||||
"Gen_ReadDocs": "Mehr in der Dokumentation",
|
||||
"Gen_Remove_All": "",
|
||||
"Gen_Remove_Last": "",
|
||||
"Gen_Restore": "Wiederherstellen",
|
||||
"Gen_Run": "Run",
|
||||
"Gen_Save": "Speichern",
|
||||
|
||||
@@ -261,6 +261,7 @@
|
||||
"Events_Tablelenght_all": "All",
|
||||
"Events_Title": "Events",
|
||||
"Gen_Action": "Action",
|
||||
"Gen_Add": "Add",
|
||||
"Gen_Add_All": "Add all",
|
||||
"Gen_AreYouSure": "Are you sure?",
|
||||
"Gen_Backup": "Run Backup",
|
||||
@@ -275,6 +276,7 @@
|
||||
"Gen_Purge": "Purge",
|
||||
"Gen_ReadDocs": "Read more in the docs.",
|
||||
"Gen_Remove_All": "Remove all",
|
||||
"Gen_Remove_Last": "Remove last",
|
||||
"Gen_Restore": "Run Restore",
|
||||
"Gen_Run": "Run",
|
||||
"Gen_Save": "Save",
|
||||
|
||||
@@ -271,6 +271,7 @@
|
||||
"Events_Tablelenght_all": "Todos",
|
||||
"Events_Title": "Eventos",
|
||||
"Gen_Action": "Acci\u00f3n",
|
||||
"Gen_Add": "",
|
||||
"Gen_Add_All": "",
|
||||
"Gen_AreYouSure": "\u00bfEst\u00e1s seguro?",
|
||||
"Gen_Backup": "Ejecutar copia de seguridad",
|
||||
@@ -285,6 +286,7 @@
|
||||
"Gen_Purge": "Purgar",
|
||||
"Gen_ReadDocs": "Lee m\u00e1s en los documentos.",
|
||||
"Gen_Remove_All": "",
|
||||
"Gen_Remove_Last": "",
|
||||
"Gen_Restore": "Ejecutar restauraci\u00f3n",
|
||||
"Gen_Run": "Ejecutar",
|
||||
"Gen_Save": "Guardar",
|
||||
|
||||
@@ -261,6 +261,7 @@
|
||||
"Events_Tablelenght_all": "",
|
||||
"Events_Title": "\u00c9v\u00e8nements",
|
||||
"Gen_Action": "Action",
|
||||
"Gen_Add": "",
|
||||
"Gen_Add_All": "",
|
||||
"Gen_AreYouSure": "",
|
||||
"Gen_Backup": "",
|
||||
@@ -275,6 +276,7 @@
|
||||
"Gen_Purge": "Purger",
|
||||
"Gen_ReadDocs": "",
|
||||
"Gen_Remove_All": "",
|
||||
"Gen_Remove_Last": "",
|
||||
"Gen_Restore": "",
|
||||
"Gen_Run": "Lancer",
|
||||
"Gen_Save": "Enregistrer",
|
||||
|
||||
@@ -261,6 +261,7 @@
|
||||
"Events_Tablelenght_all": "Tutti",
|
||||
"Events_Title": "Eventi",
|
||||
"Gen_Action": "Azione",
|
||||
"Gen_Add": "",
|
||||
"Gen_Add_All": "Aggiungi tutti",
|
||||
"Gen_AreYouSure": "Sei sicuro?",
|
||||
"Gen_Backup": "Esegui Backup",
|
||||
@@ -275,6 +276,7 @@
|
||||
"Gen_Purge": "Svuota",
|
||||
"Gen_ReadDocs": "Leggi di pi\u00f9 nella documentazione.",
|
||||
"Gen_Remove_All": "Rimuovi tutti",
|
||||
"Gen_Remove_Last": "",
|
||||
"Gen_Restore": "Esegui Ripristino",
|
||||
"Gen_Run": "Esegui",
|
||||
"Gen_Save": "Salva",
|
||||
|
||||
@@ -261,6 +261,7 @@
|
||||
"Events_Tablelenght_all": "",
|
||||
"Events_Title": "",
|
||||
"Gen_Action": "",
|
||||
"Gen_Add": "",
|
||||
"Gen_Add_All": "",
|
||||
"Gen_AreYouSure": "",
|
||||
"Gen_Backup": "",
|
||||
@@ -275,6 +276,7 @@
|
||||
"Gen_Purge": "",
|
||||
"Gen_ReadDocs": "",
|
||||
"Gen_Remove_All": "",
|
||||
"Gen_Remove_Last": "",
|
||||
"Gen_Restore": "",
|
||||
"Gen_Run": "",
|
||||
"Gen_Save": "",
|
||||
|
||||
@@ -261,6 +261,7 @@
|
||||
"Events_Tablelenght_all": "Wszystko",
|
||||
"Events_Title": "Wydarzenia",
|
||||
"Gen_Action": "Akcja",
|
||||
"Gen_Add": "",
|
||||
"Gen_Add_All": "",
|
||||
"Gen_AreYouSure": "Jeste\u015b pewien?",
|
||||
"Gen_Backup": "Wykonaj Kopie Zapasow\u0105",
|
||||
@@ -275,6 +276,7 @@
|
||||
"Gen_Purge": "Wyczy\u015b\u0107",
|
||||
"Gen_ReadDocs": "Przeczytaj wi\u0119cej w dokumentacji.",
|
||||
"Gen_Remove_All": "",
|
||||
"Gen_Remove_Last": "",
|
||||
"Gen_Restore": "Wykonaj Przywracanie",
|
||||
"Gen_Run": "Wykonaj",
|
||||
"Gen_Save": "Zapisz",
|
||||
|
||||
@@ -261,6 +261,7 @@
|
||||
"Events_Tablelenght_all": "",
|
||||
"Events_Title": "",
|
||||
"Gen_Action": "",
|
||||
"Gen_Add": "",
|
||||
"Gen_Add_All": "",
|
||||
"Gen_AreYouSure": "",
|
||||
"Gen_Backup": "",
|
||||
@@ -275,6 +276,7 @@
|
||||
"Gen_Purge": "",
|
||||
"Gen_ReadDocs": "",
|
||||
"Gen_Remove_All": "",
|
||||
"Gen_Remove_Last": "",
|
||||
"Gen_Restore": "",
|
||||
"Gen_Run": "",
|
||||
"Gen_Save": "",
|
||||
|
||||
@@ -261,6 +261,7 @@
|
||||
"Events_Tablelenght_all": "\u0412\u0441\u0435",
|
||||
"Events_Title": "\u0421\u043e\u0431\u044b\u0442\u0438\u044f",
|
||||
"Gen_Action": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f",
|
||||
"Gen_Add": "",
|
||||
"Gen_Add_All": "",
|
||||
"Gen_AreYouSure": "\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b?",
|
||||
"Gen_Backup": "\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435",
|
||||
@@ -275,6 +276,7 @@
|
||||
"Gen_Purge": "\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c",
|
||||
"Gen_ReadDocs": "\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.",
|
||||
"Gen_Remove_All": "",
|
||||
"Gen_Remove_Last": "",
|
||||
"Gen_Restore": "\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435",
|
||||
"Gen_Run": "\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c",
|
||||
"Gen_Save": "\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c",
|
||||
|
||||
@@ -459,7 +459,8 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
||||
inputHtml += `</select>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<button class="btn btn-primary" onclick="removeInterfaces()">Remove all</button>
|
||||
<button class="btn btn-primary" my-input="${codeName}" onclick="removeFromList(this)">Remove last</button>
|
||||
<button class="btn btn-primary" my-input="${codeName}" onclick="removeAllOptions(this)">Remove all</button>
|
||||
</div>`;
|
||||
} else if (setType === 'list' || setType === 'list.readonly') {
|
||||
|
||||
@@ -485,7 +486,10 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
||||
});
|
||||
|
||||
inputHtml += '</select></div>' +
|
||||
`<div><button class="btn btn-primary" my-input="${codeName}" onclick="removeFromList(this)">Remove last</button></div>`;
|
||||
`<div>
|
||||
<button class="btn btn-primary" my-input="${codeName}" onclick="removeFromList(this)">Remove last</button>
|
||||
<button class="btn btn-primary" my-input="${codeName}" onclick="removeAllOptions(this)">Remove all</button>
|
||||
</div>`;
|
||||
} else if (setType === 'json') {
|
||||
inputHtml = `<textarea class="form-control input" my-data-type="${setType}" id="${codeName}" readonly>${JSON.stringify(val, null, 2)}</textarea>`;
|
||||
}
|
||||
@@ -651,14 +655,6 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
||||
settingsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
function removeInterfaces()
|
||||
{
|
||||
settingsChanged();
|
||||
$('#SCAN_SUBNETS').empty();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
function saveSettings() {
|
||||
|
||||
Reference in New Issue
Block a user