mirror of
https://github.com/smittix/intercept.git
synced 2026-06-02 11:13:37 -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:
+14
-5
@@ -3447,13 +3447,22 @@
|
||||
}
|
||||
|
||||
function checkStatus() {
|
||||
fetch('/status')
|
||||
const isAgentMode = typeof currentAgent !== 'undefined' && currentAgent !== 'local';
|
||||
const endpoint = isAgentMode
|
||||
? `/controller/agents/${currentAgent}/pager/status`
|
||||
: '/status';
|
||||
|
||||
fetch(endpoint)
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.running !== isRunning) {
|
||||
setRunning(data.running);
|
||||
if (data.running && !eventSource) {
|
||||
startStream();
|
||||
// Handle agent response format (may be nested in 'result')
|
||||
const statusData = isAgentMode && data.result ? data.result : data;
|
||||
const running = statusData.running;
|
||||
|
||||
if (running !== isRunning) {
|
||||
setRunning(running);
|
||||
if (running && !eventSource) {
|
||||
startStream(isAgentMode);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user