noVNC bridge: per-device live screens in dashboard (websockify + TokenFile + VNC button)
This commit is contained in:
@@ -240,6 +240,7 @@ function renderFleet() {
|
||||
</div>
|
||||
<div class="flex gap-1.5 flex-wrap">
|
||||
<button onclick="doTerm('${d.mac}')" class="text-[10px] px-2 py-1 rounded bg-emerald-500/20 text-emerald-300 hover:bg-emerald-500/40">TERMINAL</button>
|
||||
<button onclick="doVnc('${d.mac}')" class="text-[10px] px-2 py-1 rounded bg-cyan-500/20 text-cyan-300 hover:bg-cyan-500/40">VNC</button>
|
||||
<button onclick="doOnboard('${d.mac}')" class="text-[10px] px-2 py-1 rounded bg-fuchsia-500/20 text-fuchsia-300 hover:bg-fuchsia-500/40">ONBOARD</button>
|
||||
<button onclick="doShell('${d.mac}')" class="text-[10px] px-2 py-1 rounded bg-zinc-700/50 hover:bg-zinc-600">SHELL</button>
|
||||
<button onclick="doShot('${d.mac}')" class="text-[10px] px-2 py-1 rounded bg-zinc-700/50 hover:bg-zinc-600">SCREENSHOT</button>
|
||||
@@ -396,6 +397,16 @@ function hoverOff() {
|
||||
}
|
||||
|
||||
// ---------- interactive terminal ----------
|
||||
function doVnc(mac) {
|
||||
fetch("/api/device/" + mac + "/vnc").then(r => r.json()).then(d => {
|
||||
if (d.url) {
|
||||
openModal("LIVE SCREEN — " + mac.slice(0, 14), `<iframe src="${d.url}" class="w-full rounded" style="height:75vh;background:#000"></iframe>`);
|
||||
} else {
|
||||
openModal("LIVE SCREEN", `<div class="text-red-400">${d.error || "no VNC mapping"}</div>`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function doTerm(mac) {
|
||||
openModal("TERMINAL — " + mac.slice(0, 14),
|
||||
`<div id="termHost" class="bg-black rounded border border-zinc-700 p-2" style="height:420px"></div>
|
||||
|
||||
Reference in New Issue
Block a user