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 @@ @@ -60,13 +65,13 @@
- - - + + +
{{ 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 "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 ]]