From 2d425b2a71d775c4728dfdabab4d303b1946d474 Mon Sep 17 00:00:00 2001 From: qinglong Date: Sun, 14 Jun 2026 09:20:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20SWAP/=E7=A3=81=E7=9B=98=20=E6=80=BB?= =?UTF-8?q?=E9=87=8F=E4=B8=BA0=E6=97=B6=E6=98=BE=E7=A4=BA'=E2=80=94'(?= =?UTF-8?q?=E8=B7=A8=E5=B9=B3=E5=8F=B0=E5=85=BC=E5=AE=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/sentinel/dashboard.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sentinel/dashboard.html b/plugins/sentinel/dashboard.html index d7bd24f..77214c3 100644 --- a/plugins/sentinel/dashboard.html +++ b/plugins/sentinel/dashboard.html @@ -276,8 +276,8 @@ var procEl = card.querySelector('.proc-val'); var sysData = n.system || {}; if (loadEl && sysData.cpu) loadEl.textContent = (sysData.cpu.load_avg||[0,0,0]).map(function(v){return v.toFixed(1);}).join(' / '); - if (swapEl && sysData.swap) swapEl.textContent = (sysData.swap.percent||0).toFixed(1)+'% ('+(sysData.swap.used_gb||0).toFixed(1)+'G)'; - if (diskEl && sysData.disk) diskEl.textContent = (sysData.disk.percent||0).toFixed(1)+'% ('+(sysData.disk.used_gb||0).toFixed(1)+'/'+(sysData.disk.total_gb||0).toFixed(1)+'G)'; + if (swapEl && sysData.swap) { var st = sysData.swap.total_gb||0; swapEl.textContent = st > 0 ? (sysData.swap.percent||0).toFixed(1)+'% ('+(sysData.swap.used_gb||0).toFixed(1)+'G)' : '—'; } + if (diskEl && sysData.disk) { var dt = sysData.disk.total_gb||0; diskEl.textContent = dt > 0 ? (sysData.disk.percent||0).toFixed(1)+'% ('+(sysData.disk.used_gb||0).toFixed(1)+'/'+(sysData.disk.total_gb||0).toFixed(1)+'G)' : '—'; } if (tempEl && sysData.temperature) tempEl.textContent = (sysData.temperature.current||0) > 0 ? (sysData.temperature.current).toFixed(1)+'°C' : '—'; if (trafEl && sysData.network) trafEl.textContent = '↓'+(sysData.network.rx_mb||0).toFixed(0)+'M ↑'+(sysData.network.tx_mb||0).toFixed(0)+'M'; if (procEl && sysData.process) procEl.textContent = (sysData.process.memory_mb||0).toFixed(0)+'MB';