diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html index ef4e14a1..3a679976 100644 --- a/web/html/xui/client_modal.html +++ b/web/html/xui/client_modal.html @@ -230,6 +230,23 @@ }, }, methods: { + 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; + }, makeGroupEmailsUnique(dbInbounds, baseEmail, groupClients) { // Extract the base part of the email (before the "__" if present) const match = baseEmail.match(/^(.*?)__/);