[bug] fix status colors in pages

Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
This commit is contained in:
MHSanaei
2023-12-04 23:51:14 +03:30
parent ba2d02ae1d
commit 375814da27
6 changed files with 65 additions and 59 deletions

View File

@@ -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';