Browse Source

auto update script executed

Toby Chui 1 year ago
parent
commit
53432d6052
1 changed files with 8 additions and 2 deletions
  1. 8 2
      web/components/blacklist.html

+ 8 - 2
web/components/blacklist.html

@@ -445,7 +445,7 @@
                         icon = "home icon";
                     }
                     $('#blacklistIpTable').append(`
-                        <tr class="blacklistItem ${encodeURIComponent(ip.split(".").join("_"))}">
+                        <tr class="blacklistItem" ip="${encodeURIComponent(ip)}">
                             <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>
                         </tr>
@@ -693,7 +693,13 @@
     }
 
     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){