Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShishkevich D. <135337715+shishkevichd@users.noreply.github.com>2025-03-07 12:07:23 +0300
committerShishkevich D. <135337715+shishkevichd@users.noreply.github.com>2025-03-07 12:07:23 +0300
commit0a207b8a2c0629b7f1996025a40a10fbe58d05d0 (patch)
tree17d8a98faecccbda02b98ede48adf020d5e8d2f9 /web/assets/js/model
parent26bf693dbdc2db0222ee37615e353f7ca1fdd3c1 (diff)
refactor: merging all util functions into classes
Diffstat (limited to 'web/assets/js/model')
-rw-r--r--web/assets/js/model/dbinbound.js4
-rw-r--r--web/assets/js/model/inbound.js16
2 files changed, 10 insertions, 10 deletions
diff --git a/web/assets/js/model/dbinbound.js b/web/assets/js/model/dbinbound.js
index aeae1a75..45301ddd 100644
--- a/web/assets/js/model/dbinbound.js
+++ b/web/assets/js/model/dbinbound.js
@@ -25,11 +25,11 @@ class DBInbound {
}
get totalGB() {
- return toFixed(this.total / ONE_GB, 2);
+ return NumberFormatter.toFixed(this.total / SizeFormatter.ONE_GB, 2);
}
set totalGB(gb) {
- this.total = toFixed(gb * ONE_GB, 0);
+ this.total = NumberFormatter.toFixed(gb * SizeFormatter.ONE_GB, 0);
}
get isVMess() {
diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js
index 49fc8a7b..5c3235e1 100644
--- a/web/assets/js/model/inbound.js
+++ b/web/assets/js/model/inbound.js
@@ -1837,11 +1837,11 @@ Inbound.VmessSettings.VMESS = class extends XrayCommonClass {
}
}
get _totalGB() {
- return toFixed(this.totalGB / ONE_GB, 2);
+ return NumberFormatter.toFixed(this.totalGB / SizeFormatter.ONE_GB, 2);
}
set _totalGB(gb) {
- this.totalGB = toFixed(gb * ONE_GB, 0);
+ this.totalGB = NumberFormatter.toFixed(gb * SizeFormatter.ONE_GB, 0);
}
};
@@ -1947,11 +1947,11 @@ Inbound.VLESSSettings.VLESS = class extends XrayCommonClass {
}
}
get _totalGB() {
- return toFixed(this.totalGB / ONE_GB, 2);
+ return NumberFormatter.toFixed(this.totalGB / SizeFormatter.ONE_GB, 2);
}
set _totalGB(gb) {
- this.totalGB = toFixed(gb * ONE_GB, 0);
+ this.totalGB = NumberFormatter.toFixed(gb * SizeFormatter.ONE_GB, 0);
}
};
Inbound.VLESSSettings.Fallback = class extends XrayCommonClass {
@@ -2099,11 +2099,11 @@ Inbound.TrojanSettings.Trojan = class extends XrayCommonClass {
}
}
get _totalGB() {
- return toFixed(this.totalGB / ONE_GB, 2);
+ return NumberFormatter.toFixed(this.totalGB / SizeFormatter.ONE_GB, 2);
}
set _totalGB(gb) {
- this.totalGB = toFixed(gb * ONE_GB, 0);
+ this.totalGB = NumberFormatter.toFixed(gb * SizeFormatter.ONE_GB, 0);
}
};
@@ -2263,11 +2263,11 @@ Inbound.ShadowsocksSettings.Shadowsocks = class extends XrayCommonClass {
}
}
get _totalGB() {
- return toFixed(this.totalGB / ONE_GB, 2);
+ return NumberFormatter.toFixed(this.totalGB / SizeFormatter.ONE_GB, 2);
}
set _totalGB(gb) {
- this.totalGB = toFixed(gb * ONE_GB, 0);
+ this.totalGB = NumberFormatter.toFixed(gb * SizeFormatter.ONE_GB, 0);
}
};