mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 10:58:37 -06:00
Updates forms and filtersets for L2VPN.status
This commit is contained in:
parent
a2f3ad3479
commit
7ca125f35d
@ -298,6 +298,9 @@ class L2VPNFilterSet(NetBoxModelFilterSet, TenancyFilterSet):
|
||||
choices=L2VPNTypeChoices,
|
||||
null_value=None
|
||||
)
|
||||
status = django_filters.MultipleChoiceFilter(
|
||||
choices=L2VPNStatusChoices,
|
||||
)
|
||||
import_target_id = django_filters.ModelMultipleChoiceFilter(
|
||||
field_name='import_targets',
|
||||
queryset=RouteTarget.objects.all(),
|
||||
|
@ -260,6 +260,10 @@ class IPSecProfileBulkEditForm(NetBoxModelBulkEditForm):
|
||||
|
||||
|
||||
class L2VPNBulkEditForm(NetBoxModelBulkEditForm):
|
||||
status = forms.ChoiceField(
|
||||
label=_('Status'),
|
||||
choices=L2VPNStatusChoices,
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
label=_('Type'),
|
||||
choices=add_blank_choice(L2VPNTypeChoices),
|
||||
@ -279,7 +283,7 @@ class L2VPNBulkEditForm(NetBoxModelBulkEditForm):
|
||||
|
||||
model = L2VPN
|
||||
fieldsets = (
|
||||
FieldSet('type', 'tenant', 'description'),
|
||||
FieldSet('status', 'type', 'tenant', 'description'),
|
||||
)
|
||||
nullable_fields = ('tenant', 'description', 'comments')
|
||||
|
||||
|
@ -260,6 +260,11 @@ class L2VPNImportForm(NetBoxModelImportForm):
|
||||
required=False,
|
||||
to_field_name='name',
|
||||
)
|
||||
status = CSVChoiceField(
|
||||
label=_('Status'),
|
||||
choices=L2VPNStatusChoices,
|
||||
help_text=_('Operational status')
|
||||
)
|
||||
type = CSVChoiceField(
|
||||
label=_('Type'),
|
||||
choices=L2VPNTypeChoices,
|
||||
|
@ -210,9 +210,14 @@ class L2VPNFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||
model = L2VPN
|
||||
fieldsets = (
|
||||
FieldSet('q', 'filter_id', 'tag'),
|
||||
FieldSet('type', 'import_target_id', 'export_target_id', name=_('Attributes')),
|
||||
FieldSet('type', 'status', 'import_target_id', 'export_target_id', name=_('Attributes')),
|
||||
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
|
||||
)
|
||||
status = forms.MultipleChoiceField(
|
||||
label=_('Status'),
|
||||
choices=L2VPNStatusChoices,
|
||||
required=False
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
label=_('Type'),
|
||||
choices=add_blank_choice(L2VPNTypeChoices),
|
||||
|
@ -409,7 +409,7 @@ class L2VPNForm(TenancyForm, NetBoxModelForm):
|
||||
comments = CommentField()
|
||||
|
||||
fieldsets = (
|
||||
FieldSet('name', 'slug', 'type', 'identifier', 'description', 'tags', name=_('L2VPN')),
|
||||
FieldSet('name', 'slug', 'type', 'status', 'identifier', 'description', 'tags', name=_('L2VPN')),
|
||||
FieldSet('import_targets', 'export_targets', name=_('Route Targets')),
|
||||
FieldSet('tenant_group', 'tenant', name=_('Tenancy')),
|
||||
)
|
||||
@ -417,8 +417,8 @@ class L2VPNForm(TenancyForm, NetBoxModelForm):
|
||||
class Meta:
|
||||
model = L2VPN
|
||||
fields = (
|
||||
'name', 'slug', 'type', 'identifier', 'import_targets', 'export_targets', 'tenant', 'description',
|
||||
'comments', 'tags'
|
||||
'name', 'slug', 'type', 'status', 'identifier', 'import_targets', 'export_targets', 'tenant',
|
||||
'description', 'comments', 'tags'
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user