improve searchable generic report fields (#1133)

* implement links on all v4/v6/mac found in _searchable fields

* word boundaries on matching
This commit is contained in:
Oliver Gorwits
2023-12-07 07:49:18 +00:00
committed by GitHub
parent b85ca1140f
commit bc47b54f67
4 changed files with 51 additions and 4 deletions

View File

@@ -183,7 +183,7 @@ system_reports:
label: 'Blocked - Error-Disabled'
category: Port
columns:
- { ip: Device }
- { ip: Device, _searchable: true }
- { dns: DNS }
- { port: Port }
- { name: Description }
@@ -259,12 +259,12 @@ system_reports:
HAVING count(vlan) > COALESCE(NULLIF(?,''), '1') ::integer
ORDER BY vlans DESC, ip ASC, port ASC
- tag: duplicateprivatenetworks
category: Port
category: IP
label: 'Duplicate Private Networks'
columns:
- { subnet: 'Subnet', _searchable: true }
- { count: 'Instances' }
- { seen: 'Where Seen' }
- { seen: 'Where Seen', _searchable: true }
query: |
SELECT subnet, count(subnet), array_agg(host(alias)::text || ' on ' || host(ip)::text) AS seen
FROM device_ip

View File

@@ -13,7 +13,7 @@
<td>
[% FOREACH record IN row.item(col) %]
[% IF column_options.$col._searchable %]
<a href="[% uri_for('/search') | none %]?q=[% record | uri %]">[% record | html_entity %]</a>
[% record | none %]
[% ELSE %]
[% record | html_entity %]
[% END %]