Fix: Keep the audit log open across WebSocket reconnects
Hiding the browser tab while the audit log was open closed the socket, because the visibility handler treats only the remote screen, terminal and wall pages as streaming pages. Returning to the tab reconnected the socket, and the onopen restore path took its catch-all branch, which navigated to the device list. The audit log therefore vanished whenever the browser was minimized. The catch-all branch now leaves the active page alone when it is the audit log, and only refreshes the device list in the background. Every other page keeps the previous behaviour: the login page advances with a cached token, and the terminal page falls back to the device list because its session died with the socket. Audit results already rendered stay on screen, so the admin can keep reading without re-querying. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
cd4f3675fd
commit
39c8daa9b0
1 file changed
+11
-1
+11
-1
@@ -2419,7 +2419,17 @@
|
||||
wallAllocBudget();
|
||||
getDevices();
|
||||
} else {
|
||||
showPage('devices-page');
|
||||
// Hiding the tab closes the socket on non-streaming
|
||||
// pages and returning reconnects here. Keep an open
|
||||
// audit log visible instead of yanking the admin back
|
||||
// to the device list. Every other page still moves to
|
||||
// devices: a terminal session died with the socket,
|
||||
// and the login page needs to advance with a cached
|
||||
// token.
|
||||
const active = document.querySelector('.page.active');
|
||||
if (!active || active.id !== 'audit-page') {
|
||||
showPage('devices-page');
|
||||
}
|
||||
getDevices();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user