From ab5444d3449d5960e96576f16b09aba7783911fd Mon Sep 17 00:00:00 2001 From: qinglong Date: Sun, 14 Jun 2026 13:53:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20MiniChart=202x=20DPR=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/sentinel/dashboard.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/sentinel/dashboard.html b/plugins/sentinel/dashboard.html index 8be2b41..9cf9dd6 100644 --- a/plugins/sentinel/dashboard.html +++ b/plugins/sentinel/dashboard.html @@ -273,8 +273,14 @@ try { _chartInstances[id] = { cpu: null, mem: null, net: null }; if (typeof MiniChart !== 'undefined') { - _chartInstances[id].cpu = new MiniChart(id+'-cpu', '#7aa2f7'); - _chartInstances[id].mem = new MiniChart(id+'-mem', '#9ece6a'); + _chartInstances[id].cpu = var mc = new MiniChart(id+'-cpu', '#7aa2f7'); + mc._origResize = mc.resize; + mc.resize = function(){ this._origResize(); this.canvas.width = this.canvas.width * 2; this.canvas.height = 120; this.ctx.scale(2,2); this.draw(); }; + mc.resize(); + _chartInstances[id].mem = var mm = new MiniChart(id+'-mem', '#9ece6a'); + mm._origResize = mm.resize; + mm.resize = function(){ this._origResize(); this.canvas.width = this.canvas.width * 2; this.canvas.height = 120; this.ctx.scale(2,2); this.draw(); }; + mm.resize(); } if (typeof DualLineChart !== 'undefined') { _chartInstances[id].net = new DualLineChart(id+'-net', '#bb9af7', '#c0a8f0');