فهرست منبع

Add power_panel_id field to PowerFeedFilterForm

Jeremy Stretch 6 سال پیش
والد
کامیت
7b6c104768
1فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  1. 10 0
      netbox/dcim/forms.py

+ 10 - 0
netbox/dcim/forms.py

@@ -3645,10 +3645,20 @@ class PowerFeedFilterForm(BootstrapMixin, CustomFieldFilterForm):
             api_url="/api/dcim/sites/",
             api_url="/api/dcim/sites/",
             value_field="slug",
             value_field="slug",
             filter_for={
             filter_for={
+                'power_panel_id': 'site',
                 'rack_id': 'site',
                 'rack_id': 'site',
             }
             }
         )
         )
     )
     )
+    power_panel_id = FilterChoiceField(
+        queryset=PowerPanel.objects.all(),
+        label='Power panel',
+        null_label='-- None --',
+        widget=APISelectMultiple(
+            api_url="/api/dcim/power-panels/",
+            null_option=True,
+        )
+    )
     rack_id = FilterChoiceField(
     rack_id = FilterChoiceField(
         queryset=Rack.objects.all(),
         queryset=Rack.objects.all(),
         label='Rack',
         label='Rack',