From d26980a4a34696a3123d97545942d5668f7b6162 Mon Sep 17 00:00:00 2001 From: Julio-Oliveira-Encora Date: Mon, 13 May 2024 15:39:42 -0300 Subject: [PATCH] Added Cluster category and cluster, cluster_group for VLAN Group filters. --- netbox/ipam/forms/filtersets.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/netbox/ipam/forms/filtersets.py b/netbox/ipam/forms/filtersets.py index 6610bcaf3cc..807205aef39 100644 --- a/netbox/ipam/forms/filtersets.py +++ b/netbox/ipam/forms/filtersets.py @@ -10,7 +10,7 @@ from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, add_blank_choice from utilities.forms.fields import DynamicModelChoiceField, DynamicModelMultipleChoiceField, TagFilterField from utilities.forms.rendering import FieldSet -from virtualization.models import VirtualMachine +from virtualization.models import VirtualMachine, ClusterGroup, Cluster from vpn.models import L2VPN __all__ = ( @@ -405,6 +405,7 @@ class VLANGroupFilterForm(NetBoxModelFilterSetForm): fieldsets = ( FieldSet('q', 'filter_id', 'tag'), FieldSet('region', 'sitegroup', 'site', 'location', 'rack', name=_('Location')), + FieldSet('cluster_group', 'cluster', name=_('Cluster')), FieldSet('min_vid', 'max_vid', name=_('VLAN ID')), ) model = VLANGroup @@ -445,6 +446,17 @@ class VLANGroupFilterForm(NetBoxModelFilterSetForm): max_value=VLAN_VID_MAX, 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)