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

Fixes #3384: Maximum and allocated draw fields should be included on power port template creation form

Jeremy Stretch 6 лет назад
Родитель
Сommit
ea9492d4bd
3 измененных файлов с 12 добавлено и 1 удалено
  1. 1 0
      CHANGELOG.md
  2. 10 0
      netbox/dcim/forms.py
  3. 1 1
      netbox/dcim/tables.py

+ 1 - 0
CHANGELOG.md

@@ -18,6 +18,7 @@ v2.6.2 (FUTURE)
 * [#3317](https://github.com/netbox-community/netbox/issues/3317) - Fix permissions for ConfigContextBulkDeleteView
 * [#3323](https://github.com/netbox-community/netbox/issues/3323) - Fix permission evaluation for interface connections view
 * [#3342](https://github.com/netbox-community/netbox/issues/3342) - Fix cluster delete button
+* [#3384](https://github.com/netbox-community/netbox/issues/3384) - Maximum and allocated draw fields should be included on power port template creation form
 * [#3385](https://github.com/netbox-community/netbox/issues/3385) - Fix power panels list when bulk editing power feeds
 
 ---

+ 10 - 0
netbox/dcim/forms.py

@@ -978,6 +978,16 @@ class PowerPortTemplateCreateForm(ComponentForm):
     name_pattern = ExpandableNameField(
         label='Name'
     )
+    maximum_draw = forms.IntegerField(
+        min_value=1,
+        required=False,
+        help_text="Maximum current draw (watts)"
+    )
+    allocated_draw = forms.IntegerField(
+        min_value=1,
+        required=False,
+        help_text="Allocated current draw (watts)"
+    )
 
 
 class PowerOutletTemplateForm(BootstrapMixin, forms.ModelForm):

+ 1 - 1
netbox/dcim/tables.py

@@ -424,7 +424,7 @@ class PowerPortTemplateTable(BaseTable):
 
     class Meta(BaseTable.Meta):
         model = PowerPortTemplate
-        fields = ('pk', 'name')
+        fields = ('pk', 'name', 'maximum_draw', 'allocated_draw')
         empty_text = "None"