From 02ffdd9d5d877e3ac17b6e69b11689f2509b9f96 Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Tue, 10 Feb 2026 17:37:35 +0100 Subject: [PATCH] Closes #21268: Add Device Type details panel to Device view (#21368) --- netbox/dcim/ui/panels.py | 12 ++++++++++-- netbox/dcim/views.py | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/netbox/dcim/ui/panels.py b/netbox/dcim/ui/panels.py index 440cbad7b..f97eb97a4 100644 --- a/netbox/dcim/ui/panels.py +++ b/netbox/dcim/ui/panels.py @@ -90,7 +90,6 @@ class DevicePanel(panels.ObjectAttributesPanel): parent_device = attrs.TemplatedAttr('parent_bay', template_name='dcim/device/attrs/parent_device.html') gps_coordinates = attrs.GPSCoordinatesAttr() tenant = attrs.RelatedObjectAttr('tenant', linkify=True, grouped_by='group') - device_type = attrs.RelatedObjectAttr('device_type', linkify=True, grouped_by='manufacturer') description = attrs.TextAttr('description') airflow = attrs.ChoiceAttr('airflow') serial = attrs.TextAttr('serial', label=_('Serial number'), style='font-monospace', copy_button=True) @@ -122,10 +121,19 @@ class DeviceManagementPanel(panels.ObjectAttributesPanel): cluster = attrs.RelatedObjectAttr('cluster', linkify=True) +class DeviceDeviceTypePanel(panels.ObjectAttributesPanel): + title = _('Device Type') + + manufacturer = attrs.RelatedObjectAttr('device_type.manufacturer', linkify=True) + model = attrs.RelatedObjectAttr('device_type', linkify=True) + height = attrs.TextAttr('device_type.u_height', format_string='{}U') + front_image = attrs.ImageAttr('device_type.front_image') + rear_image = attrs.ImageAttr('device_type.rear_image') + + class DeviceDimensionsPanel(panels.ObjectAttributesPanel): title = _('Dimensions') - height = attrs.TextAttr('device_type.u_height', format_string='{}U') total_weight = attrs.TemplatedAttr('total_weight', template_name='dcim/device/attrs/total_weight.html') diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index a516bd950..d0497323d 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -2470,6 +2470,7 @@ class DeviceView(generic.ObjectView): ], ), ImageAttachmentsPanel(), + panels.DeviceDeviceTypePanel(), panels.DeviceDimensionsPanel(), TemplatePanel('dcim/panels/device_rack_elevations.html'), ],