From ad830201e9bc7a4805f1d4031286a9efc81c0c80 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 6 Apr 2026 00:56:50 +0000 Subject: [PATCH] feat: change Overall Speed display from MB/s to Mb/s Agent-Logs-Url: https://github.com/xAlokyx/3x-ui/sessions/63fee593-57c0-49be-8faf-10d58c72c55a Co-authored-by: xAlokyx <234771438+xAlokyx@users.noreply.github.com> --- web/assets/js/util/index.js | 10 ++++++++++ web/html/index.html | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/web/assets/js/util/index.js b/web/assets/js/util/index.js index e69f3341..039b5368 100644 --- a/web/assets/js/util/index.js +++ b/web/assets/js/util/index.js @@ -591,6 +591,16 @@ class SizeFormatter { if (size < this.ONE_PB) return (size / this.ONE_TB).toFixed(2) + " TB"; return (size / this.ONE_PB).toFixed(2) + " PB"; } + + static bitFormat(size) { + const bits = size * 8; + if (bits <= 0) return "0 b"; + if (bits < 1000) return bits.toFixed(0) + " b"; + if (bits < 1000000) return (bits / 1000).toFixed(2) + " Kb"; + if (bits < 1000000000) return (bits / 1000000).toFixed(2) + " Mb"; + if (bits < 1000000000000) return (bits / 1000000000).toFixed(2) + " Gb"; + return (bits / 1000000000000).toFixed(2) + " Tb"; + } } class CPUFormatter { diff --git a/web/html/index.html b/web/html/index.html index bbbbb708..ebd0becb 100644 --- a/web/html/index.html +++ b/web/html/index.html @@ -205,7 +205,7 @@ + :value="SizeFormatter.bitFormat(status.netIO.up)"> @@ -216,7 +216,7 @@ + :value="SizeFormatter.bitFormat(status.netIO.down)">