From 39c8daa9b0d8609e547ebca95162e5a4b1be712a Mon Sep 17 00:00:00 2001 From: yuanyuanxiang <962914132@qq.com> Date: Mon, 19 Oct 2026 10:39:36 +0200 Subject: [PATCH] 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 --- server/web/index.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/server/web/index.html b/server/web/index.html index 357b01d..a4fc850 100644 --- a/server/web/index.html +++ b/server/web/index.html @@ -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(); } }