custom reports returning array columns will be split over lines
This commit is contained in:
@@ -265,7 +265,7 @@ system_reports:
|
|||||||
- { count: 'Instances' }
|
- { count: 'Instances' }
|
||||||
- { seen: 'Where Seen' }
|
- { seen: 'Where Seen' }
|
||||||
query: |
|
query: |
|
||||||
SELECT subnet, count(subnet), array_to_string(array_agg(host(alias)::text || ' on ' || host(ip)::text), ', ') AS seen
|
SELECT subnet, count(subnet), array_agg(host(alias)::text || ' on ' || host(ip)::text) AS seen
|
||||||
FROM device_ip
|
FROM device_ip
|
||||||
WHERE ip <> alias
|
WHERE ip <> alias
|
||||||
AND (masklen(subnet) <> 32 AND masklen(subnet) <> 128)
|
AND (masklen(subnet) <> 32 AND masklen(subnet) <> 128)
|
||||||
|
|||||||
@@ -10,13 +10,16 @@
|
|||||||
[% FOREACH row IN results %]
|
[% FOREACH row IN results %]
|
||||||
<tr>
|
<tr>
|
||||||
[% FOREACH col IN columns %]
|
[% FOREACH col IN columns %]
|
||||||
[% IF column_options.$col._searchable %]
|
<td>
|
||||||
<td>
|
[% FOREACH record IN row.item(col) %]
|
||||||
<a href="[% uri_for('/search') | none %]?q=[% row.item(col) | uri %]">[% row.item(col) | html_entity %]</a>
|
[% IF column_options.$col._searchable %]
|
||||||
</td>
|
<a href="[% uri_for('/search') | none %]?q=[% record | uri %]">[% record | html_entity %]</a>
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
<td>[% row.item(col) | html_entity %]</td>
|
[% record | html_entity %]
|
||||||
|
[% END %]
|
||||||
|
[% '<br />' IF loop.size > 1 %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
</td>
|
||||||
[% END %]
|
[% END %]
|
||||||
</tr>
|
</tr>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|||||||
Reference in New Issue
Block a user