From 1db483c0530d6a441d0f01001ce1132e35a3cb52 Mon Sep 17 00:00:00 2001 From: Otto Date: Sun, 31 May 2026 16:24:40 +0200 Subject: [PATCH] feat(dashboard): extend stats bar --- templates/dashboard.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/dashboard.html b/templates/dashboard.html index b8c5654..d7c3c90 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -12,8 +12,10 @@
-Total
-OK
+
-Rej
-Pending
-Err
+
-Avg
@@ -132,8 +134,10 @@ async function loadStats() { const s = await api('/api/stats'); document.getElementById('statTotal').textContent = s.total; document.getElementById('statConfirmed').textContent = s.confirmed; + document.getElementById('statRejected').textContent = (s.rejected ?? '-'); document.getElementById('statPending').textContent = s.pending; document.getElementById('statErrors').textContent = s.errors; + document.getElementById('statAvgConf').textContent = (typeof s.avg_confidence === 'number') ? `${Math.round(s.avg_confidence * 100)}%` : '-'; } function updateStatsFromEvent(ev) { @@ -141,8 +145,10 @@ function updateStatsFromEvent(ev) { const s = ev.stats; document.getElementById('statTotal').textContent = s.total; document.getElementById('statConfirmed').textContent = s.confirmed; + if (document.getElementById('statRejected')) document.getElementById('statRejected').textContent = (s.rejected ?? '-'); document.getElementById('statPending').textContent = s.pending; document.getElementById('statErrors').textContent = s.errors; + if (document.getElementById('statAvgConf')) document.getElementById('statAvgConf').textContent = (typeof s.avg_confidence === 'number') ? `${Math.round(s.avg_confidence * 100)}%` : '-'; } function setView(view) {