10 Commits

Author SHA1 Message Date
dcstephenson 76391fadcf Realistic rack-equipment icons for switches and patch panels
Swapped the abstract mxgraph.networks.switch pictogram and the hand-drawn
patch-panel box for draw.io's built-in Rack shape library -- real 19"
front-panel silhouettes (verified against the actual stencil source on
GitHub, not guessed): mxgraph.rack.general.switches_1 for switches,
...cat5e_rack_mount_patch_panel_24_ports for patch panels.

No stencil library covers FS.com/AFL/Primex/Clearview/FIS (all niche
fiber/telecom brands draw.io doesn't ship icons for), so per user's choice
brand/model accuracy is carried as text instead: every node's caption is
now 'hostname' + the real NetBox device_type.model on a second line, e.g.
'ls-bsls-sw01 / IES3110-8TFP-R'.

Patch panels also lost their hand-built 7-cell composition (body + strip +
6 port-tick cells) now that a real stencil exists -- one cell each,
cell count 530 -> 271.

Fixed a spacing regression this surfaced: the new realistic icons are much
shorter/flatter than the old ones, and COL_W (210) left only ~100px
between adjacent columns -- not enough room for a ~150-180px connector
label, so port/VLAN tags were overlapping neighboring icons. COL_W -> 320.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NM3nivbufxEWiKKmatEtEe
2026-09-15 14:36:23 -05:00
dcstephenson 4222da4a9b Tone down the patch panel shape
Dark navy body + high-contrast port ticks made patch panels the single
boldest thing on the page -- more visually dominant than even the
distribution switches, backwards for the least important device type in
the diagram. Switched to a pale warm-stone fill/stroke (distinct hue from
the switches' cool blue-grays, so it doesn't just read as 'a paler gray
box' next to the field-switch/spare swatches), a hairline seam instead of
a solid strip, and outline-only port ticks instead of filled dark ones.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NM3nivbufxEWiKKmatEtEe
2026-09-15 14:10:22 -05:00
dcstephenson 2a7528f8d8 Add a real VLAN legend, matching the reference diagram's style
Previously the only VLAN visual was a small 14px swatch inside the detail
table -- easy to miss, not what the user meant by 'legend'. Added a
dedicated colored block per VLAN (VLAN <id> on a color fill, name in a
matching-outline box next to it), stacked left of the existing detail
table, same layout idea as the reference diagram this was modeled on.

Also fixed a real bug this surfaced: vlan_color() picked a palette color
by hash(vid), which let two different VLANs collide on the same color
(209 and 217 both landed on green). Colors are now assigned by position
among the VLANs actually present, which can't collide as long as there
are <= 8 of them (the palette size) -- true here with room to grow.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NM3nivbufxEWiKKmatEtEe
2026-09-15 14:02:00 -05:00
dcstephenson c9dad944e9 Bump VLAN text sizes -- previous export was illegible in the PNG
Connector VLAN tags were 7.5px on a ~4000x9400px page -- effectively
invisible unless zoomed in hard inside draw.io itself. Bumped:
- connector labels: 7.5px -> 13px, bold, darker color
- VLAN table: title 11->15px, header 9->12px, rows 9->12px (row/header
  height grown to match, table height computed from the same constants
  so nothing clips)

Page height barely moved (4656 -> 4692px) since only the VLAN panel grew.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NM3nivbufxEWiKKmatEtEe
2026-09-15 13:56:23 -05:00
dcstephenson 83bb4cf708 Regenerate: department VLANs tagged on all 42 field switch uplinks
Per user: Device.tenant dictates department. Set the one switch missing a
tenant (bs-cr13-sw01 -> AMI), then tagged each FS.com IES3110-8TFP-R
switch's SFP uplink(s) with its department VLAN, alongside the existing
214 (Switch Management) native VLAN:

  AMI -> 203, Security -> 209, Gas/Water/Waste Water -> 215 (Gas and
  Water, per user), Electric -> 217

63 interfaces updated, 0 skipped. Connector labels now show both, e.g.
'10 · V214+215T ↔ 2'.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NM3nivbufxEWiKKmatEtEe
2026-09-15 13:49:22 -05:00
dcstephenson dd5ac52105 Fix dropped-cable bug, tag VLAN 214 on FS.com switch uplinks
Found while wiring up VLAN 214 on switch uplink ports: export_topology.py
deduped edges by DEVICE PAIR, so when a switch had two real cables to the
same neighboring device (very common here -- most FS.com field switches
run both SFP ports 9 and 10 into the same local patch panel before fanning
out from its rear side) only one of the two cables survived into the
graph. 43 real physical links across 30 device pairs were silently
missing from the diagram.

- export_topology.py: edges keyed per Cable (cable_id), never deduped by
  device pair. Edge count 80 -> 123.
- generate_drawio.py: the tree-layout DFS had a matching bug -- a node's
  neighbor list wasn't deduped before recursing, so a parallel edge to an
  already-visited node got walked a second time, found no unvisited
  children, and got counted as a phantom extra leaf. One phantom leaf per
  redundant cable was inflating page height for no reason (bogus page
  height >16000px, clipped by draw.io's render cap, before this fix).

NetBox changes (per user): all 42 FS.com IES3110-8TFP-R field switches'
SFP ports (9 and 10, whichever are actually cabled -- chain-end switches
only use port 9) are now interface.mode='tagged' with untagged_vlan=214
(Switch Management), the native VLAN on what the user confirmed are
redundant trunk uplinks. 63 interfaces updated; the diagram now shows
'9·V214' style tags on those connectors. Department-VLAN tagging (the
other half of each trunk) is intentionally not done yet -- needs a real
per-switch mapping, not a guess.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NM3nivbufxEWiKKmatEtEe
2026-09-15 13:45:15 -05:00
dcstephenson 4ff9170a00 Regenerate: 4 more VLANs added in NetBox (203, 214, 215, 217)
- 203 AMI            10.203.0.0/21
- 214 Switch Management  10.214.0.0/24
- 215 Gas and Water  10.215.0.0/21
- 217 Electric       10.217.0.0/21

VLAN table now has 5 rows total. Still no interface tagged/untagged
assignments, so connector labels are unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NM3nivbufxEWiKKmatEtEe
2026-09-15 13:36:29 -05:00
dcstephenson a377fac139 Regenerate: VLAN 209 (Security, 10.209.0.0/22) added in NetBox
First real row in the VLAN table -- no code changes, this is the
placeholder->real-data flip the previous commit set up.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NM3nivbufxEWiKKmatEtEe
2026-09-15 13:31:03 -05:00
dcstephenson 715e37d048 Add VLAN table + per-connector VLAN tags (structure only -- no VLANs in NetBox yet)
Inspired by a reference diagram the user liked (VLAN legend/mapping table,
per-port VLAN info) but explicitly without the literal switch CLI config
dumps that diagram also had.

- export_topology.py: pulls ipam.VLAN (with prefixes) plus, for every
  edge whose endpoint is a real Interface, that port's mode/untagged/
  tagged VLANs. NetBox has zero VLANs defined right now, so this comes
  back empty/null throughout -- the plumbing is real, the data just
  isn't there yet.
- generate_drawio.py: renders a VLAN table (VLAN/Name/Description/
  Subnet/Site) at the top of the diagram. With no VLANs it shows an
  explicit dashed 'not configured yet' placeholder row instead of
  either fabricating VLAN numbers or silently omitting the table.
  Connector labels get a 'V<id>' / 'V<id>,<id>T' suffix per side
  whenever that port actually has VLAN config -- currently a no-op,
  activates automatically the moment VLANs exist in NetBox.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NM3nivbufxEWiKKmatEtEe
2026-09-15 13:24:34 -05:00
dcstephenson b6151b7de5 Add port labels, modernize patch panels, add a real PNG preview
- export_topology.py: edges now carry the exact port name on both ends
  (pulled directly from Cable/CableTermination, not inferred from the
  trace chain), so the diagram can label each connector.
- generate_drawio.py: patch panels are now a small rack-unit shape
  (header strip + port ticks, parented to the panel body so they move
  together) instead of a plain box; connectors show 'porta <-> portb'
  and no longer carry a directional arrowhead (these are physical
  cables, not directed links); switches keep the network-switch icon.
- render_png.js + render_host.html: headless Puppeteer driver for
  embed.diagrams.net's postMessage export protocol -- an actual
  render of the .drawio file, not an approximation. Field-Switch-
  Topology.png is the committed output, for anyone who wants a look
  without opening draw.io.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NM3nivbufxEWiKKmatEtEe
2026-09-15 13:03:18 -05:00