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:
Diffstat (limited to 'web/html/xui/client_modal.html')
-rw-r--r--web/html/xui/client_modal.html20
1 files changed, 16 insertions, 4 deletions
diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html
index e4ee8659..d1078f23 100644
--- a/web/html/xui/client_modal.html
+++ b/web/html/xui/client_modal.html
@@ -1,7 +1,7 @@
{{define "clientsModal"}}
<a-modal id="client-modal" v-model="clientModal.visible" :title="clientModal.title" @ok="clientModal.ok"
:confirm-loading="clientModal.confirmLoading" :closable="true" :mask-closable="false"
- :class="siderDrawer.isDarkTheme ? darkClass : ''"
+ :class="siderDrawer.isDarkTheme ? darkClass : ''"
:ok-text="clientModal.okText" cancel-text='{{ i18n "close" }}'>
{{template "form/client"}}
</a-modal>
@@ -19,6 +19,7 @@
index: null,
clientIps: null,
isExpired: false,
+ delayedStart: false,
ok() {
ObjectUtil.execute(clientModal.confirm, clientModal.inbound, clientModal.dbInbound, clientModal.index);
},
@@ -32,8 +33,13 @@
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){
this.addClient(this.inbound.protocol, this.clients);
+ } else {
+ if (this.clients[index].expiryTime < 0){
+ this.delayedStart = true;
+ }
}
this.clientStats = this.dbInbound.clientStats.find(row => row.email === this.clients[this.index].email);
this.confirm = confirm;
@@ -82,7 +88,7 @@
},
get isTrafficExhausted() {
if(!clientStats) return false
- if(clientStats.total == 0) return false
+ if(clientStats.total <= 0) return false
if(clientStats.up + clientStats.down < clientStats.total) return false
return true
},
@@ -91,10 +97,16 @@
},
get statsColor() {
if(!clientStats) return 'blue'
- if(clientStats.total === 0) return 'blue'
+ if(clientStats.total <= 0) return 'blue'
else if(clientStats.total > 0 && (clientStats.down+clientStats.up) < clientStats.total) return 'cyan'
else return 'red'
- }
+ },
+ get delayedExpireDays() {
+ return this.client && this.client.expiryTime < 0 ? this.client.expiryTime / -86400000 : 0;
+ },
+ set delayedExpireDays(days){
+ this.client.expiryTime = -86400000 * days;
+ },
},
methods: {
getNewEmail(client) {