mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-21 11:37:21 -06:00
Closes #7087: Add search/filter forms for all organizational models
This commit is contained in:
parent
e3e005e327
commit
cc0830bf28
@ -8,6 +8,7 @@
|
|||||||
* [#6387](https://github.com/netbox-community/netbox/issues/6387) - Add xDSL interface type
|
* [#6387](https://github.com/netbox-community/netbox/issues/6387) - Add xDSL interface type
|
||||||
* [#6988](https://github.com/netbox-community/netbox/issues/6988) - Order tenants alphabetically without regard to group assignment
|
* [#6988](https://github.com/netbox-community/netbox/issues/6988) - Order tenants alphabetically without regard to group assignment
|
||||||
* [#7032](https://github.com/netbox-community/netbox/issues/7032) - Add URM port types
|
* [#7032](https://github.com/netbox-community/netbox/issues/7032) - Add URM port types
|
||||||
|
* [#7087](https://github.com/netbox-community/netbox/issues/7087) - Add search/filter forms for all organizational models
|
||||||
* [#7208](https://github.com/netbox-community/netbox/issues/7208) - Add navigation breadcrumbs for custom scripts & reports
|
* [#7208](https://github.com/netbox-community/netbox/issues/7208) - Add navigation breadcrumbs for custom scripts & reports
|
||||||
* [#7239](https://github.com/netbox-community/netbox/issues/7239) - Redirect global search to filtered object list when an object type is selected
|
* [#7239](https://github.com/netbox-community/netbox/issues/7239) - Redirect global search to filtered object list when an object type is selected
|
||||||
|
|
||||||
|
@ -266,6 +266,18 @@ class CircuitTypeCSVForm(CustomFieldModelCSVForm):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class CircuitTypeFilterForm(BootstrapMixin, CustomFieldModelFilterForm):
|
||||||
|
model = CircuitType
|
||||||
|
field_groups = [
|
||||||
|
['q'],
|
||||||
|
]
|
||||||
|
q = forms.CharField(
|
||||||
|
required=False,
|
||||||
|
widget=forms.TextInput(attrs={'placeholder': _('All Fields')}),
|
||||||
|
label=_('Search')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Circuits
|
# Circuits
|
||||||
#
|
#
|
||||||
|
@ -144,6 +144,8 @@ class CircuitTypeListView(generic.ObjectListView):
|
|||||||
queryset = CircuitType.objects.annotate(
|
queryset = CircuitType.objects.annotate(
|
||||||
circuit_count=count_related(Circuit, 'type')
|
circuit_count=count_related(Circuit, 'type')
|
||||||
)
|
)
|
||||||
|
filterset = filtersets.CircuitTypeFilterSet
|
||||||
|
filterset_form = forms.CircuitTypeFilterForm
|
||||||
table = tables.CircuitTypeTable
|
table = tables.CircuitTypeTable
|
||||||
|
|
||||||
|
|
||||||
|
@ -696,6 +696,18 @@ class RackRoleBulkEditForm(BootstrapMixin, CustomFieldModelBulkEditForm):
|
|||||||
nullable_fields = ['color', 'description']
|
nullable_fields = ['color', 'description']
|
||||||
|
|
||||||
|
|
||||||
|
class RackRoleFilterForm(BootstrapMixin, CustomFieldModelFilterForm):
|
||||||
|
model = RackRole
|
||||||
|
field_groups = [
|
||||||
|
['q'],
|
||||||
|
]
|
||||||
|
q = forms.CharField(
|
||||||
|
required=False,
|
||||||
|
widget=forms.TextInput(attrs={'placeholder': _('All Fields')}),
|
||||||
|
label=_('Search')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Racks
|
# Racks
|
||||||
#
|
#
|
||||||
@ -1240,6 +1252,18 @@ class ManufacturerBulkEditForm(BootstrapMixin, CustomFieldModelBulkEditForm):
|
|||||||
nullable_fields = ['description']
|
nullable_fields = ['description']
|
||||||
|
|
||||||
|
|
||||||
|
class ManufacturerFilterForm(BootstrapMixin, CustomFieldModelFilterForm):
|
||||||
|
model = Manufacturer
|
||||||
|
field_groups = [
|
||||||
|
['q'],
|
||||||
|
]
|
||||||
|
q = forms.CharField(
|
||||||
|
required=False,
|
||||||
|
widget=forms.TextInput(attrs={'placeholder': _('All Fields')}),
|
||||||
|
label=_('Search')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Device types
|
# Device types
|
||||||
#
|
#
|
||||||
@ -2076,6 +2100,18 @@ class DeviceRoleBulkEditForm(BootstrapMixin, CustomFieldModelBulkEditForm):
|
|||||||
nullable_fields = ['color', 'description']
|
nullable_fields = ['color', 'description']
|
||||||
|
|
||||||
|
|
||||||
|
class DeviceRoleFilterForm(BootstrapMixin, CustomFieldModelFilterForm):
|
||||||
|
model = DeviceRole
|
||||||
|
field_groups = [
|
||||||
|
['q'],
|
||||||
|
]
|
||||||
|
q = forms.CharField(
|
||||||
|
required=False,
|
||||||
|
widget=forms.TextInput(attrs={'placeholder': _('All Fields')}),
|
||||||
|
label=_('Search')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Platforms
|
# Platforms
|
||||||
#
|
#
|
||||||
|
@ -440,6 +440,8 @@ class RackRoleListView(generic.ObjectListView):
|
|||||||
queryset = RackRole.objects.annotate(
|
queryset = RackRole.objects.annotate(
|
||||||
rack_count=count_related(Rack, 'role')
|
rack_count=count_related(Rack, 'role')
|
||||||
)
|
)
|
||||||
|
filterset = filtersets.RackRoleFilterSet
|
||||||
|
filterset_form = forms.RackRoleFilterForm
|
||||||
table = tables.RackRoleTable
|
table = tables.RackRoleTable
|
||||||
|
|
||||||
|
|
||||||
@ -684,6 +686,8 @@ class ManufacturerListView(generic.ObjectListView):
|
|||||||
inventoryitem_count=count_related(InventoryItem, 'manufacturer'),
|
inventoryitem_count=count_related(InventoryItem, 'manufacturer'),
|
||||||
platform_count=count_related(Platform, 'manufacturer')
|
platform_count=count_related(Platform, 'manufacturer')
|
||||||
)
|
)
|
||||||
|
filterset = filtersets.ManufacturerFilterSet
|
||||||
|
filterset_form = forms.ManufacturerFilterForm
|
||||||
table = tables.ManufacturerTable
|
table = tables.ManufacturerTable
|
||||||
|
|
||||||
|
|
||||||
@ -1149,6 +1153,8 @@ class DeviceRoleListView(generic.ObjectListView):
|
|||||||
device_count=count_related(Device, 'device_role'),
|
device_count=count_related(Device, 'device_role'),
|
||||||
vm_count=count_related(VirtualMachine, 'role')
|
vm_count=count_related(VirtualMachine, 'role')
|
||||||
)
|
)
|
||||||
|
filterset = filtersets.DeviceRoleFilterSet
|
||||||
|
filterset_form = forms.DeviceRoleFilterForm
|
||||||
table = tables.DeviceRoleTable
|
table = tables.DeviceRoleTable
|
||||||
|
|
||||||
|
|
||||||
|
@ -256,7 +256,17 @@ class RIRBulkEditForm(BootstrapMixin, CustomFieldModelBulkEditForm):
|
|||||||
nullable_fields = ['is_private', 'description']
|
nullable_fields = ['is_private', 'description']
|
||||||
|
|
||||||
|
|
||||||
class RIRFilterForm(BootstrapMixin, forms.Form):
|
class RIRFilterForm(BootstrapMixin, CustomFieldModelFilterForm):
|
||||||
|
model = RIR
|
||||||
|
field_groups = [
|
||||||
|
['q'],
|
||||||
|
['is_private'],
|
||||||
|
]
|
||||||
|
q = forms.CharField(
|
||||||
|
required=False,
|
||||||
|
widget=forms.TextInput(attrs={'placeholder': _('All Fields')}),
|
||||||
|
label=_('Search')
|
||||||
|
)
|
||||||
is_private = forms.NullBooleanField(
|
is_private = forms.NullBooleanField(
|
||||||
required=False,
|
required=False,
|
||||||
label=_('Private'),
|
label=_('Private'),
|
||||||
@ -413,6 +423,18 @@ class RoleBulkEditForm(BootstrapMixin, CustomFieldModelBulkEditForm):
|
|||||||
nullable_fields = ['description']
|
nullable_fields = ['description']
|
||||||
|
|
||||||
|
|
||||||
|
class RoleFilterForm(BootstrapMixin, CustomFieldModelFilterForm):
|
||||||
|
model = Role
|
||||||
|
field_groups = [
|
||||||
|
['q'],
|
||||||
|
]
|
||||||
|
q = forms.CharField(
|
||||||
|
required=False,
|
||||||
|
widget=forms.TextInput(attrs={'placeholder': _('All Fields')}),
|
||||||
|
label=_('Search')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Prefixes
|
# Prefixes
|
||||||
#
|
#
|
||||||
@ -1460,11 +1482,12 @@ class VLANGroupBulkEditForm(BootstrapMixin, CustomFieldModelBulkEditForm):
|
|||||||
nullable_fields = ['site', 'description']
|
nullable_fields = ['site', 'description']
|
||||||
|
|
||||||
|
|
||||||
class VLANGroupFilterForm(BootstrapMixin, forms.Form):
|
class VLANGroupFilterForm(BootstrapMixin, CustomFieldModelFilterForm):
|
||||||
field_groups = [
|
field_groups = [
|
||||||
['q'],
|
['q'],
|
||||||
['region', 'sitegroup', 'site', 'location', 'rack']
|
['region', 'sitegroup', 'site', 'location', 'rack']
|
||||||
]
|
]
|
||||||
|
model = VLANGroup
|
||||||
q = forms.CharField(
|
q = forms.CharField(
|
||||||
required=False,
|
required=False,
|
||||||
widget=forms.TextInput(attrs={'placeholder': _('All Fields')}),
|
widget=forms.TextInput(attrs={'placeholder': _('All Fields')}),
|
||||||
|
@ -283,6 +283,8 @@ class RoleListView(generic.ObjectListView):
|
|||||||
prefix_count=count_related(Prefix, 'role'),
|
prefix_count=count_related(Prefix, 'role'),
|
||||||
vlan_count=count_related(VLAN, 'role')
|
vlan_count=count_related(VLAN, 'role')
|
||||||
)
|
)
|
||||||
|
filterset = filtersets.RoleFilterSet
|
||||||
|
filterset_form = forms.RoleFilterForm
|
||||||
table = tables.RoleTable
|
table = tables.RoleTable
|
||||||
|
|
||||||
|
|
||||||
|
BIN
netbox/project-static/dist/rack_elevation.css
vendored
BIN
netbox/project-static/dist/rack_elevation.css
vendored
Binary file not shown.
@ -61,6 +61,18 @@ class ClusterTypeBulkEditForm(BootstrapMixin, CustomFieldModelBulkEditForm):
|
|||||||
nullable_fields = ['description']
|
nullable_fields = ['description']
|
||||||
|
|
||||||
|
|
||||||
|
class ClusterTypeFilterForm(BootstrapMixin, CustomFieldModelFilterForm):
|
||||||
|
model = ClusterType
|
||||||
|
field_groups = [
|
||||||
|
['q'],
|
||||||
|
]
|
||||||
|
q = forms.CharField(
|
||||||
|
required=False,
|
||||||
|
widget=forms.TextInput(attrs={'placeholder': _('All Fields')}),
|
||||||
|
label=_('Search')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Cluster groups
|
# Cluster groups
|
||||||
#
|
#
|
||||||
@ -97,6 +109,18 @@ class ClusterGroupBulkEditForm(BootstrapMixin, CustomFieldModelBulkEditForm):
|
|||||||
nullable_fields = ['description']
|
nullable_fields = ['description']
|
||||||
|
|
||||||
|
|
||||||
|
class ClusterGroupFilterForm(BootstrapMixin, CustomFieldModelFilterForm):
|
||||||
|
model = ClusterGroup
|
||||||
|
field_groups = [
|
||||||
|
['q'],
|
||||||
|
]
|
||||||
|
q = forms.CharField(
|
||||||
|
required=False,
|
||||||
|
widget=forms.TextInput(attrs={'placeholder': _('All Fields')}),
|
||||||
|
label=_('Search')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Clusters
|
# Clusters
|
||||||
#
|
#
|
||||||
|
@ -24,6 +24,8 @@ class ClusterTypeListView(generic.ObjectListView):
|
|||||||
queryset = ClusterType.objects.annotate(
|
queryset = ClusterType.objects.annotate(
|
||||||
cluster_count=count_related(Cluster, 'type')
|
cluster_count=count_related(Cluster, 'type')
|
||||||
)
|
)
|
||||||
|
filterset = filtersets.ClusterTypeFilterSet
|
||||||
|
filterset_form = forms.ClusterTypeFilterForm
|
||||||
table = tables.ClusterTypeTable
|
table = tables.ClusterTypeTable
|
||||||
|
|
||||||
|
|
||||||
@ -86,6 +88,8 @@ class ClusterGroupListView(generic.ObjectListView):
|
|||||||
queryset = ClusterGroup.objects.annotate(
|
queryset = ClusterGroup.objects.annotate(
|
||||||
cluster_count=count_related(Cluster, 'group')
|
cluster_count=count_related(Cluster, 'group')
|
||||||
)
|
)
|
||||||
|
filterset = filtersets.ClusterGroupFilterSet
|
||||||
|
filterset_form = forms.ClusterGroupFilterForm
|
||||||
table = tables.ClusterGroupTable
|
table = tables.ClusterGroupTable
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user