KASM-7180 ensure UI.rfb is defined (#133)
Co-authored-by: Matt McClaskey <matt@kasmweb.com>
This commit is contained in:
parent
5d468a3fe1
commit
14c8c2af59
|
@ -1551,7 +1551,7 @@ const UI = {
|
||||||
//keep alive for websocket connection to stay open, since we may not control reverse proxies
|
//keep alive for websocket connection to stay open, since we may not control reverse proxies
|
||||||
//send a keep alive within a window that we control
|
//send a keep alive within a window that we control
|
||||||
UI._sessionTimeoutInterval = setInterval(function() {
|
UI._sessionTimeoutInterval = setInterval(function() {
|
||||||
|
if (UI.rfb) {
|
||||||
const timeSinceLastActivityInS = (Date.now() - UI.rfb.lastActiveAt) / 1000;
|
const timeSinceLastActivityInS = (Date.now() - UI.rfb.lastActiveAt) / 1000;
|
||||||
let idleDisconnectInS = 1200; //20 minute default
|
let idleDisconnectInS = 1200; //20 minute default
|
||||||
if (Number.isFinite(parseFloat(UI.rfb.idleDisconnect))) {
|
if (Number.isFinite(parseFloat(UI.rfb.idleDisconnect))) {
|
||||||
|
@ -1564,6 +1564,7 @@ const UI = {
|
||||||
//send keep-alive
|
//send keep-alive
|
||||||
UI.rfb.sendKey(1, null, false);
|
UI.rfb.sendKey(1, null, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, 5000);
|
}, 5000);
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('noVNC_status').style.visibility = "visible";
|
document.getElementById('noVNC_status').style.visibility = "visible";
|
||||||
|
|
Loading…
Reference in New Issue