浏览代码

bug fix - get client ips

mhsanaei 2 月之前
父节点
当前提交
2dec7f48f5
共有 1 个文件被更改,包括 17 次插入0 次删除
  1. 17 0
      web/html/xui/client_modal.html

+ 17 - 0
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}`);