Separate switch name display from external warning indicator

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2026-01-26 12:21:15 -08:00
parent 2af5ad51d7
commit 4746c2b7f1

View File

@@ -936,6 +936,8 @@
portEl.className = 'switch-port'; portEl.className = 'switch-port';
if (switchConnection.external) { if (switchConnection.external) {
portEl.classList.add('external'); portEl.classList.add('external');
}
if (switchConnection.showSwitchName) {
portEl.textContent = switchConnection.switchName + ':' + switchConnection.port; portEl.textContent = switchConnection.switchName + ':' + switchConnection.port;
} else { } else {
portEl.textContent = switchConnection.port; portEl.textContent = switchConnection.port;
@@ -1321,10 +1323,12 @@
} else if (aIsSwitch && !bIsSwitch) { } else if (aIsSwitch && !bIsSwitch) {
const nodeLoc = nodeLocations.get(nodeB.typeid); const nodeLoc = nodeLocations.get(nodeB.typeid);
const effectiveSwitch = findEffectiveSwitch(nodeLoc, assignedNodes); const effectiveSwitch = findEffectiveSwitch(nodeLoc, assignedNodes);
const isLocalSwitch = effectiveSwitch && effectiveSwitch.typeid === nodeA.typeid;
switchConnections.set(nodeB.typeid, { switchConnections.set(nodeB.typeid, {
port: link.interface_a || '?', port: link.interface_a || '?',
switchName: getLabel(nodeA), switchName: getLabel(nodeA),
external: !effectiveSwitch || effectiveSwitch.typeid !== nodeA.typeid, showSwitchName: !isLocalSwitch,
external: effectiveSwitch && !isLocalSwitch,
speed: getInterfaceSpeed(link.node_a), speed: getInterfaceSpeed(link.node_a),
errors: getInterfaceErrors(link.node_a), errors: getInterfaceErrors(link.node_a),
rates: getInterfaceRates(link.node_a) rates: getInterfaceRates(link.node_a)
@@ -1332,10 +1336,12 @@
} else if (bIsSwitch && !aIsSwitch) { } else if (bIsSwitch && !aIsSwitch) {
const nodeLoc = nodeLocations.get(nodeA.typeid); const nodeLoc = nodeLocations.get(nodeA.typeid);
const effectiveSwitch = findEffectiveSwitch(nodeLoc, assignedNodes); const effectiveSwitch = findEffectiveSwitch(nodeLoc, assignedNodes);
const isLocalSwitch = effectiveSwitch && effectiveSwitch.typeid === nodeB.typeid;
switchConnections.set(nodeA.typeid, { switchConnections.set(nodeA.typeid, {
port: link.interface_b || '?', port: link.interface_b || '?',
switchName: getLabel(nodeB), switchName: getLabel(nodeB),
external: !effectiveSwitch || effectiveSwitch.typeid !== nodeB.typeid, showSwitchName: !isLocalSwitch,
external: effectiveSwitch && !isLocalSwitch,
speed: getInterfaceSpeed(link.node_b), speed: getInterfaceSpeed(link.node_b),
errors: getInterfaceErrors(link.node_b), errors: getInterfaceErrors(link.node_b),
rates: getInterfaceRates(link.node_b) rates: getInterfaceRates(link.node_b)