From cc3ff61ae215bdaec0c1ae0c3ee232156015c6b4 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 25 Apr 2023 14:38:35 +0330 Subject: update by client id Co-Authored-By: Alireza Ahmadi --- web/html/xui/client_modal.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'web/html/xui/client_modal.html') diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html index c01bd10c..bf4ed92a 100644 --- a/web/html/xui/client_modal.html +++ b/web/html/xui/client_modal.html @@ -17,13 +17,14 @@ inbound: new Inbound(), clients: [], clientStats: [], + oldClientId: "", index: null, clientIps: null, isExpired: false, delayedStart: false, ok() { if(clientModal.isEdit){ - ObjectUtil.execute(clientModal.confirm, clientModalApp.client, clientModal.dbInbound.id, clientModal.index); + ObjectUtil.execute(clientModal.confirm, clientModalApp.client, clientModal.dbInbound.id, clientModal.oldClientId); } else { ObjectUtil.execute(clientModal.confirm, clientModalApp.client, clientModal.dbInbound.id); } @@ -39,12 +40,13 @@ 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 (isEdit){ if (this.clients[index].expiryTime < 0){ this.delayedStart = true; } + this.oldClientId = this.dbInbound.protocol == "trojan" ? this.clients[index].password : this.clients[index].id; + } else { + this.addClient(this.inbound.protocol, this.clients); } this.clientStats = this.dbInbound.clientStats.find(row => row.email === this.clients[this.index].email); this.confirm = confirm; -- cgit v1.2.3