From 0a207b8a2c0629b7f1996025a40a10fbe58d05d0 Mon Sep 17 00:00:00 2001
From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com>
Date: Fri, 7 Mar 2025 09:07:23 +0000
Subject: refactor: merging all util functions into classes
---
web/html/xui/index.html | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
(limited to 'web/html/xui/index.html')
diff --git a/web/html/xui/index.html b/web/html/xui/index.html
index 8f89da90..89146932 100644
--- a/web/html/xui/index.html
+++ b/web/html/xui/index.html
@@ -45,11 +45,11 @@
-
CPU: [[ cpuCoreFormat(status.cpuCores) ]]
+ CPU: [[ CPUFormatter.cpuCoreFormat(status.cpuCores) ]]
Logical Processors: [[ (status.logicalPro) ]]
- Speed: [[ cpuSpeedFormat(status.cpuSpeedMhz) ]]
+ Speed: [[ CPUFormatter.cpuSpeedFormat(status.cpuSpeedMhz) ]]
@@ -58,7 +58,7 @@
:stroke-color="status.mem.color"
:percent="status.mem.percent">
- {{ i18n "pages.index.memory"}}: [[ sizeFormat(status.mem.current) ]] / [[ sizeFormat(status.mem.total) ]]
+ {{ i18n "pages.index.memory"}}: [[ SizeFormatter.sizeFormat(status.mem.current) ]] / [[ SizeFormatter.sizeFormat(status.mem.total) ]]
@@ -70,7 +70,7 @@
:stroke-color="status.swap.color"
:percent="status.swap.percent">
- Swap: [[ sizeFormat(status.swap.current) ]] / [[ sizeFormat(status.swap.total) ]]
+ Swap: [[ SizeFormatter.sizeFormat(status.swap.current) ]] / [[ SizeFormatter.sizeFormat(status.swap.total) ]]
@@ -78,7 +78,7 @@
:stroke-color="status.disk.color"
:percent="status.disk.percent">
- {{ i18n "pages.index.hard"}}: [[ sizeFormat(status.disk.current) ]] / [[ sizeFormat(status.disk.total) ]]
+ {{ i18n "pages.index.hard"}}: [[ SizeFormatter.sizeFormat(status.disk.current) ]] / [[ SizeFormatter.sizeFormat(status.disk.total) ]]
@@ -99,8 +99,8 @@
{{ i18n "pages.index.operationHours" }}:
- Xray: [[ formatSecond(status.appStats.uptime) ]]
- OS: [[ formatSecond(status.uptime) ]]
+ Xray: [[ TimeFormatter.formatSecond(status.appStats.uptime) ]]
+ OS: [[ TimeFormatter.formatSecond(status.uptime) ]]
@@ -145,7 +145,7 @@
{{ i18n "usage"}}:
- RAM: [[ sizeFormat(status.appStats.mem) ]]
+ RAM: [[ SizeFormatter.sizeFormat(status.appStats.mem) ]]
Threads: [[ status.appStats.threads ]]
@@ -207,7 +207,7 @@
- Up: [[ sizeFormat(status.netIO.up) ]]/s
+ Up: [[ SizeFormatter.sizeFormat(status.netIO.up) ]]/s
{{ i18n "pages.index.upSpeed" }}
@@ -217,7 +217,7 @@
- Down: [[ sizeFormat(status.netIO.down) ]]/s
+ Down: [[ SizeFormatter.sizeFormat(status.netIO.down) ]]/s
{{ i18n "pages.index.downSpeed" }}
@@ -236,7 +236,7 @@
{{ i18n "pages.index.totalSent" }}
- Out: [[ sizeFormat(status.netTraffic.sent) ]]
+ Out: [[ SizeFormatter.sizeFormat(status.netTraffic.sent) ]]
@@ -246,7 +246,7 @@
{{ i18n "pages.index.totalReceive" }}
- In: [[ sizeFormat(status.netTraffic.recv) ]]
+ In: [[ SizeFormatter.sizeFormat(status.netTraffic.recv) ]]
@@ -353,7 +353,7 @@
if (this.total === 0) {
return 0;
}
- return toFixed(this.current / this.total * 100, 2);
+ return NumberFormatter.toFixed(this.current / this.total * 100, 2);
}
get color() {
@@ -396,7 +396,7 @@
this.logicalPro = data.logicalPro;
this.cpuSpeedMhz = data.cpuSpeedMhz;
this.disk = new CurTotal(data.disk.current, data.disk.total);
- this.loads = data.loads.map(load => toFixed(load, 2));
+ this.loads = data.loads.map(load => NumberFormatter.toFixed(load, 2));
this.mem = new CurTotal(data.mem.current, data.mem.total);
this.netIO = data.netIO;
this.netTraffic = data.netTraffic;
--
cgit v1.2.3