mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-20 12:22:23 -06:00
Closes #14503: Include additional display attributes for search indexers
This commit is contained in:
@@ -20,3 +20,4 @@ class DataFileIndex(SearchIndex):
|
|||||||
fields = (
|
fields = (
|
||||||
('path', 200),
|
('path', 200),
|
||||||
)
|
)
|
||||||
|
display_attrs = ('source',)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class ConsolePortIndex(SearchIndex):
|
|||||||
('description', 500),
|
('description', 500),
|
||||||
('speed', 2000),
|
('speed', 2000),
|
||||||
)
|
)
|
||||||
display_attrs = ('device', 'label', 'description')
|
display_attrs = ('device', 'label', 'type', 'description')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -34,7 +34,7 @@ class ConsoleServerPortIndex(SearchIndex):
|
|||||||
('description', 500),
|
('description', 500),
|
||||||
('speed', 2000),
|
('speed', 2000),
|
||||||
)
|
)
|
||||||
display_attrs = ('device', 'label', 'description')
|
display_attrs = ('device', 'label', 'type', 'description')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -48,7 +48,8 @@ class DeviceIndex(SearchIndex):
|
|||||||
('comments', 5000),
|
('comments', 5000),
|
||||||
)
|
)
|
||||||
display_attrs = (
|
display_attrs = (
|
||||||
'site', 'location', 'rack', 'device_type', 'role', 'tenant', 'platform', 'serial', 'asset_tag', 'description',
|
'site', 'location', 'rack', 'status', 'device_type', 'role', 'tenant', 'platform', 'serial', 'asset_tag',
|
||||||
|
'description',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -94,7 +95,7 @@ class FrontPortIndex(SearchIndex):
|
|||||||
('label', 200),
|
('label', 200),
|
||||||
('description', 500),
|
('description', 500),
|
||||||
)
|
)
|
||||||
display_attrs = ('device', 'label', 'description')
|
display_attrs = ('device', 'label', 'type', 'description')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -109,7 +110,7 @@ class InterfaceIndex(SearchIndex):
|
|||||||
('mtu', 2000),
|
('mtu', 2000),
|
||||||
('speed', 2000),
|
('speed', 2000),
|
||||||
)
|
)
|
||||||
display_attrs = ('device', 'label', 'description')
|
display_attrs = ('device', 'label', 'type', 'mac_address', 'wwn', 'description')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -123,7 +124,7 @@ class InventoryItemIndex(SearchIndex):
|
|||||||
('description', 500),
|
('description', 500),
|
||||||
('part_id', 2000),
|
('part_id', 2000),
|
||||||
)
|
)
|
||||||
display_attrs = ('device', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'description')
|
display_attrs = ('device', 'manufacturer', 'parent', 'part_id', 'serial', 'asset_tag', 'description')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -213,7 +214,7 @@ class PowerOutletIndex(SearchIndex):
|
|||||||
('label', 200),
|
('label', 200),
|
||||||
('description', 500),
|
('description', 500),
|
||||||
)
|
)
|
||||||
display_attrs = ('device', 'label', 'description')
|
display_attrs = ('device', 'label', 'type', 'description')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -237,7 +238,7 @@ class PowerPortIndex(SearchIndex):
|
|||||||
('maximum_draw', 2000),
|
('maximum_draw', 2000),
|
||||||
('allocated_draw', 2000),
|
('allocated_draw', 2000),
|
||||||
)
|
)
|
||||||
display_attrs = ('device', 'label', 'description')
|
display_attrs = ('device', 'label', 'type', 'description')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -251,7 +252,9 @@ class RackIndex(SearchIndex):
|
|||||||
('description', 500),
|
('description', 500),
|
||||||
('comments', 5000),
|
('comments', 5000),
|
||||||
)
|
)
|
||||||
display_attrs = ('site', 'location', 'facility_id', 'tenant', 'status', 'role', 'description')
|
display_attrs = (
|
||||||
|
'site', 'location', 'facility_id', 'tenant', 'status', 'role', 'serial', 'asset_tag', 'description',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -272,7 +275,7 @@ class RackRoleIndex(SearchIndex):
|
|||||||
('slug', 110),
|
('slug', 110),
|
||||||
('description', 500),
|
('description', 500),
|
||||||
)
|
)
|
||||||
display_attrs = ('device', 'label', 'description',)
|
display_attrs = ('description',)
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -283,7 +286,7 @@ class RearPortIndex(SearchIndex):
|
|||||||
('label', 200),
|
('label', 200),
|
||||||
('description', 500),
|
('description', 500),
|
||||||
)
|
)
|
||||||
display_attrs = ('device', 'label', 'description')
|
display_attrs = ('device', 'label', 'type', 'description')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -309,7 +312,7 @@ class SiteIndex(SearchIndex):
|
|||||||
('shipping_address', 2000),
|
('shipping_address', 2000),
|
||||||
('comments', 5000),
|
('comments', 5000),
|
||||||
)
|
)
|
||||||
display_attrs = ('region', 'group', 'status', 'description')
|
display_attrs = ('region', 'group', 'status', 'tenant', 'facility', 'description')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -344,4 +347,4 @@ class VirtualDeviceContextIndex(SearchIndex):
|
|||||||
('description', 500),
|
('description', 500),
|
||||||
('comments', 5000),
|
('comments', 5000),
|
||||||
)
|
)
|
||||||
display_attrs = ('device', 'status', 'identifier', 'description')
|
display_attrs = ('device', 'status', 'identifier', 'tenant', 'description')
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class JournalEntryIndex(SearchIndex):
|
|||||||
('comments', 5000),
|
('comments', 5000),
|
||||||
)
|
)
|
||||||
category = 'Journal'
|
category = 'Journal'
|
||||||
|
display_attrs = ('kind', 'created_by')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -18,3 +19,4 @@ class WebhookEntryIndex(SearchIndex):
|
|||||||
('name', 100),
|
('name', 100),
|
||||||
('description', 500),
|
('description', 500),
|
||||||
)
|
)
|
||||||
|
display_attrs = ('description',)
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class VMInterfaceIndex(SearchIndex):
|
|||||||
('description', 500),
|
('description', 500),
|
||||||
('mtu', 2000),
|
('mtu', 2000),
|
||||||
)
|
)
|
||||||
display_attrs = ('virtual_machine', 'description')
|
display_attrs = ('virtual_machine', 'mac_address', 'description')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
@@ -65,4 +65,4 @@ class VirtualDiskIndex(SearchIndex):
|
|||||||
('name', 100),
|
('name', 100),
|
||||||
('description', 500),
|
('description', 500),
|
||||||
)
|
)
|
||||||
display_attrs = ('virtual_machine', 'description')
|
display_attrs = ('virtual_machine', 'size', 'description')
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class TunnelIndex(SearchIndex):
|
|||||||
('description', 500),
|
('description', 500),
|
||||||
('comments', 5000),
|
('comments', 5000),
|
||||||
)
|
)
|
||||||
display_attrs = ('status', 'encapsulation', 'tenant', 'description')
|
display_attrs = ('group', 'status', 'encapsulation', 'tenant', 'tunnel_id', 'description')
|
||||||
|
|
||||||
|
|
||||||
@register_search
|
@register_search
|
||||||
|
|||||||
Reference in New Issue
Block a user