Rack: clicking a port on an unlinked faceplate opens the cutsheet
Lint / JS (eslint) (push) Successful in 8s
Lint / Python (flake8) (push) Successful in 50s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 1m8s
Lint / JS (eslint) (pull_request) Successful in 22s
Lint / Python (flake8) (pull_request) Successful in 1m49s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Security / Python Security (bandit) (pull_request) Successful in 1m12s
Test / Python Tests (pytest) (pull_request) Successful in 1m9s
Test / Python Tests (pytest) (push) Successful in 1m3s

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 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 23:53:18 -05:00
co-authored by Claude Opus 5.5
parent 3e2918526f
commit 5fdd317539
+7
View File
@@ -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)}`;