mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 17:08:41 -06:00
Added Cluster category and cluster, cluster_group for VLAN Group filters.
This commit is contained in:
parent
4b91e79d1e
commit
dffd52d6b0
@ -10,7 +10,7 @@ from tenancy.forms import TenancyFilterForm
|
|||||||
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, add_blank_choice
|
from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, add_blank_choice
|
||||||
from utilities.forms.fields import DynamicModelChoiceField, DynamicModelMultipleChoiceField, TagFilterField
|
from utilities.forms.fields import DynamicModelChoiceField, DynamicModelMultipleChoiceField, TagFilterField
|
||||||
from utilities.forms.rendering import FieldSet
|
from utilities.forms.rendering import FieldSet
|
||||||
from virtualization.models import VirtualMachine
|
from virtualization.models import VirtualMachine, ClusterGroup, Cluster
|
||||||
from vpn.models import L2VPN
|
from vpn.models import L2VPN
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
@ -405,6 +405,7 @@ class VLANGroupFilterForm(NetBoxModelFilterSetForm):
|
|||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id', 'tag'),
|
FieldSet('q', 'filter_id', 'tag'),
|
||||||
FieldSet('region', 'sitegroup', 'site', 'location', 'rack', name=_('Location')),
|
FieldSet('region', 'sitegroup', 'site', 'location', 'rack', name=_('Location')),
|
||||||
|
FieldSet('cluster_group', 'cluster', name=_('Cluster')),
|
||||||
FieldSet('min_vid', 'max_vid', name=_('VLAN ID')),
|
FieldSet('min_vid', 'max_vid', name=_('VLAN ID')),
|
||||||
)
|
)
|
||||||
model = VLANGroup
|
model = VLANGroup
|
||||||
@ -445,6 +446,17 @@ class VLANGroupFilterForm(NetBoxModelFilterSetForm):
|
|||||||
max_value=VLAN_VID_MAX,
|
max_value=VLAN_VID_MAX,
|
||||||
label=_('Maximum VID')
|
label=_('Maximum VID')
|
||||||
)
|
)
|
||||||
|
cluster = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=Cluster.objects.all(),
|
||||||
|
required=False,
|
||||||
|
label=_('Cluster')
|
||||||
|
)
|
||||||
|
cluster_group = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=ClusterGroup.objects.all(),
|
||||||
|
required=False,
|
||||||
|
label=_('Cluster group')
|
||||||
|
)
|
||||||
|
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user