[bug] fix status colors in pages
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
This commit is contained in:
1 parent
ba2d02ae1d
commit
375814da27
6 files changed
+65
-59
No files matched your search
@@ -131,6 +131,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';
|
||||
|
||||
@@ -112,9 +112,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;
|
||||
},
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<template v-if="isEdit && clientStats">
|
||||
<br>
|
||||
<span> {{ i18n "usage" }}:</span>
|
||||
<a-tag :color="statsColor">
|
||||
<a-tag :color="clientUsageColor(clientStats, app.trafficDiff)">
|
||||
[[ sizeFormat(clientStats.up) ]] /
|
||||
[[ sizeFormat(clientStats.down) ]]
|
||||
([[ sizeFormat(clientStats.up + clientStats.down) ]])
|
||||
|
||||
Loaded 3 of 6 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user