Skip to content

Commit 6135fb8

Browse files
pheusjeremystretch
authored andcommitted
feat(vpn): Add search index for TunnelGroup
Introduces `TunnelGroupIndex` for enabling search functionality on Tunnel Groups. Includes searchable fields for `name` and `description` with respective weights and display attributes. Closes #20237
1 parent ea50786 commit 6135fb8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

netbox/vpn/search.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ class TunnelIndex(SearchIndex):
1414
display_attrs = ('group', 'status', 'encapsulation', 'tenant', 'tunnel_id', 'description')
1515

1616

17+
@register_search
18+
class TunnelGroupIndex(SearchIndex):
19+
model = models.TunnelGroup
20+
fields = (
21+
('name', 100),
22+
('slug', 110),
23+
('description', 500),
24+
)
25+
display_attrs = ('description',)
26+
27+
1728
@register_search
1829
class IKEProposalIndex(SearchIndex):
1930
model = models.IKEProposal

0 commit comments

Comments
 (0)