Просмотр исходного кода

fix(dcim): Add color field to FrontPort form

Include the color field in FrontPortForm and commented-out
FrontPortBulkCreateForm field lists to allow editing front port colors
via the UI.

Fixes #21985
Martin Hauser 1 месяц назад
Родитель
Сommit
b1a810164a
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      netbox/dcim/forms/bulk_create.py
  2. 1 1
      netbox/dcim/forms/model_forms.py

+ 1 - 1
netbox/dcim/forms/bulk_create.py

@@ -94,7 +94,7 @@ class InterfaceBulkCreateForm(
 
 
 
 
 # class FrontPortBulkCreateForm(
 # class FrontPortBulkCreateForm(
-#     form_from_model(FrontPort, ['label', 'type', 'description', 'tags']),
+#     form_from_model(FrontPort, ['label', 'type', 'color', 'description', 'tags']),
 #     DeviceBulkAddComponentForm
 #     DeviceBulkAddComponentForm
 # ):
 # ):
 #     pass
 #     pass

+ 1 - 1
netbox/dcim/forms/model_forms.py

@@ -1166,7 +1166,7 @@ class FrontPortTemplateForm(FrontPortFormMixin, ModularComponentTemplateForm):
                 FieldSet('device_type', name=_('Device Type')),
                 FieldSet('device_type', name=_('Device Type')),
                 FieldSet('module_type', name=_('Module Type')),
                 FieldSet('module_type', name=_('Module Type')),
             ),
             ),
-            'name', 'label', 'type', 'positions', 'rear_ports', 'description',
+            'name', 'label', 'type', 'color', 'positions', 'rear_ports', 'description',
         ),
         ),
     )
     )