From 3839af81cf355494330e0678bbd0a45b257d0537 Mon Sep 17 00:00:00 2001 From: qinglong Date: Sat, 13 Jun 2026 22:23:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20NaN=20=E2=80=94=20oldCpu/oldMem=20?= =?UTF-8?q?=E7=A7=BB=E5=88=B0=20if(isRow)=20=E4=B9=8B=E5=89=8D,=20?= =?UTF-8?q?=E4=B8=A4=E6=A8=A1=E5=BC=8F=E5=85=B1=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/sentinel/dashboard.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/sentinel/dashboard.html b/plugins/sentinel/dashboard.html index 395575d..87aa53b 100644 --- a/plugins/sentinel/dashboard.html +++ b/plugins/sentinel/dashboard.html @@ -223,6 +223,11 @@ var body = card.querySelector('.metrics-body'); if (!body) return; + var oldCpu = parseFloat(body.getAttribute('data-cpu')||(sys.cpu||{}).percent||0); + var oldMem = parseFloat(body.getAttribute('data-mem')||(sys.memory||{}).percent||0); + body.setAttribute('data-cpu', (sys.cpu||{}).percent||0); + body.setAttribute('data-mem', (sys.memory||{}).percent||0); + if (isRow) { body.querySelector('.net-down').textContent = fmtSpeed(net.rx_bytes_sec||0); body.querySelector('.net-up').textContent = fmtSpeed(net.tx_bytes_sec||0);