diff --git a/services/security-dashboard.sh b/services/security-dashboard.sh index 46a1061..8344df4 100644 --- a/services/security-dashboard.sh +++ b/services/security-dashboard.sh @@ -3999,6 +3999,7 @@ INDEX_HTML = """
| IP/Range | @@ -5060,8 +5061,20 @@ function decSortValue(d, key) { } } +// Matches against every column shown in the table (IP/range, scenario, +// carrier name/ASN, country, origin) rather than just the IP, since "search +// by network/carrier" was asked for explicitly -- a phone's ISP/mobile +// carrier name is often more memorable than its current IP. +function decMatchesSearch(d, term) { + if (!term) return true; + const haystack = [d.value, d.scenario, d.as_number, d.as_name, d.country, d.origin] + .filter(Boolean).join(" ").toLowerCase(); + return haystack.includes(term); +} + function renderDecisions() { - let rows = lastDecisions.slice(); + const term = (document.getElementById("dec-search").value || "").trim().toLowerCase(); + let rows = lastDecisions.filter(d => decMatchesSearch(d, term)); if (decSort.key) { rows.sort((a, b) => { const av = decSortValue(a, decSort.key), bv = decSortValue(b, decSort.key); @@ -5087,7 +5100,7 @@ function renderDecisions() { ${d.as_number ? `` : ""} -||||||
|---|---|---|---|---|---|---|
| No active bans. | ||||||
| ${term ? "No bans match that search." : "No active bans."} | ||||||