Add Device addresses with DNS entries report

This commit is contained in:
Eric A. Miller
2013-11-05 17:51:06 -05:00
parent 62b55f71ca
commit a16f8b4019
6 changed files with 128 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<table class="table table-bordered table-condensed table-striped nd_floatinghead">
<thead>
<tr>
<th class="nd_center-cell">Device</th>
<th class="nd_center-cell">Address</th>
<th class="nd_center-cell">Contact</th>
<th class="nd_center-cell">Location</th>
</tr>
</thead>
</tbody>
[% FOREACH row IN results %]
<tr>
<td class="nd_center-cell"><a href="[% search_device %]&q=[% row.dns || row.ip | uri %]">
[% row.dns || row.name || row.ip | html_entity %]</a>
<td class="nd_center-cell">[% row.alias | html_entity %]</td>
<td class="nd_center-cell">[% row.contact | html_entity %]</td>
<td class="nd_center-cell">[% row.location | html_entity %]</td>
</tr>
[% END %]
</tbody>
</table>

View File

@@ -0,0 +1,12 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Address' 'Contact' 'Location' ]) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.dns || row.name || row.ip) %]
[% mylist.push(row.alias) %]
[% mylist.push(row.contact) %]
[% mylist.push(row.location) %]
[% CSV.dump(mylist) %]
[% END %]