|
|
@@ -18,7 +18,7 @@ from extras.forms import (
|
|
|
)
|
|
|
from extras.models import Tag
|
|
|
from ipam.constants import BGP_ASN_MAX, BGP_ASN_MIN
|
|
|
-from ipam.models import IPAddress, VLAN
|
|
|
+from ipam.models import IPAddress, VLAN, VLANGroup
|
|
|
from tenancy.forms import TenancyFilterForm, TenancyForm
|
|
|
from tenancy.models import Tenant
|
|
|
from utilities.forms import (
|
|
|
@@ -3109,15 +3109,26 @@ class InterfaceForm(BootstrapMixin, InterfaceCommonForm, CustomFieldModelForm):
|
|
|
'type': 'lag',
|
|
|
}
|
|
|
)
|
|
|
+ vlan_group = DynamicModelChoiceField(
|
|
|
+ queryset=VLANGroup.objects.all(),
|
|
|
+ required=False,
|
|
|
+ label='VLAN group'
|
|
|
+ )
|
|
|
untagged_vlan = DynamicModelChoiceField(
|
|
|
queryset=VLAN.objects.all(),
|
|
|
required=False,
|
|
|
- label='Untagged VLAN'
|
|
|
+ label='Untagged VLAN',
|
|
|
+ query_params={
|
|
|
+ 'group_id': '$vlan_group',
|
|
|
+ }
|
|
|
)
|
|
|
tagged_vlans = DynamicModelMultipleChoiceField(
|
|
|
queryset=VLAN.objects.all(),
|
|
|
required=False,
|
|
|
- label='Tagged VLANs'
|
|
|
+ label='Tagged VLANs',
|
|
|
+ query_params={
|
|
|
+ 'group_id': '$vlan_group',
|
|
|
+ }
|
|
|
)
|
|
|
tags = DynamicModelMultipleChoiceField(
|
|
|
queryset=Tag.objects.all(),
|