()
| 3972 | function _wifiFlagBanner() { |
| 3973 | const el = document.getElementById('wifi-flag-banner'); if (!el) return; |
| 3974 | const f = _wifiState.flagged; |
| 3975 | const s = _wifiState.pivotSelect; |
| 3976 | const t = f || s; |
| 3977 | if (!t) { el.className = 'hidden'; el.innerHTML = ''; return; } |
| 3978 | const found = !!(_wifiState.data && _wifiState.data.aps.some(a => a.bssid === t.bssid)); |
| 3979 | const state = _wifiState.scanError ? ('survey unavailable — ' + _esc(_wifiState.scanError)) |
| 3980 | : !_wifiState.data ? 'surveying…' |
| 3981 | : found ? 'highlighted in the spectrum below' |
| 3982 | : 'not heard in the latest survey — it may be down, out of range, or beaconing intermittently'; |
| 3983 | const name = `<b>${_esc(t.ssid) || '<span class="italic">hidden SSID</span>'}</b>` |
| 3984 | + `<span class="font-mono">${_esc(t.bssid)}</span>`; |
| 3985 | if (f) { |
| 3986 | // Genuine WiFi Defense finding — red WIDS treatment. |
| 3987 | el.className = 'flex flex-wrap items-center gap-2 mb-3 text-xs px-3 py-2 rounded-lg bg-red-950/50 border border-red-800 text-red-200'; |
| 3988 | el.innerHTML = '<span>🛡 Flagged by WiFi Defense:</span>' + name |
| 3989 | + `<span style="color:rgba(252,165,165,.8)">· ${state}</span>` |
| 3990 | + '<button onclick="wifiClearFlag()" class="ml-auto px-2 py-0.5 rounded bg-red-900/60 hover:bg-red-800 text-red-100" title="Clear the WIDS highlight">✕ dismiss</button>'; |
| 3991 | } else { |
no test coverage detected