mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 11:56:25 -06:00
Remove mac_address filter fields and add table columns for device/vm
This commit is contained in:
parent
03bc2f3a32
commit
eec59cfd61
@ -1344,7 +1344,7 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||
fieldsets = (
|
||||
FieldSet('q', 'filter_id', 'tag'),
|
||||
FieldSet('name', 'label', 'kind', 'type', 'speed', 'duplex', 'enabled', 'mgmt_only', name=_('Attributes')),
|
||||
FieldSet('vrf_id', 'l2vpn_id', 'mac_address', 'wwn', name=_('Addressing')),
|
||||
FieldSet('vrf_id', 'l2vpn_id', 'wwn', name=_('Addressing')),
|
||||
FieldSet('poe_mode', 'poe_type', name=_('PoE')),
|
||||
FieldSet('rf_role', 'rf_channel', 'rf_channel_width', 'tx_power', name=_('Wireless')),
|
||||
FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')),
|
||||
@ -1399,10 +1399,10 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
mac_address = forms.CharField(
|
||||
required=False,
|
||||
label=_('MAC address')
|
||||
)
|
||||
# mac_address = forms.CharField(
|
||||
# required=False,
|
||||
# label=_('MAC address')
|
||||
# )
|
||||
wwn = forms.CharField(
|
||||
required=False,
|
||||
label=_('WWN')
|
||||
|
@ -608,14 +608,16 @@ class MACAddressTable(NetBoxTable):
|
||||
verbose_name=_('Primary MAC'),
|
||||
false_mark=None
|
||||
)
|
||||
# interface = tables.Column(
|
||||
# verbose_name=_('Interface'),
|
||||
# linkify=True
|
||||
# )
|
||||
# vm_interface = tables.Column(
|
||||
# verbose_name=_('VM Interface'),
|
||||
# linkify=True
|
||||
# )
|
||||
assigned_device = tables.Column(
|
||||
accessor='assigned_object__device',
|
||||
verbose_name=_('Device'),
|
||||
linkify=True
|
||||
)
|
||||
assigned_vm = tables.Column(
|
||||
accessor='assigned_object__virtual_machine',
|
||||
verbose_name=_('Virtual Machine'),
|
||||
linkify=True
|
||||
)
|
||||
tags = columns.TagColumn(
|
||||
url_name='dcim:macaddress_list'
|
||||
)
|
||||
@ -623,7 +625,8 @@ class MACAddressTable(NetBoxTable):
|
||||
class Meta(DeviceComponentTable.Meta):
|
||||
model = models.MACAddress
|
||||
fields = (
|
||||
'pk', 'id', 'mac_address', 'assigned_object', 'created', 'last_updated', 'is_primary'
|
||||
'pk', 'id', 'mac_address', 'assigned_object', 'created', 'last_updated', 'is_primary',
|
||||
'assigned_device', 'assigned_vm',
|
||||
)
|
||||
default_columns = ('pk', 'mac_address', 'assigned_object', 'is_primary')
|
||||
|
||||
|
@ -195,7 +195,7 @@ class VMInterfaceFilterForm(NetBoxModelFilterSetForm):
|
||||
fieldsets = (
|
||||
FieldSet('q', 'filter_id', 'tag'),
|
||||
FieldSet('cluster_id', 'virtual_machine_id', name=_('Virtual Machine')),
|
||||
FieldSet('enabled', 'mac_address', 'vrf_id', 'l2vpn_id', name=_('Attributes')),
|
||||
FieldSet('enabled', 'vrf_id', 'l2vpn_id', name=_('Attributes')),
|
||||
)
|
||||
selector_fields = ('filter_id', 'q', 'virtual_machine_id')
|
||||
cluster_id = DynamicModelMultipleChoiceField(
|
||||
@ -218,10 +218,10 @@ class VMInterfaceFilterForm(NetBoxModelFilterSetForm):
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
mac_address = forms.CharField(
|
||||
required=False,
|
||||
label=_('MAC address')
|
||||
)
|
||||
# mac_address = forms.CharField(
|
||||
# required=False,
|
||||
# label=_('MAC address')
|
||||
# )
|
||||
vrf_id = DynamicModelMultipleChoiceField(
|
||||
queryset=VRF.objects.all(),
|
||||
required=False,
|
||||
|
Loading…
Reference in New Issue
Block a user