mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-18 01:32:17 -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:
@@ -11,6 +11,7 @@ class AggregateIndex(SearchIndex):
|
||||
('date_added', 2000),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('rir', 'tenant', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -20,6 +21,7 @@ class ASNIndex(SearchIndex):
|
||||
('asn', 100),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('rir', 'tenant', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -28,6 +30,7 @@ class ASNRangeIndex(SearchIndex):
|
||||
fields = (
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('rir', 'tenant', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -39,6 +42,7 @@ class FHRPGroupIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('protocol', 'auth_type', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -50,6 +54,7 @@ class IPAddressIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('vrf', 'tenant', 'status', 'role', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -61,6 +66,7 @@ class IPRangeIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('vrf', 'tenant', 'status', 'role', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -72,6 +78,7 @@ class L2VPNIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('type', 'identifier', 'tenant', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -82,6 +89,7 @@ class PrefixIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('site', 'vrf', 'tenant', 'vlan', 'status', 'role', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -92,6 +100,7 @@ class RIRIndex(SearchIndex):
|
||||
('slug', 110),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('description',)
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -102,6 +111,7 @@ class RoleIndex(SearchIndex):
|
||||
('slug', 110),
|
||||
('description', 500),
|
||||
)
|
||||
display_attrs = ('description',)
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -112,6 +122,7 @@ class RouteTargetIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('tenant', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -122,6 +133,7 @@ class ServiceIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('device', 'virtual_machine', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -132,6 +144,7 @@ class ServiceTemplateIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('description',)
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -143,6 +156,7 @@ class VLANIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('site', 'group', 'tenant', 'status', 'role', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -154,6 +168,7 @@ class VLANGroupIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('max_vid', 2000),
|
||||
)
|
||||
display_attrs = ('scope_type', 'min_vid', 'max_vid', 'description')
|
||||
|
||||
|
||||
@register_search
|
||||
@@ -165,3 +180,4 @@ class VRFIndex(SearchIndex):
|
||||
('description', 500),
|
||||
('comments', 5000),
|
||||
)
|
||||
display_attrs = ('rd', 'tenant', 'description')
|
||||
|
||||
Reference in New Issue
Block a user