mirror of
https://github.com/smittix/intercept.git
synced 2026-06-09 06:31:55 -07:00
Detect existing monitor mode when loading agent interfaces
When refreshing agent WiFi interfaces, check if any interface has type='monitor' and automatically set the monitor status to Active. Previously the UI only showed Active when monitor was explicitly enabled via the button.
This commit is contained in:
+14
-1
@@ -5459,15 +5459,28 @@
|
||||
if (interfaces.length === 0) {
|
||||
select.innerHTML = '<option value="">No WiFi interfaces on agent</option>';
|
||||
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 `<option value="${i.name || i}">${label}</option>`;
|
||||
return `<option value="${i.name || i}" data-type="${i.type || 'managed'}">${label}</option>`;
|
||||
}).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 => {
|
||||
|
||||
Reference in New Issue
Block a user