diff --git a/static/js/app.js b/static/js/app.js index 3e98432..440e404 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -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 = `SYS_TIME: ${dateStr} // ${timeStr} 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(); diff --git a/templates/index.html b/templates/index.html index ec401f8..45fa6ee 100644 --- a/templates/index.html +++ b/templates/index.html @@ -27,7 +27,10 @@