mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
UI Settings refresh improvements + remove last button on subnets
This commit is contained in:
@@ -1210,6 +1210,13 @@ function resetInitializedFlag()
|
||||
sessionStorage.setItem(sessionStorageKey, "false");
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
function isAppInitialized()
|
||||
{
|
||||
return sessionStorage.getItem(sessionStorageKey) === "true";
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// check if cache needs to be refreshed because of setting changes
|
||||
$.get('api/app_state.json?nocache=' + Date.now(), function(appState) {
|
||||
@@ -1327,6 +1334,8 @@ const onAllCallsComplete = () => {
|
||||
|
||||
console.log('✔ Cache intialized');
|
||||
|
||||
location.reload();
|
||||
|
||||
};
|
||||
|
||||
// Call the function to execute the code
|
||||
|
||||
@@ -455,7 +455,7 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
||||
});
|
||||
|
||||
inputHtml += '</select></div>' +
|
||||
'<div><button class="btn btn-primary" onclick="removeInterfaces()">Remove all</button></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></div>`;
|
||||
} else if (setType === 'list' || setType === 'list.readonly') {
|
||||
|
||||
settingKeyOfLists.push(codeName);
|
||||
@@ -771,7 +771,20 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
||||
|
||||
} else
|
||||
{
|
||||
hideSpinner()
|
||||
// chekc if the app is initialized and hide the spinner
|
||||
if(isAppInitialized())
|
||||
{
|
||||
hideSpinner()
|
||||
}
|
||||
else
|
||||
{
|
||||
// reload the page if not initialized to give time the background tasks to finish
|
||||
setTimeout(() => {
|
||||
|
||||
window.location.reload()
|
||||
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('lastImportedTime').innerHTML = humanReadable;
|
||||
@@ -860,6 +873,7 @@ function updateModalState() {
|
||||
// ---------------------------------------------------------
|
||||
// Show last time settings have been imported
|
||||
|
||||
showSpinner()
|
||||
handleLoadingDialog()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user