From ee79b301c45d1dba9e340b0af0c65fa0c7fdbfdf Mon Sep 17 00:00:00 2001 From: qinglong Date: Sun, 14 Jun 2026 14:01:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=5Fhires=E5=85=BC=E5=AE=B9resize?= =?UTF-8?q?=E5=92=8CapplyResize=20(NET=E5=9B=BE=E8=A1=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/sentinel/dashboard.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sentinel/dashboard.html b/plugins/sentinel/dashboard.html index 9408a5e..1eac99c 100644 --- a/plugins/sentinel/dashboard.html +++ b/plugins/sentinel/dashboard.html @@ -273,7 +273,7 @@ try { _chartInstances[id] = { cpu: null, mem: null, net: null }; if (typeof MiniChart !== 'undefined') { - var _hires = function(mc){ var orig=mc.resize.bind(mc); mc.resize=function(){ orig(); mc.canvas.width*=2; mc.ctx.scale(2,1); mc.draw(); }; mc.resize(); }; + var _hires = function(mc){ var fn=mc.resize||mc.applyResize; if(!fn)return; var orig=fn.bind(mc); var wrap=function(){ orig(); mc.canvas.width*=2; mc.ctx.scale(2,1); mc.draw(); }; if(mc.resize)mc.resize=wrap; else mc.applyResize=wrap; wrap(); }; _chartInstances[id].cpu = new MiniChart(id+'-cpu', '#7aa2f7'); _hires(_chartInstances[id].cpu); _chartInstances[id].mem = new MiniChart(id+'-mem', '#9ece6a'); _hires(_chartInstances[id].mem); }