feat: Aruba-style switch front panel on the device page

Switches show a Ports panel above the Device and Management cards: a dark
faceplate with every physical port as RJ45/SFP jack (odd on top, even
below, per stack member), a status view (link, free, disabled) and a VLAN
view with the label colours of the PDF, contrast-aware text, legend,
tooltips with peer and description, key figures and a link to the PDF
export. Texts follow the user's NetBox language. The panel is rendered
into the left column and moved to the top by a small script.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
MrBlakeandClaude Opus 5.5 committed 2026-10-30 10:03:07 +01:00
1 parent 7289c21684
commit b1ecbbbb75
10 files changed
+369 -5

No files matched your search

@@ -137,3 +137,11 @@ class PDFTest(SimpleTestCase):
ink = switch_port_pdf.text_color(fill)
light, dark = sorted((switch_port_pdf.luminance(fill), switch_port_pdf.luminance(ink)), reverse=True)
self.assertGreaterEqual((light + 0.05) / (dark + 0.05), 3)
class InkTest(SimpleTestCase):
def test_text_colour_contrasts_with_vlan_colour(self):
self.assertEqual(switch_ports.ink_for("#ff7f0e"), "#000000")
self.assertEqual(switch_ports.ink_for("#1f77b4"), "#ffffff")
self.assertEqual(port("1", label="10", assigned_color="#2ca02c").ink, "#000000")
self.assertEqual(port("2").ink, "")