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

+15
View File
@@ -126,6 +126,21 @@ class DeviceUtilitiesContent(PluginTemplateExtension):
return ""
return self.render("netbox_utilities/device_bulk_module_button.html")
def left_page(self):
# Rendered into the left column; switch_panel.js moves it above the "Device" and "Management" cards.
request, device = self.context["request"], self.context["object"]
if not switch_ports_enabled() or not request.user.has_perm("dcim.view_interface"):
return ""
from . import switch_ports
from .switch_port_views import switch_panel_context
if not switch_ports.is_switch(device):
return ""
return self.render(
"netbox_utilities/device_switch_panel.html",
{**switch_panel_context(request, device), "asset_version": __version__},
)
def right_page(self):
placement = DeviceRackPlacement.objects.filter(device=self.context["object"]).first()
if placement is None: