Tune idle timeout, heartbeat redirect, and update project context
This commit is contained in:
+14
-1
@@ -37,9 +37,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) {
|
||||
|
||||
Reference in New Issue
Block a user