From 4746c2b7f1b72f37449d18beaa0ebc49d4775e0d Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Mon, 26 Jan 2026 12:21:15 -0800 Subject: [PATCH] Separate switch name display from external warning indicator Co-Authored-By: Claude Opus 4.5 --- static/index.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index 2d50a09..c96db50 100644 --- a/static/index.html +++ b/static/index.html @@ -936,6 +936,8 @@ portEl.className = 'switch-port'; if (switchConnection.external) { portEl.classList.add('external'); + } + if (switchConnection.showSwitchName) { portEl.textContent = switchConnection.switchName + ':' + switchConnection.port; } else { portEl.textContent = switchConnection.port; @@ -1321,10 +1323,12 @@ } else if (aIsSwitch && !bIsSwitch) { const nodeLoc = nodeLocations.get(nodeB.typeid); const effectiveSwitch = findEffectiveSwitch(nodeLoc, assignedNodes); + const isLocalSwitch = effectiveSwitch && effectiveSwitch.typeid === nodeA.typeid; switchConnections.set(nodeB.typeid, { port: link.interface_a || '?', switchName: getLabel(nodeA), - external: !effectiveSwitch || effectiveSwitch.typeid !== nodeA.typeid, + showSwitchName: !isLocalSwitch, + external: effectiveSwitch && !isLocalSwitch, speed: getInterfaceSpeed(link.node_a), errors: getInterfaceErrors(link.node_a), rates: getInterfaceRates(link.node_a) @@ -1332,10 +1336,12 @@ } else if (bIsSwitch && !aIsSwitch) { const nodeLoc = nodeLocations.get(nodeA.typeid); const effectiveSwitch = findEffectiveSwitch(nodeLoc, assignedNodes); + const isLocalSwitch = effectiveSwitch && effectiveSwitch.typeid === nodeB.typeid; switchConnections.set(nodeA.typeid, { port: link.interface_b || '?', switchName: getLabel(nodeB), - external: !effectiveSwitch || effectiveSwitch.typeid !== nodeB.typeid, + showSwitchName: !isLocalSwitch, + external: effectiveSwitch && !isLocalSwitch, speed: getInterfaceSpeed(link.node_b), errors: getInterfaceErrors(link.node_b), rates: getInterfaceRates(link.node_b)