[feature] interactive deplete soon

Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
This commit is contained in:
MHSanaei
2023-05-17 02:01:56 +03:30
parent be50be75fe
commit 2d16eabc6e
5 changed files with 28 additions and 26 deletions

View File

@@ -20,7 +20,6 @@
oldClientId: "",
index: null,
clientIps: null,
isExpired: false,
delayedStart: false,
ok() {
if (clientModal.isEdit) {
@@ -38,7 +37,6 @@
this.inbound = dbInbound.toInbound();
this.clients = this.getClients(this.inbound.protocol, this.inbound.settings);
this.index = index === null ? this.clients.length : index;
this.isExpired = isEdit ? this.inbound.isExpiry(this.index) : false;
this.delayedStart = false;
if (isEdit) {
if (this.clients[index].expiryTime < 0) {
@@ -109,13 +107,10 @@
return true
},
get isExpiry() {
return this.clientModal.isExpired
return this.clientModal.isEdit && this.client.expiryTime >0 ? (this.client.expiryTime < new Date().getTime()) : false;
},
get statsColor() {
if (!clientStats) return 'blue'
if (clientStats.total <= 0) return 'blue'
else if (clientStats.total > 0 && (clientStats.down + clientStats.up) < clientStats.total) return 'cyan'
else return 'red'
return usageColor(clientStats.up + clientStats.down, app.trafficDiff, this.client.totalGB);
},
get delayedExpireDays() {
return this.client && this.client.expiryTime < 0 ? this.client.expiryTime / -86400000 : 0;