Search results open the record they found; plugin scaffolder emits a prunable frontend

This commit is contained in:
2026-08-24 14:06:14 -04:00
parent 0398c55fb5
commit ead9fd6b56
9 changed files with 312 additions and 203 deletions

View File

@@ -658,7 +658,10 @@ def _search_subnets(query):
'id': subnet.subnetid,
'title': f'{subnet.name} ({subnet.cidr})',
'subtitle': subnet.description or subnet.subnettype,
'url': f'/network',
# the matched subnet, not the hub: searching an IP
# already identified WHICH subnet, so landing on the
# hub makes the reader find it again by hand
'url': f'/networks/{subnet.subnetid}',
'relevance': 70
})
except ValueError:
@@ -779,7 +782,9 @@ def _search_notifications(query, search_term):
'id': notif.notificationid,
'title': notif.title,
'subtitle': notif.notificationtype.typename if notif.notificationtype else None,
'url': f'/notifications',
# the notification itself, not the list it sits in: the
# `notification-detail` route renders one by id
'url': f'/notifications/{notif.notificationid}',
'relevance': min(int(base_relevance), 100),
'ticketnumber': notif.ticketnumber,
'iscurrent': notif.is_current