Skip to content

Commit 2dec7f4

Browse files
committed
bug fix - get client ips
1 parent 04cf250 commit 2dec7f4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

web/html/xui/client_modal.html

+17
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,23 @@
260260

261261
return generatedEmails;
262262
},
263+
async getDBClientIps(email) {
264+
const msg = await HttpUtil.post(`/panel/inbound/clientIps/${email}`);
265+
if (!msg.success) {
266+
document.getElementById("clientIPs").value = msg.obj;
267+
return;
268+
}
269+
let ips = msg.obj;
270+
if (typeof ips === 'string' && ips.startsWith('[') && ips.endsWith(']')) {
271+
try {
272+
ips = JSON.parse(ips);
273+
ips = Array.isArray(ips) ? ips.join("\n") : ips;
274+
} catch (e) {
275+
console.error('Error parsing JSON:', e);
276+
}
277+
}
278+
document.getElementById("clientIPs").value = ips;
279+
},
263280
async clearDBClientIps(email) {
264281
try {
265282
const msg = await HttpUtil.post(`/panel/inbound/clearClientIps/${email}`);

0 commit comments

Comments
 (0)