UI auto-refresh #614 Schedule for undiscoverable devices to mark ONLINE work #617

This commit is contained in:
Jokob-sk
2024-04-03 23:01:36 +11:00
parent 69450c5885
commit 1367649554
18 changed files with 125 additions and 28 deletions

View File

@@ -628,10 +628,19 @@ function stopTimerRefreshData () {
// -----------------------------------------------------------------------------
function newTimerRefreshData (refeshFunction) {
function newTimerRefreshData (refeshFunction, timeToRefresh) {
if(timeToRefresh && (timeToRefresh != 0 || timeToRefresh != ""))
{
time = parseInt(timeToRefresh)
} else
{
time = 60000
}
timerRefreshData = setTimeout (function() {
refeshFunction();
}, 60000);
}, time);
}
@@ -1247,6 +1256,16 @@ const onAllCallsComplete = () => {
// Call the function to execute the code
executeOnce();
// Set timer for page refresh if configured
setTimeout(() => {
const refreshTime = getSetting("UI_REFRESH");
if (refreshTime && refreshTime !== "0" && refreshTime !== "") {
newTimerRefreshData(clearCache, refreshTime);
}
}, 10000);
console.log("init pialert_common.js");