Add SearchIndex and adjust indexable fields for Interface and VMInterface

This commit is contained in:
Brian Tiemann 2024-11-05 14:42:22 -05:00
parent 6d604e2609
commit eff2225464
2 changed files with 12 additions and 4 deletions

View File

@ -98,19 +98,28 @@ class FrontPortIndex(SearchIndex):
display_attrs = ('device', 'label', 'type', 'description')
@register_search
class MACAddressIndex(SearchIndex):
model = models.MACAddress
fields = (
('mac_address', 100),
('description', 500),
)
display_attrs = ('mac_address', 'interface')
@register_search
class InterfaceIndex(SearchIndex):
model = models.Interface
fields = (
('name', 100),
('label', 200),
('mac_address', 300),
('wwn', 300),
('description', 500),
('mtu', 2000),
('speed', 2000),
)
display_attrs = ('device', 'label', 'type', 'mac_address', 'wwn', 'description')
display_attrs = ('device', 'label', 'type', 'wwn', 'description')
@register_search

View File

@ -52,11 +52,10 @@ class VMInterfaceIndex(SearchIndex):
model = models.VMInterface
fields = (
('name', 100),
('mac_address', 300),
('description', 500),
('mtu', 2000),
)
display_attrs = ('virtual_machine', 'mac_address', 'description')
display_attrs = ('virtual_machine', 'description')
@register_search