Archived
This commit is contained in:
1 parent
aadc19341d
commit
3841e93e32
13 files changed
+73
-24
No files matched your search
+11
-5
@@ -11,7 +11,7 @@
|
||||
return nativeFetch(input, init);
|
||||
};
|
||||
const page = document.body.dataset.page;
|
||||
const refreshSeconds = Number(document.body.dataset.refresh || '5');
|
||||
const refreshSeconds = Number(document.body.dataset.refresh || '10');
|
||||
const threshold = Number(document.body.dataset.onlineThreshold || '180');
|
||||
let snapshot = null;
|
||||
let interfacesData = {interfaces:[], suggested:null};
|
||||
@@ -2095,6 +2095,7 @@
|
||||
auditAutoRefreshTimer=setInterval(()=>{
|
||||
const modal=$('audit-modal');
|
||||
if(!modal||modal.hidden){stopAuditAutoRefresh();return;}
|
||||
if(document.hidden)return;
|
||||
loadAudit({showLoading:false});
|
||||
},interval);
|
||||
}
|
||||
@@ -2993,14 +2994,19 @@
|
||||
if(page==='dashboard'){
|
||||
loadMetricsHistory();
|
||||
if(document.body.dataset.role==='admin')loadDashboardDiagnostics();
|
||||
historyTimer=setInterval(loadMetricsHistory,60*1000);
|
||||
if(document.body.dataset.role==='admin')dashboardDiagnosticsTimer=setInterval(loadDashboardDiagnostics,60*1000);
|
||||
historyTimer=setInterval(()=>{if(!document.hidden)loadMetricsHistory();},60*1000);
|
||||
if(document.body.dataset.role==='admin')dashboardDiagnosticsTimer=setInterval(()=>{if(!document.hidden)loadDashboardDiagnostics();},60*1000);
|
||||
}
|
||||
if(page==='server'){
|
||||
loadServerDiagnostics();
|
||||
serverDiagnosticsTimer=setInterval(loadServerDiagnostics,60*1000);
|
||||
serverDiagnosticsTimer=setInterval(()=>{if(!document.hidden)loadServerDiagnostics();},60*1000);
|
||||
}
|
||||
if(page!=='settings'){
|
||||
let refreshing=false;
|
||||
const refreshVisible=async()=>{if(document.hidden||refreshing)return;refreshing=true;try{await fetchSnapshot(false);}finally{refreshing=false;}};
|
||||
timer=setInterval(refreshVisible,Math.max(2,refreshSeconds)*1000);
|
||||
document.addEventListener('visibilitychange',()=>{if(!document.hidden)refreshVisible();});
|
||||
}
|
||||
if(page!=='settings') timer=setInterval(()=>fetchSnapshot(false),Math.max(2,refreshSeconds)*1000);
|
||||
}
|
||||
boot();
|
||||
})();
|
||||
Reference in new issue
Block a user