mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-21 03:27:21 -06:00
Closes #7551: Add UI field to filter interfaces by kind
This commit is contained in:
parent
eb4b4a6c8d
commit
73f2f9fc63
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
### Enhancements
|
### Enhancements
|
||||||
|
|
||||||
|
* [#7551](https://github.com/netbox-community/netbox/issues/7551) - Add UI field to filter interfaces by kind
|
||||||
* [#7561](https://github.com/netbox-community/netbox/issues/7561) - Add a utilization column to the IP ranges table
|
* [#7561](https://github.com/netbox-community/netbox/issues/7561) - Add a utilization column to the IP ranges table
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
@ -685,6 +685,18 @@ class PowerOutletFeedLegChoices(ChoiceSet):
|
|||||||
# Interfaces
|
# Interfaces
|
||||||
#
|
#
|
||||||
|
|
||||||
|
class InterfaceKindChoices(ChoiceSet):
|
||||||
|
KIND_PHYSICAL = 'physical'
|
||||||
|
KIND_VIRTUAL = 'virtual'
|
||||||
|
KIND_WIRELESS = 'wireless'
|
||||||
|
|
||||||
|
CHOICES = (
|
||||||
|
(KIND_PHYSICAL, 'Physical'),
|
||||||
|
(KIND_VIRTUAL, 'Virtual'),
|
||||||
|
(KIND_WIRELESS, 'Wireless'),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class InterfaceTypeChoices(ChoiceSet):
|
class InterfaceTypeChoices(ChoiceSet):
|
||||||
|
|
||||||
# Virtual
|
# Virtual
|
||||||
|
@ -957,9 +957,14 @@ class InterfaceFilterForm(DeviceComponentFilterForm):
|
|||||||
model = Interface
|
model = Interface
|
||||||
field_groups = [
|
field_groups = [
|
||||||
['q', 'tag'],
|
['q', 'tag'],
|
||||||
['name', 'label', 'type', 'enabled', 'mgmt_only', 'mac_address'],
|
['name', 'label', 'kind', 'type', 'enabled', 'mgmt_only', 'mac_address'],
|
||||||
['region_id', 'site_group_id', 'site_id', 'location_id', 'device_id'],
|
['region_id', 'site_group_id', 'site_id', 'location_id', 'device_id'],
|
||||||
]
|
]
|
||||||
|
kind = forms.MultipleChoiceField(
|
||||||
|
choices=InterfaceKindChoices,
|
||||||
|
required=False,
|
||||||
|
widget=StaticSelectMultiple()
|
||||||
|
)
|
||||||
type = forms.MultipleChoiceField(
|
type = forms.MultipleChoiceField(
|
||||||
choices=InterfaceTypeChoices,
|
choices=InterfaceTypeChoices,
|
||||||
required=False,
|
required=False,
|
||||||
|
Loading…
Reference in New Issue
Block a user