diff --git a/web/assets/js/util/common.js b/web/assets/js/util/common.js
index 89b2c3e8..0478e6c5 100644
--- a/web/assets/js/util/common.js
+++ b/web/assets/js/util/common.js
@@ -110,6 +110,19 @@ function usageColor(data, threshold, total) {
}
}
+function clientUsageColor(clientStats, trafficDiff) {
+ switch (true) {
+ case !clientStats || clientStats.total == 0:
+ return "#7a316f";
+ case clientStats.up + clientStats.down < clientStats.total - trafficDiff:
+ return "#0e49b5";
+ case clientStats.up + clientStats.down < clientStats.total:
+ return "#FFA031";
+ default:
+ return "#E04141";
+ }
+}
+
function userExpiryColor(threshold, client, isDark = false) {
if (!client.enable) {
return isDark ? '#2c3950' : '#bcbcbc';
diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html
index c30f22fb..853b83a7 100644
--- a/web/html/xui/client_modal.html
+++ b/web/html/xui/client_modal.html
@@ -110,9 +110,6 @@
get isExpiry() {
return this.clientModal.isEdit && this.client.expiryTime >0 ? (this.client.expiryTime < new Date().getTime()) : false;
},
- get statsColor() {
- return usageColor(clientStats.up + clientStats.down, app.trafficDiff, this.client.totalGB);
- },
get delayedStart() {
return this.clientModal.delayedStart;
},
diff --git a/web/html/xui/form/client.html b/web/html/xui/form/client.html
index da7ab787..f2063c27 100644
--- a/web/html/xui/form/client.html
+++ b/web/html/xui/form/client.html
@@ -89,7 +89,7 @@
| {{ i18n "usage" }} |
-
+
[[ sizeFormat(clientStats.up) ]] /
[[ sizeFormat(clientStats.down) ]]
([[ sizeFormat(clientStats.up + clientStats.down) ]])
diff --git a/web/html/xui/inbound_client_table.html b/web/html/xui/inbound_client_table.html
index ea248980..58ae0124 100644
--- a/web/html/xui/inbound_client_table.html
+++ b/web/html/xui/inbound_client_table.html
@@ -84,7 +84,7 @@
:percent="statsProgress(record, client.email)"/>
|
-
@@ -200,7 +200,7 @@
|
-
diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html
index 289ea3cb..89909f06 100644
--- a/web/html/xui/inbound_info_modal.html
+++ b/web/html/xui/inbound_info_modal.html
@@ -10,38 +10,43 @@
- | {{ i18n "protocol" }} | [[ dbInbound.protocol ]] |
- | {{ i18n "pages.inbounds.address" }} | [[ dbInbound.address ]] |
- | {{ i18n "pages.inbounds.port" }} | [[ dbInbound.port ]] |
+ | {{ i18n "protocol" }} | [[ dbInbound.protocol ]] |
+ | {{ i18n "pages.inbounds.address" }} | [[ dbInbound.address ]] |
+ | {{ i18n "pages.inbounds.port" }} | [[ dbInbound.port ]] |
|
- | {{ i18n "transmission" }} | [[ inbound.network ]] |
+ {{ i18n "transmission" }} | [[ inbound.network ]] |
- | {{ i18n "host" }} | [[ inbound.host ]] |
- | {{ i18n "host" }} | {{ i18n "none" }} |
-
- | {{ i18n "path" }} | [[ inbound.path ]] |
- | {{ i18n "path" }} | {{ i18n "none" }} |
+
+ | {{ i18n "host" }} |
+ [[ inbound.host ]] |
+ {{ i18n "none" }} |
+
+
+ | {{ i18n "path" }} |
+ [[ inbound.path ]] |
+ {{ i18n "none" }} |
+
- | quic {{ i18n "encryption" }} | [[ inbound.quicSecurity ]] |
- | quic {{ i18n "password" }} | [[ inbound.quicKey ]] |
- | quic {{ i18n "camouflage" }} | [[ inbound.quicType ]] |
+ | quic {{ i18n "encryption" }} | [[ inbound.quicSecurity ]] |
+ | quic {{ i18n "password" }} | [[ inbound.quicKey ]] |
+ | quic {{ i18n "camouflage" }} | [[ inbound.quicType ]] |
- | kcp {{ i18n "encryption" }} | [[ inbound.kcpType ]] |
- | kcp {{ i18n "password" }} | [[ inbound.kcpSeed ]] |
+ | kcp {{ i18n "encryption" }} | [[ inbound.kcpType ]] |
+ | kcp {{ i18n "password" }} | [[ inbound.kcpSeed ]] |
- | grpc serviceName | [[ inbound.serviceName ]] |
- | grpc multiMode | [[ inbound.stream.grpc.multiMode ]] |
+ | grpc serviceName | [[ inbound.serviceName ]] |
+ | grpc multiMode | [[ inbound.stream.grpc.multiMode ]] |
|
@@ -60,13 +65,13 @@
| {{ i18n "encryption" }} |
- [[ inbound.settings.method ]] |
+ [[ inbound.settings.method ]] |
| {{ i18n "password" }} |
- [[ inbound.settings.password ]] |
+ [[ inbound.settings.password ]] |
| {{ i18n "pages.inbounds.network" }} |
- [[ inbound.settings.network ]] |
+ [[ inbound.settings.network ]] |
@@ -74,37 +79,37 @@
| {{ i18n "pages.inbounds.email" }} |
- [[ infoModal.clientSettings.email ]] |
+ [[ infoModal.clientSettings.email ]] |
| ID |
- [[ infoModal.clientSettings.id ]] |
+ [[ infoModal.clientSettings.id ]] |
| Flow |
- [[ infoModal.clientSettings.flow ]] |
+ [[ infoModal.clientSettings.flow ]] |
| Password |
- [[ infoModal.clientSettings.password ]] |
+ [[ infoModal.clientSettings.password ]] |
| {{ i18n "status" }} |
{{ i18n "enabled" }}
- {{ i18n "disabled" }}
+ {{ i18n "disabled" }}
{{ i18n "depleted" }}
|
| {{ i18n "usage" }} |
- [[ sizeFormat(infoModal.clientStats.up + infoModal.clientStats.down) ]]
- ↑ [[ sizeFormat(infoModal.clientStats.up) ]] / [[ sizeFormat(infoModal.clientStats.down) ]] ↓
+ [[ sizeFormat(infoModal.clientStats.up + infoModal.clientStats.down) ]]
+ ↑ [[ sizeFormat(infoModal.clientStats.up) ]] / [[ sizeFormat(infoModal.clientStats.down) ]] ↓
|
-
+
| {{ i18n "remained" }} |
{{ i18n "pages.inbounds.totalFlow" }} |
@@ -120,7 +125,7 @@
[[ sizeFormat(infoModal.clientSettings.totalGB) ]]
- {{ i18n "indefinite" }}
+ ∞
@@ -128,8 +133,8 @@
[[ DateUtil.formatMillis(infoModal.clientSettings.expiryTime) ]]
- [[ infoModal.clientSettings.expiryTime / -86400000 ]] {{ i18n "pages.client.days" }}
- {{ i18n "indefinite" }}
+ [[ infoModal.clientSettings.expiryTime / -86400000 ]] {{ i18n "pages.client.days" }}
+ ∞
|
@@ -162,7 +167,7 @@
URL
- [[ link.remark ]]
[[ link.link ]]
+ [[ link.remark ]]
[[ link.link ]]
@@ -208,7 +213,7 @@
| [[ inbound.settings.auth ]] |
- [[ inbound.settings.udp]] |
+ [[ inbound.settings.udp]] |
[[ inbound.settings.ip ]] |
@@ -217,9 +222,9 @@
{{ i18n "username" }} |
{{ i18n "password" }} |
- | [[ index ]] |
+ [[ index ]] |
[[ account.user ]] |
- [[ account.pass ]] |
+ [[ account.pass ]] |
@@ -229,9 +234,9 @@
{{ i18n "username" }} |
{{ i18n "password" }} |
- | [[ index ]] |
+ [[ index ]] |
[[ account.user ]] |
- [[ account.pass ]] |
+ [[ account.pass ]] |
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html
index 228f403d..e75346a7 100644
--- a/web/html/xui/inbounds.html
+++ b/web/html/xui/inbounds.html
@@ -1115,19 +1115,10 @@
remained = clientStats.totalGB - (clientStats.up + clientStats.down);
return remained>0 ? remained : 0;
},
- statsColor(dbInbound, email) {
- if (email.length == 0) return '#0e49b5';
+ clientStatsColor(dbInbound, email) {
+ if (email.length == 0) return clientUsageColor();
clientStats = dbInbound.clientStats.find(stats => stats.email === email);
- switch (true) {
- case !clientStats:
- return "#0e49b5";
- case clientStats.up + clientStats.down < clientStats.total - app.trafficDiff:
- return "#0e49b5";
- case clientStats.up + clientStats.down < clientStats.total:
- return "#FFA031";
- default:
- return "#E04141";
- }
+ return clientUsageColor(clientStats, app.trafficDiff)
},
statsProgress(dbInbound, email) {
if (email.length == 0) return 100;