mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 14:50:00 -07:00
Fix agent mode UI state sync for pager, WiFi, and Bluetooth
- Fix device dropdown for agent mode by checking sdr_devices key - Fix pager checkStatus() to use agent endpoint when in agent mode - Fix WiFi checkScanStatus() to be agent-aware - Fix Bluetooth checkScanStatus() to be agent-aware These fixes prevent the UI from reverting to 'stopped' state when the agent is actually running a mode.
This commit is contained in:
@@ -571,12 +571,19 @@ const WiFiMode = (function() {
|
||||
|
||||
async function checkScanStatus() {
|
||||
try {
|
||||
const response = await fetch(`${CONFIG.apiBase}/scan/status`);
|
||||
const isAgentMode = typeof currentAgent !== 'undefined' && currentAgent !== 'local';
|
||||
const endpoint = isAgentMode
|
||||
? `/controller/agents/${currentAgent}/wifi/status`
|
||||
: `${CONFIG.apiBase}/scan/status`;
|
||||
|
||||
const response = await fetch(endpoint);
|
||||
if (!response.ok) return;
|
||||
|
||||
const status = await response.json();
|
||||
const data = await response.json();
|
||||
// Handle agent response format (may be nested in 'result')
|
||||
const status = isAgentMode && data.result ? data.result : data;
|
||||
|
||||
if (status.is_scanning) {
|
||||
if (status.is_scanning || status.running) {
|
||||
setScanning(true, status.scan_mode);
|
||||
if (status.scan_mode === 'deep') {
|
||||
startEventStream();
|
||||
|
||||
Reference in New Issue
Block a user