Преглед на файлове

Fixes #10177: Correct display of custom fields when editing VM interfaces

jeremystretch преди 3 години
родител
ревизия
777af35030
променени са 3 файла, в които са добавени 23 реда и са изтрити 2 реда
  1. 1 0
      docs/release-notes/version-3.3.md
  2. 14 2
      netbox/templates/virtualization/vminterface_edit.html
  3. 8 0
      netbox/virtualization/forms/models.py

+ 1 - 0
docs/release-notes/version-3.3.md

@@ -7,6 +7,7 @@
 * [#10155](https://github.com/netbox-community/netbox/issues/10155) - Fix rear port display when editing front port template for module type 
 * [#10155](https://github.com/netbox-community/netbox/issues/10155) - Fix rear port display when editing front port template for module type 
 * [#10156](https://github.com/netbox-community/netbox/issues/10156) - Avoid forcing SVG image links to open in a new window
 * [#10156](https://github.com/netbox-community/netbox/issues/10156) - Avoid forcing SVG image links to open in a new window
 * [#10161](https://github.com/netbox-community/netbox/issues/10161) - Restore "set null" option for custom fields during bulk edit
 * [#10161](https://github.com/netbox-community/netbox/issues/10161) - Restore "set null" option for custom fields during bulk edit
+* [#10177](https://github.com/netbox-community/netbox/issues/10177) - Correct display of custom fields when editing VM interfaces
 * [#10181](https://github.com/netbox-community/netbox/issues/10181) - Restore MultiPartParser (regression from #10031)
 * [#10181](https://github.com/netbox-community/netbox/issues/10181) - Restore MultiPartParser (regression from #10031)
 
 
 ---
 ---

+ 14 - 2
netbox/templates/virtualization/vminterface_edit.html

@@ -21,10 +21,22 @@
       {% endif %}
       {% endif %}
       {% render_field form.name %}
       {% render_field form.name %}
       {% render_field form.description %}
       {% render_field form.description %}
-      {% render_field form.mac_address %}
+      {% render_field form.tags %}
+    </div>
+
+    <div class="field-group my-5">
+        <div class="row mb-2">
+          <h5 class="offset-sm-3">Addressing</h5>
+        </div>
       {% render_field form.vrf %}
       {% render_field form.vrf %}
+      {% render_field form.mac_address %}
+    </div>
+
+    <div class="field-group my-5">
+        <div class="row mb-2">
+          <h5 class="offset-sm-3">Operation</h5>
+        </div>
       {% render_field form.mtu %}
       {% render_field form.mtu %}
-      {% render_field form.tags %}
       {% render_field form.enabled %}
       {% render_field form.enabled %}
     </div>
     </div>
 
 

+ 8 - 0
netbox/virtualization/forms/models.py

@@ -323,6 +323,14 @@ class VMInterfaceForm(InterfaceCommonForm, NetBoxModelForm):
         label='VRF'
         label='VRF'
     )
     )
 
 
+    fieldsets = (
+        ('Interface', ('virtual_machine', 'name', 'description', 'tags')),
+        ('Addressing', ('vrf', 'mac_address')),
+        ('Operation', ('mtu', 'enabled')),
+        ('Related Interfaces', ('parent', 'bridge')),
+        ('802.1Q Switching', ('mode', 'vlan_group', 'untagged_vlan', 'tagged_vlans')),
+    )
+
     class Meta:
     class Meta:
         model = VMInterface
         model = VMInterface
         fields = [
         fields = [