From 5fdd3175391d1d617d930c050e597d96db7e1243 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Tue, 10 Nov 2026 23:53:18 -0500 Subject: [PATCH] Rack: clicking a port on an unlinked faceplate opens the cutsheet The NVR Pro is drawn by Front drawing because UniFi doesn't report it, so it has no device page; clicking one of its ports went to /device/UNVR-Pro and showed "No device with this name". Ports on a faceplate whose item isn't linked to a live device now open the port's cable when one is documented, and otherwise the item on the cutsheet. Co-Authored-By: Claude Opus 5.5 --- static/rack.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/rack.js b/static/rack.js index d42e686..a023bd5 100644 --- a/static/rack.js +++ b/static/rack.js @@ -327,6 +327,13 @@ function onLeave(e) { function openPort(el) { if (el.classList.contains('fp-port')) { + const item = _rack && _rack.items.find(i => i.device === el.dataset.switch); + if (item && !item.linked) { + // A faceplate drawn by Front drawing for gear Gandalf can't see (the NVR) has no device page: + // open the port's cable if one is documented, otherwise the item on the cutsheet + location.href = el.dataset.cable ? `/cutsheet#cable-${encodeURIComponent(el.dataset.cable)}` : item.url; + return; + } location.href = `/device/${encodeURIComponent(el.dataset.switch)}#port-${encodeURIComponent(el.dataset.portIdx)}`; } else if (el.dataset.cable) { location.href = `/cutsheet#cable-${encodeURIComponent(el.dataset.cable)}`; -- 2.47.3