add time/date

This commit is contained in:
2026-11-02 22:01:51 +01:00
parent fa4b3d8df2
commit d4e83364e2
2 changed files with 15 additions and 1 deletions
+11
View File
@@ -1,3 +1,13 @@
function updateClock() {
const clockEl = document.getElementById('live-clock');
if (clockEl) {
const now = new Date();
const dateStr = now.toLocaleDateString('it-IT', { day: '2-digit', month: '2-digit', year: 'numeric' });
const timeStr = now.toLocaleTimeString('it-IT', { hour12: false, hour: '2-digit', minute:'2-digit', second:'2-digit' });
clockEl.innerHTML = `<span style="color:var(--primary);">SYS_TIME:</span> ${dateStr} // <b style="color:var(--text-main);">${timeStr}</b> LOC`;
}
}
// --- VARIABILI GLOBALI E UI VIEW ---
let clients = [];
let me = { logged_in: false, user: '', role: '', allowed_nodes: '' };
@@ -129,6 +139,7 @@ window.addEventListener('DOMContentLoaded', () => {
initLayout();
initUI();
checkPushStatus();
setInterval(updateClock, 1000); updateClock();
setInterval(refreshStates, 15000);
setInterval(() => { refreshLogs(); refreshStats(); }, 60000);
checkServerUpdate();