UI/runtime polish, session rotation limit, login errors, docs update

This commit is contained in:
2026-04-21 16:05:15 +00:00
parent c97cf5308d
commit 6f9bc32440
14 changed files with 346 additions and 43 deletions
+12 -1
View File
@@ -38,6 +38,7 @@ cat > /opt/portal/index.html <<HTML
rfb.resizeSession = true;
const enableHeartbeat = "${ENABLE_HEARTBEAT}" === "1";
const SESSION_CLOSED_URL = '/?session_closed=idle';
const CLOSE_PATH = '${TOUCH_PATH}'.replace(/\/touch$/, '/close');
function goSessionClosed() {
try {
if (window.top && window.top !== window) {
@@ -55,9 +56,19 @@ cat > /opt/portal/index.html <<HTML
}
} catch(e) {}
}
let closing = false;
async function closeSessionNow() {
if (closing) return;
closing = true;
try {
await fetch(CLOSE_PATH, {method:'POST', credentials:'include', keepalive:true});
} catch (e) {}
}
if (enableHeartbeat) {
setInterval(touch, 60000);
setInterval(touch, 15000);
touch();
window.addEventListener('pagehide', closeSessionNow);
window.addEventListener('beforeunload', closeSessionNow);
}
document.addEventListener('contextmenu', (e) => e.preventDefault());
</script>