From a3e625565e91a183d04b92682559e5d2b068eb21 Mon Sep 17 00:00:00 2001 From: l5y <220195275+l5yth@users.noreply.github.com> Date: Mon, 15 Sep 2025 07:03:54 +0200 Subject: [PATCH] Show daily node count in title and header (#49) --- web/public/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/public/index.html b/web/public/index.html index 5169483..51a2ffd 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -377,7 +377,7 @@ const nowSec = Date.now()/1000; renderTable(nodes, nowSec); renderMap(nodes, nowSec); - updateCount(nodes.length); + updateCount(nodes, nowSec); updateRefreshInfo(nodes, nowSec); } @@ -430,7 +430,9 @@ setInterval(refresh, REFRESH_MS); refreshBtn.addEventListener('click', refresh); - function updateCount(count) { + function updateCount(nodes, nowSec) { + const dayAgoSec = nowSec - 86400; + const count = nodes.filter(n => n.last_heard && Number(n.last_heard) >= dayAgoSec).length; const text = `${baseTitle} (${count})`; titleEl.textContent = text; headerEl.textContent = text;