From bc56e637376142c370c31b17558fc3778a863bd2 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 17 Mar 2023 01:31:14 +0330 Subject: pack1 --- web/html/xui/inbound_modal.html | 56 +++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 30 deletions(-) (limited to 'web/html/xui/inbound_modal.html') diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html index 54a64bf9..7b7450b6 100644 --- a/web/html/xui/inbound_modal.html +++ b/web/html/xui/inbound_modal.html @@ -1,6 +1,7 @@ {{define "inboundModal"}} {{template "form/inbound"}} @@ -88,22 +89,18 @@ removeClient(index, clients) { clients.splice(index, 1); }, - async getDBClientIps(email,event) { - - const msg = await HttpUtil.post('/xui/inbound/clientIps/'+ email); - if (!msg.success) { - return; - } - try { - ips = JSON.parse(msg.obj) - ips = ips.join(",") - event.target.value = ips - } catch (error) { - // text - event.target.value = msg.obj - - } - + async getDBClientIps(email, event) { + const msg = await HttpUtil.post('/xui/inbound/clientIps/' + email); + if (!msg.success) { + return; + } + try { + let ips = JSON.parse(msg.obj); + ips = ips.join(","); + event.target.value = ips; + } catch (error) { + event.target.value = msg.obj; + } }, async clearDBClientIps(email,event) { const msg = await HttpUtil.post('/xui/inbound/clearClientIps/'+ email); @@ -112,20 +109,19 @@ } event.target.value = "" }, - async resetClientTraffic(client,event) { - const msg = await HttpUtil.post('/xui/inbound/resetClientTraffic/'+ client.email); - if (!msg.success) { - return; - } - clientStats = this.inbound.clientStats - if(clientStats.length > 0) - { - for (const key in clientStats) { - if (Object.hasOwnProperty.call(clientStats, key)) { - if(clientStats[key]['email'] == client.email){ - clientStats[key]['up'] = 0 - clientStats[key]['down'] = 0 - } + async resetClientTraffic(client, event) { + const msg = await HttpUtil.post(`/xui/inbound/resetClientTraffic/${client.email}`); + if (!msg.success) { + return; + } + const clientStats = this.inbound.clientStats; + if (clientStats.length > 0) { + for (let i = 0; i < clientStats.length; i++) { + if (clientStats[i].email === client.email) { + clientStats[i].up = 0; + clientStats[i].down = 0; + break; // Stop looping once we've found the matching client. + } } } -- cgit v1.2.3