Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsanaei <ho3ein.sanaei@gmail.com>2025-09-18 17:28:09 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2025-09-18 17:28:09 +0300
commitb46a0b404bd9b6fddfcaeaec1e2c316015bb9967 (patch)
tree300de9594af091ef15800948101e760ac5dc9a41 /web/html/modals
parent0ce58a095aeb9dafee8c93851c609688d5187000 (diff)
enhancements
Diffstat (limited to 'web/html/modals')
-rw-r--r--web/html/modals/inbound_info_modal.html26
1 files changed, 18 insertions, 8 deletions
diff --git a/web/html/modals/inbound_info_modal.html b/web/html/modals/inbound_info_modal.html
index 55d9919c..25f43506 100644
--- a/web/html/modals/inbound_info_modal.html
+++ b/web/html/modals/inbound_info_modal.html
@@ -180,9 +180,9 @@
<tr>
<td>{{ i18n "status" }}</td>
<td>
- <a-tag v-if="isEnable && isActive && !isDepleted" color="green">{{ i18n "enabled" }}</a-tag>
- <a-tag v-if="!isEnable && !isDepleted">{{ i18n "disabled" }}</a-tag>
<a-tag v-if="isDepleted" color="red">{{ i18n "depleted" }}</a-tag>
+ <a-tag v-else-if="isEnable" color="green">{{ i18n "enabled" }}</a-tag>
+ <a-tag v-else>{{ i18n "disabled" }}</a-tag>
</td>
</tr>
<tr v-if="infoModal.clientStats">
@@ -524,7 +524,7 @@
this.dbInbound = new DBInbound(dbInbound);
this.clientSettings = this.inbound.clients ? this.inbound.clients[index] : null;
this.isExpired = this.inbound.clients ? this.inbound.isExpiry(index) : this.dbInbound.isExpiry;
- this.clientStats = this.inbound.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : [];
+ this.clientStats = this.inbound.clients ? (this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) || null) : null;
if (
[
@@ -588,11 +588,21 @@
return infoModal.dbInbound.isEnable;
},
get isDepleted() {
- const stats = this.infoModal.clientStats;
- if (!stats) return false;
- const now = new Date().getTime();
- const expired = stats.expiryTime > 0 && now >= stats.expiryTime;
- const exhausted = stats.total > 0 && (stats.up + stats.down) >= stats.total;
+ const stats = infoModal.clientStats;
+ const settings = infoModal.clientSettings;
+ if (!stats || !settings) {
+ return false;
+ }
+ const total = stats.total ?? 0;
+ const used = (stats.up ?? 0) + (stats.down ?? 0);
+ const hasTotal = total > 0;
+ const exhausted = hasTotal && used >= total;
+
+ const expiryTime = settings.expiryTime ?? 0;
+ const hasExpiry = expiryTime > 0;
+ const now = Date.now();
+ const expired = hasExpiry && now >= expiryTime;
+
return expired || exhausted;
},
},