From 2dec7f48f5857c86f85270952c7f1593d3bae77b Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Fri, 24 Jan 2025 17:16:16 +0100 Subject: [PATCH] bug fix - get client ips --- web/html/xui/client_modal.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html index ef4e14a1..8071e6b4 100644 --- a/web/html/xui/client_modal.html +++ b/web/html/xui/client_modal.html @@ -260,6 +260,23 @@ return generatedEmails; }, + async getDBClientIps(email) { + const msg = await HttpUtil.post(`/panel/inbound/clientIps/${email}`); + if (!msg.success) { + document.getElementById("clientIPs").value = msg.obj; + return; + } + let ips = msg.obj; + if (typeof ips === 'string' && ips.startsWith('[') && ips.endsWith(']')) { + try { + ips = JSON.parse(ips); + ips = Array.isArray(ips) ? ips.join("\n") : ips; + } catch (e) { + console.error('Error parsing JSON:', e); + } + } + document.getElementById("clientIPs").value = ips; + }, async clearDBClientIps(email) { try { const msg = await HttpUtil.post(`/panel/inbound/clearClientIps/${email}`);