Tune idle timeout, heartbeat redirect, and update project context

This commit is contained in:
2026-04-21 13:31:47 +00:00
parent 9c9b97374c
commit c97cf5308d
11 changed files with 400 additions and 56 deletions
+14 -1
View File
@@ -59,9 +59,22 @@ cat > /opt/portal/index.html <<HTML
rfb.scaleViewport = true;
rfb.resizeSession = true;
const enableHeartbeat = "${ENABLE_HEARTBEAT}" === "1";
const SESSION_CLOSED_URL = '/?session_closed=idle';
function goSessionClosed() {
try {
if (window.top && window.top !== window) {
window.top.location.href = SESSION_CLOSED_URL;
return;
}
} catch (e) {}
window.location.href = SESSION_CLOSED_URL;
}
async function touch() {
try {
await fetch('${TOUCH_PATH}', {method:'POST', credentials:'include'});
const res = await fetch('${TOUCH_PATH}', {method:'POST', credentials:'include'});
if (!res.ok) {
goSessionClosed();
}
} catch(e) {}
}
if (enableHeartbeat) {