Explorar el Código

Closes #23095: Display compatible Module Types in a sortable, paginated table (#23190)

Martin Hauser hace 13 horas
padre
commit
ff1e8a063c
Se han modificado 2 ficheros con 6 adiciones y 2 borrados
  1. 0 1
      netbox/dcim/ui/panels.py
  2. 6 1
      netbox/dcim/views.py

+ 0 - 1
netbox/dcim/ui/panels.py

@@ -208,7 +208,6 @@ class ModuleBayTypePanel(panels.ObjectAttributesPanel):
     name = attrs.TextAttr('name')
     color = attrs.ColorAttr('color')
     description = attrs.TextAttr('description')
-    module_types = attrs.RelatedObjectListAttr('module_types', label=_('Compatible Module Types'), linkify=True)
 
 
 class ModuleTypeProfilePanel(panels.ObjectAttributesPanel):

+ 6 - 1
netbox/dcim/views.py

@@ -1757,12 +1757,17 @@ class ModuleBayTypeView(generic.ObjectView):
         left_panels=[
             panels.ModuleBayTypePanel(),
             TagsPanel(),
-            CommentsPanel(),
         ],
         right_panels=[
             CustomFieldsPanel(),
+            CommentsPanel(),
         ],
         bottom_panels=[
+            ObjectsTablePanel(
+                model='dcim.ModuleType',
+                title=_('Compatible Module Types'),
+                filters={'module_bay_type_id': lambda ctx: ctx['object'].pk},
+            ),
             ObjectsTablePanel(
                 model='dcim.ModuleBay',
                 title=_('Module Bays'),