Merge pull request 'Rack: clicking a port on an unlinked faceplate opens the cutsheet' (#28) from rack-unlinked-port-clicks into main
Lint / JS (eslint) (push) Successful in 8s
Lint / Python (flake8) (push) Successful in 49s
Lint / Notify on failure (push) Skipped
Security / Python Security (bandit) (push) Successful in 55s
Lint / Deploy (push) Successful in 6s
Test / Python Tests (pytest) (push) Successful in 1m20s
Lint / JS (eslint) (push) Successful in 8s
Lint / Python (flake8) (push) Successful in 49s
Lint / Notify on failure (push) Skipped
Security / Python Security (bandit) (push) Successful in 55s
Lint / Deploy (push) Successful in 6s
Test / Python Tests (pytest) (push) Successful in 1m20s
This commit was merged in pull request #28.
This commit is contained in:
@@ -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)}`;
|
||||
|
||||
Reference in New Issue
Block a user