VNC-122 log idle disconnect, add backup method if postMessage fails
This commit is contained in:
parent
e7a2f06dae
commit
1eae1221b6
|
|
@ -1566,7 +1566,13 @@ const UI = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timeSinceLastActivityInS > idleDisconnectInS) {
|
if (timeSinceLastActivityInS > idleDisconnectInS) {
|
||||||
|
Log.Warn("Idle Disconnect reached, disconnecting rfb session...");
|
||||||
parent.postMessage({ action: 'idle_session_timeout', value: 'Idle session timeout exceeded'}, '*' );
|
parent.postMessage({ action: 'idle_session_timeout', value: 'Idle session timeout exceeded'}, '*' );
|
||||||
|
|
||||||
|
// in some cases the intra-frame message could be blocked, fall back to navigating to a disconnect page.
|
||||||
|
setTimeout(function() {
|
||||||
|
window.location.replace('/disconnected.html');
|
||||||
|
}, 10000);
|
||||||
} else {
|
} else {
|
||||||
//send keep-alive
|
//send keep-alive
|
||||||
UI.rfb.sendKey(1, null, false);
|
UI.rfb.sendKey(1, null, false);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Session Disconnected</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--bg-color: #f8f9fa;
|
||||||
|
--card-bg: #ffffff;
|
||||||
|
--accent-color: #d9534f;
|
||||||
|
--accent-dark: #c9302c;
|
||||||
|
--text-color: #333;
|
||||||
|
--font-family: 'Segoe UI', Tahoma, sans-serif;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
background-color: var(--bg-color);
|
||||||
|
color: var(--text-color);
|
||||||
|
font-family: var(--font-family);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
background: var(--card-bg);
|
||||||
|
padding: 2rem;
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
|
||||||
|
max-width: 400px;
|
||||||
|
width: 90%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
font-size: 3rem;
|
||||||
|
color: var(--accent-color);
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
font-size: 1rem;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.6rem 1.2rem;
|
||||||
|
background-color: var(--accent-color);
|
||||||
|
color: white;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-weight: 500;
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
}
|
||||||
|
.btn:hover {
|
||||||
|
background-color: var(--accent-dark);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="card">
|
||||||
|
<div class="icon">⚠️</div>
|
||||||
|
<h1>Session Disconnected</h1>
|
||||||
|
<p>Your remote session has ended due to inactivity or disconnection.</p>
|
||||||
|
<a class="btn" href="/">Return to Dashboard</a>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -13,10 +13,11 @@ export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
viteCommonjs(),
|
viteCommonjs(),
|
||||||
envCompatible(),
|
envCompatible(),
|
||||||
ViteMinifyPlugin(),
|
//ViteMinifyPlugin(),
|
||||||
ViteRestart({restart: ['core/**', 'app/**','kasmvnc-version.txt']}),
|
ViteRestart({restart: ['core/**', 'app/**','kasmvnc-version.txt']}),
|
||||||
],
|
],
|
||||||
build: {
|
build: {
|
||||||
|
sourcemap: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: {
|
input: {
|
||||||
main: './index.html',
|
main: './index.html',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue