From 4cc755c8830adc7c9cdd5ea769f893753a7d0a20 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 16 Jun 2023 01:08:35 +0330 Subject: fix warning when there is no access.log after this if limitip is 0 and there is no access.log on xray config you don't see this warning access.log doesn't exist in your config.json ------------- better view on ip log ------------- update dependencies --- web/html/xui/client_modal.html | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'web/html') diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html index a2d29417..a1d4dce8 100644 --- a/web/html/xui/client_modal.html +++ b/web/html/xui/client_modal.html @@ -121,18 +121,21 @@ }, methods: { async getDBClientIps(email) { - try { - const msg = await HttpUtil.post(`/panel/inbound/clientIps/${email}`); - if (!msg.success) { - document.getElementById("clientIPs").value = msg.obj; - return; + 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); } - const ips = Array.isArray(msg.obj) ? msg.obj.join(",\n") : msg.obj; - document.getElementById("clientIPs").value = ips; - } catch (error) { - console.error(error); - document.getElementById("clientIPs").value = 'An error occurred while making the request'; } + document.getElementById("clientIPs").value = ips; }, async clearDBClientIps(email) { try { -- cgit v1.2.3