From 99719398d76eafc552e97a9691630566e7ec61f8 Mon Sep 17 00:00:00 2001 From: qinglong Date: Sun, 14 Jun 2026 07:38:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20MiniChart=20=E5=88=9B=E5=BB=BA=E5=8A=A0?= =?UTF-8?q?=20try-catch,=20=E9=98=B2=E6=AD=A2=E5=8D=95=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=B8=AD=E6=96=AD=E5=BE=AA=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/sentinel/dashboard.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/sentinel/dashboard.html b/plugins/sentinel/dashboard.html index e0eacae..a8d43ff 100644 --- a/plugins/sentinel/dashboard.html +++ b/plugins/sentinel/dashboard.html @@ -206,11 +206,13 @@ if (typeof MiniChart !== 'undefined') { var mcBody = card.querySelector('.metrics-body'); if (mcBody) { - _chartInstances[id] = [ - new MiniChart(mcBody.querySelector('.chart-cpu'), '#7aa2f7'), - new MiniChart(mcBody.querySelector('.chart-mem'), '#9ece6a'), - new MiniChart(mcBody.querySelector('.chart-net'), '#e0af68'), - ]; + try { + _chartInstances[id] = [ + new MiniChart(mcBody.querySelector('.chart-cpu'), '#7aa2f7'), + new MiniChart(mcBody.querySelector('.chart-mem'), '#9ece6a'), + new MiniChart(mcBody.querySelector('.chart-net'), '#e0af68'), + ]; + } catch(e) { /* MiniChart init failed, continue without charts */ } } } } else {