|
@@ -7,7 +7,7 @@ from dcim.choices import *
|
|
|
from dcim.constants import *
|
|
from dcim.constants import *
|
|
|
from dcim.models import *
|
|
from dcim.models import *
|
|
|
from extras.models import ConfigTemplate
|
|
from extras.models import ConfigTemplate
|
|
|
-from ipam.models import ASN, IPAddress, VLAN, VLANGroup, VRF
|
|
|
|
|
|
|
+from ipam.models import ASN, IPAddress, VLAN, VLANGroup, VLANTranslationPolicy, VRF
|
|
|
from netbox.forms import NetBoxModelForm
|
|
from netbox.forms import NetBoxModelForm
|
|
|
from tenancy.forms import TenancyForm
|
|
from tenancy.forms import TenancyForm
|
|
|
from users.models import User
|
|
from users.models import User
|
|
@@ -1382,6 +1382,11 @@ class InterfaceForm(InterfaceCommonForm, ModularDeviceComponentForm):
|
|
|
required=False,
|
|
required=False,
|
|
|
label=_('WWN')
|
|
label=_('WWN')
|
|
|
)
|
|
)
|
|
|
|
|
+ vlan_translation_policy = DynamicModelChoiceField(
|
|
|
|
|
+ queryset=VLANTranslationPolicy.objects.all(),
|
|
|
|
|
+ required=False,
|
|
|
|
|
+ label=_('VLAN Translation Policy')
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
fieldsets = (
|
|
fieldsets = (
|
|
|
FieldSet(
|
|
FieldSet(
|
|
@@ -1391,7 +1396,7 @@ class InterfaceForm(InterfaceCommonForm, ModularDeviceComponentForm):
|
|
|
FieldSet('vdcs', 'mtu', 'tx_power', 'enabled', 'mgmt_only', 'mark_connected', name=_('Operation')),
|
|
FieldSet('vdcs', 'mtu', 'tx_power', 'enabled', 'mgmt_only', 'mark_connected', name=_('Operation')),
|
|
|
FieldSet('parent', 'bridge', 'lag', name=_('Related Interfaces')),
|
|
FieldSet('parent', 'bridge', 'lag', name=_('Related Interfaces')),
|
|
|
FieldSet('poe_mode', 'poe_type', name=_('PoE')),
|
|
FieldSet('poe_mode', 'poe_type', name=_('PoE')),
|
|
|
- FieldSet('mode', 'vlan_group', 'untagged_vlan', 'tagged_vlans', name=_('802.1Q Switching')),
|
|
|
|
|
|
|
+ FieldSet('mode', 'vlan_group', 'untagged_vlan', 'tagged_vlans', 'vlan_translation_policy', name=_('802.1Q Switching')),
|
|
|
FieldSet(
|
|
FieldSet(
|
|
|
'rf_role', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'wireless_lan_group', 'wireless_lans',
|
|
'rf_role', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'wireless_lan_group', 'wireless_lans',
|
|
|
name=_('Wireless')
|
|
name=_('Wireless')
|
|
@@ -1404,7 +1409,7 @@ class InterfaceForm(InterfaceCommonForm, ModularDeviceComponentForm):
|
|
|
'device', 'module', 'vdcs', 'name', 'label', 'type', 'speed', 'duplex', 'enabled', 'parent', 'bridge', 'lag',
|
|
'device', 'module', 'vdcs', 'name', 'label', 'type', 'speed', 'duplex', 'enabled', 'parent', 'bridge', 'lag',
|
|
|
'mac_address', 'wwn', 'mtu', 'mgmt_only', 'mark_connected', 'description', 'poe_mode', 'poe_type', 'mode',
|
|
'mac_address', 'wwn', 'mtu', 'mgmt_only', 'mark_connected', 'description', 'poe_mode', 'poe_type', 'mode',
|
|
|
'rf_role', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'tx_power', 'wireless_lans',
|
|
'rf_role', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'tx_power', 'wireless_lans',
|
|
|
- 'untagged_vlan', 'tagged_vlans', 'vrf', 'tags',
|
|
|
|
|
|
|
+ 'untagged_vlan', 'tagged_vlans', 'vrf', 'tags', 'vlan_translation_policy',
|
|
|
]
|
|
]
|
|
|
widgets = {
|
|
widgets = {
|
|
|
'speed': NumberWithOptions(
|
|
'speed': NumberWithOptions(
|