From 0f7102a41d63ca0e3a5c45f65c43650ae019f079 Mon Sep 17 00:00:00 2001 From: "3371392206@qq.com" <3371392206@qq.com> Date: Sun, 16 Aug 2026 18:41:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A5=E4=B8=8A=20dashboard=20?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E7=9A=84=20formatBytes=20=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- health.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/health.html b/health.html index f8254f8..3f31830 100644 --- a/health.html +++ b/health.html @@ -642,6 +642,13 @@ return `${m}m`; }; + const formatBytes = (b) => { + if (!b) return "0 B"; + const k = 1024, sizes = ["B", "KB", "MB", "GB"]; + const i = Math.floor(Math.log(b) / Math.log(k)); + return (b / Math.pow(k, i)).toFixed(1) + " " + sizes[i]; + }; + onMounted(() => { refresh(); setInterval(refresh, 10000);