|
@@ -445,7 +445,7 @@
|
|
icon = "home icon";
|
|
icon = "home icon";
|
|
}
|
|
}
|
|
$('#blacklistIpTable').append(`
|
|
$('#blacklistIpTable').append(`
|
|
- <tr class="blacklistItem ${encodeURIComponent(ip.split(".").join("_"))}">
|
|
|
|
|
|
+ <tr class="blacklistItem" ip="${encodeURIComponent(ip)}">
|
|
<td><i class="${icon}"></i> ${ip}</td>
|
|
<td><i class="${icon}"></i> ${ip}</td>
|
|
<td><button class="ui icon basic mini red button" onclick="removeIpBlacklist('${ip}');"><i class="trash alternate icon"></i></button></td>
|
|
<td><button class="ui icon basic mini red button" onclick="removeIpBlacklist('${ip}');"><i class="trash alternate icon"></i></button></td>
|
|
</tr>
|
|
</tr>
|
|
@@ -693,7 +693,13 @@
|
|
}
|
|
}
|
|
|
|
|
|
function ipInBlacklist(targetIp){
|
|
function ipInBlacklist(targetIp){
|
|
- return $(".blacklistItem." + encodeURIComponent(targetIp.split(".").join("_"))).length > 0;
|
|
|
|
|
|
+ let inBlacklist = false;
|
|
|
|
+ $(".blacklistItem").each(function(){
|
|
|
|
+ if ($(this).attr("ip") == encodeURIComponent(targetIp)){
|
|
|
|
+ inBlacklist = true;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return inBlacklist;
|
|
}
|
|
}
|
|
|
|
|
|
function handleBanIp(targetIp){
|
|
function handleBanIp(targetIp){
|