mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-22 05:12:22 -06:00
* WIP * Add display_attrs for all indexers * Linkify object attributes * Clean up prefetch logic * Use tooltips for display attributes * Simplify template code * Introduce get_indexer() utility function * Add to examples in docs * Use tooltips to display long strings
This commit is contained in:
@@ -10,6 +10,7 @@ class CableIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('type', 'status', 'tenant', 'label', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -21,6 +22,7 @@ class ConsolePortIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('speed', 2000),
|
||||
)
|
||||
display_attrs = ('device', 'label', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -32,6 +34,7 @@ class ConsoleServerPortIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('speed', 2000),
|
||||
)
|
||||
display_attrs = ('device', 'label', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -44,6 +47,9 @@ class DeviceIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = (
|
||||
'site', 'location', 'rack', 'device_type', 'role', 'tenant', 'platform', 'serial', 'asset_tag', 'description',
|
||||
)
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -54,6 +60,7 @@ class DeviceBayIndex(SearchIndex):
|
||||
('label', 200),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('device', 'label', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -64,6 +71,7 @@ class DeviceRoleIndex(SearchIndex):
|
||||
('slug', 110),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('description',)
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -75,6 +83,7 @@ class DeviceTypeIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('manufacturer', 'part_number', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -85,6 +94,7 @@ class FrontPortIndex(SearchIndex):
|
||||
('label', 200),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('device', 'label', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -99,6 +109,7 @@ class InterfaceIndex(SearchIndex):
|
||||
('mtu', 2000),
|
||||
('speed', 2000),
|
||||
)
|
||||
display_attrs = ('device', 'label', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -112,6 +123,7 @@ class InventoryItemIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('part_id', 2000),
|
||||
)
|
||||
display_attrs = ('device', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -122,6 +134,7 @@ class LocationIndex(SearchIndex):
|
||||
('slug', 110),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('site', 'status', 'tenant', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -132,6 +145,7 @@ class ManufacturerIndex(SearchIndex):
|
||||
('slug', 110),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('description',)
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -143,6 +157,7 @@ class ModuleIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('device', 'module_bay', 'module_type', 'status', 'serial', 'asset_tag', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -153,6 +168,7 @@ class ModuleBayIndex(SearchIndex):
|
||||
('label', 200),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('device', 'label', 'position', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -164,6 +180,7 @@ class ModuleTypeIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('manufacturer', 'model', 'part_number', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -174,6 +191,7 @@ class PlatformIndex(SearchIndex):
|
||||
('slug', 110),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('manufacturer', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -184,6 +202,7 @@ class PowerFeedIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('power_panel', 'rack', 'status', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -194,6 +213,7 @@ class PowerOutletIndex(SearchIndex):
|
||||
('label', 200),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('device', 'label', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -204,6 +224,7 @@ class PowerPanelIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('site', 'location', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -216,6 +237,7 @@ class PowerPortIndex(SearchIndex):
|
||||
('maximum_draw', 2000),
|
||||
('allocated_draw', 2000),
|
||||
)
|
||||
display_attrs = ('device', 'label', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -229,6 +251,7 @@ class RackIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('site', 'location', 'facility_id', 'tenant', 'status', 'role', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -238,6 +261,7 @@ class RackReservationIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('rack', 'tenant', 'user', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -248,6 +272,7 @@ class RackRoleIndex(SearchIndex):
|
||||
('slug', 110),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('device', 'label', 'description',)
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -258,6 +283,7 @@ class RearPortIndex(SearchIndex):
|
||||
('label', 200),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('device', 'label', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -268,6 +294,7 @@ class RegionIndex(SearchIndex):
|
||||
('slug', 110),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('parent', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -282,6 +309,7 @@ class SiteIndex(SearchIndex):
|
||||
('shipping_address', 2000),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('region', 'group', 'status', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -292,6 +320,7 @@ class SiteGroupIndex(SearchIndex):
|
||||
('slug', 110),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('parent', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -303,6 +332,7 @@ class VirtualChassisIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('master', 'domain', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -314,3 +344,4 @@ class VirtualDeviceContextIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('device', 'status', 'identifier', 'description')
|
||||
|
||||
Reference in New Issue
Block a user