From dc5510d0b76644db03b178b1bf8766478e42b474 Mon Sep 17 00:00:00 2001 From: James Smith Date: Sun, 21 Dec 2025 17:20:24 +0000 Subject: [PATCH] Improve WiFi UX: auto-select monitor interface and fix channel label color MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Channel utilization labels now white for better visibility - After enabling monitor mode, automatically refresh interface list - Auto-select the new monitor interface in dropdown - Add loading state to Enable Monitor button - Show "Ready to scan!" message after monitor mode enabled - Simplified workflow: Select adapter → Enable Monitor → Scan 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- intercept.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/intercept.py b/intercept.py index 0f5cb3b..82118f0 100755 --- a/intercept.py +++ b/intercept.py @@ -1194,7 +1194,7 @@ HTML_TEMPLATE = ''' .channel-label { font-size: 8px; - color: var(--text-dim); + color: #fff; margin-top: 3px; } @@ -3130,19 +3130,45 @@ HTML_TEMPLATE = ''' return; } + // Show loading state + const btn = document.getElementById('monitorStartBtn'); + const originalText = btn.textContent; + btn.textContent = 'Enabling...'; + btn.disabled = true; + fetch('/wifi/monitor', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({interface: iface, action: 'start'}) }).then(r => r.json()) .then(data => { + btn.textContent = originalText; + btn.disabled = false; + if (data.status === 'success') { monitorInterface = data.monitor_interface; updateMonitorStatus(true); - showInfo('Monitor mode enabled on ' + monitorInterface); + showInfo('Monitor mode enabled on ' + monitorInterface + ' - Ready to scan!'); + + // Refresh interface list and auto-select the monitor interface + fetch('/wifi/interfaces') + .then(r => r.json()) + .then(ifaceData => { + const select = document.getElementById('wifiInterfaceSelect'); + if (ifaceData.interfaces.length > 0) { + select.innerHTML = ifaceData.interfaces.map(i => + `` + ).join(''); + } + }); } else { alert('Error: ' + data.message); } + }) + .catch(err => { + btn.textContent = originalText; + btn.disabled = false; + alert('Error: ' + err.message); }); }