Add TP-Link AP support with wireless client sub-locations

- Add NodeType enum (switch, ap, wireless_client, wired_client)
- Poll SNMPv2c and SNMPv3 in parallel to win race with ping
- Render APs with bordered sub-locations containing wireless clients
- Fall back to parent interface stats when child lacks them
- Log when unreachable nodes become reachable via merge

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2026-02-02 20:33:42 -08:00
parent bd829eb888
commit 92ab5d8a6e
11 changed files with 261 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
import { getLabel, getNodeIdentifiers, isSwitch } from './nodes.js';
import { getLabel, getNodeIdentifiers, isSwitch, isAP } from './nodes.js';
import { incrementAnonCounter } from './state.js';
export function buildSwitchUplinks(allSwitches, switchLinks) {
@@ -83,11 +83,11 @@ export function buildSwitchUplinks(allSwitches, switchLinks) {
remotePort: reverseEdge?.remotePort || '?',
parentNode: current,
parentName: getLabel(current),
speed: reverseEdge?.localSpeed || 0,
errors: reverseEdge?.localErrors || null,
rates: reverseEdge?.localRates || null,
uptime: reverseEdge?.localUptime || 0,
lastError: reverseEdge?.localLastError || null
speed: reverseEdge?.localSpeed || edge.localSpeed || 0,
errors: reverseEdge?.localErrors || edge.localErrors || null,
rates: reverseEdge?.localRates || edge.localRates || null,
uptime: reverseEdge?.localUptime || edge.localUptime || 0,
lastError: reverseEdge?.localLastError || edge.localLastError || null
});
queue.push(edge.neighbor);
}
@@ -130,10 +130,10 @@ export function getSwitchesInLocation(loc, assignedNodes) {
const switches = [];
const nodes = assignedNodes.get(loc) || [];
nodes.forEach(n => {
if (isSwitch(n)) switches.push(n);
if (isSwitch(n) || isAP(n)) switches.push(n);
});
loc.children.forEach(child => {
if (child.anonymous) {
if (child.anonymous || child.isAPLocation) {
switches.push(...getSwitchesInLocation(child, assignedNodes));
}
});