fix and improve

This commit is contained in:
MHSanaei
2023-06-14 19:50:19 +03:30
parent c0f1a926e5
commit d40e61fc45
4 changed files with 21 additions and 24 deletions

View File

@@ -124,12 +124,14 @@
try {
const msg = await HttpUtil.post(`/panel/inbound/clientIps/${email}`);
if (!msg.success) {
document.getElementById("clientIPs").value = msg.obj;
return;
}
const ips = JSON.parse(msg.obj).join(",\n");
const ips = Array.isArray(msg.obj) ? msg.obj.join(",\n") : msg.obj;
document.getElementById("clientIPs").value = ips;
} catch (error) {
document.getElementById("clientIPs").value = msg.obj;
console.error(error);
document.getElementById("clientIPs").value = 'An error occurred while making the request';
}
},
async clearDBClientIps(email) {