diff --git a/containers/libreportal/frontend/js/components/admin/system-metric-page.js b/containers/libreportal/frontend/js/components/admin/system-metric-page.js index 165d016..33d706b 100644 --- a/containers/libreportal/frontend/js/components/admin/system-metric-page.js +++ b/containers/libreportal/frontend/js/components/admin/system-metric-page.js @@ -203,7 +203,6 @@ class SystemMetricPage { this.points = []; } if (loading) loading.hidden = true; - if (this.points.length === 0 && empty) empty.hidden = false; this._renderChart(); this._renderStats(); this._renderFootMeta(); @@ -307,7 +306,17 @@ class SystemMetricPage { svg.setAttribute('viewBox', `0 0 ${W} ${H}`); svg.setAttribute('width', W); svg.setAttribute('height', H); - if (!this.points.length) { svg.innerHTML = ''; return; } + // Single source of truth for the empty overlay: it tracks whether we + // actually have points. Without this the "no samples" message, shown + // by _loadRange when history came back empty, never cleared once live + // ticks started filling the chart + stats — a confusing contradiction. + const empty = root.querySelector('.sys-detail-empty'); + if (!this.points.length) { + svg.innerHTML = ''; + if (empty) empty.hidden = false; + return; + } + if (empty) empty.hidden = true; const padL = 64, padR = 24, padT = 18, padB = 36; const innerW = Math.max(1, W - padL - padR); const innerH = Math.max(1, H - padT - padB);