From 42055ccdccaef6cac103604656ed6c2232a28585 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Mon, 22 Jun 2026 21:13:28 +0000 Subject: [PATCH] fix: dashboard setTimeout inside function, history chart properly merged --- panel/public/assets/js/admin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/public/assets/js/admin.js b/panel/public/assets/js/admin.js index c79394e..421f8b3 100644 --- a/panel/public/assets/js/admin.js +++ b/panel/public/assets/js/admin.js @@ -189,11 +189,11 @@
24-Hour History${hist.length} samples
- ${hist.length === 0 ? '

No history yet — collected every 5 minutes.

' : ''} + ${hist.length === 0 ? '

No history yet — collected every 5 min.

' : ''}
`; + setTimeout(() => { const canvas = document.getElementById('dash-hist-chart'); if (!canvas || !hist.length) return; if (window.Chart) { initStatsChart(canvas, hist); } else { const sc = document.createElement('script'); sc.src = 'https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js'; sc.onload = () => initStatsChart(canvas, hist); document.head.appendChild(sc); } }, 150); } - setTimeout(() => { const c = document.getElementById('dash-hist-chart'); if (!c || !hist.length) return; if (!window.Chart) { const s2 = document.createElement('script'); s2.src = 'https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js'; s2.onload = () => initStatsChart(c, hist); document.head.appendChild(s2); } else { initStatsChart(c, hist); } }, 150); // ── Server Status ──────────────────────────────────────────────────────────