diff --git a/templates/index.html b/templates/index.html index 7951b7b..1905bc3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -5459,15 +5459,28 @@ if (interfaces.length === 0) { select.innerHTML = ''; showNotification('WiFi', 'No WiFi interfaces found on remote agent.'); + monitorInterface = null; + updateMonitorStatus(false); } else { select.innerHTML = interfaces.map(i => { let label = i.name || i; if (i.display_name) label = i.display_name; else if (i.type) label += ` (${i.type})`; if (i.monitor_capable) label += ' [Monitor OK]'; - return ``; + return ``; }).join(''); showNotification('WiFi', `Found ${interfaces.length} interface(s) on agent`); + + // Check if any interface is already in monitor mode + const monitorIface = interfaces.find(i => i.type === 'monitor'); + if (monitorIface) { + monitorInterface = monitorIface.name; + updateMonitorStatus(true); + select.value = monitorIface.name; + } else { + monitorInterface = null; + updateMonitorStatus(false); + } } }) .catch(err => {