add csv download option to device addresses

This commit is contained in:
Eric A. Miller
2013-09-18 23:35:28 -04:00
parent 99ada1132c
commit bb1f842d92
3 changed files with 43 additions and 7 deletions

View File

@@ -1,3 +1,4 @@
[% INCLUDE "download_as.tt" %]
<table class="table table-bordered table-condensed table-striped nd_floatinghead">
<thead>
<tr>

View File

@@ -0,0 +1,11 @@
[% USE CSV -%]
[% CSV.dump([ 'Address' 'DNS' 'Interface' 'Description' 'Prefix' ]) %]
[% WHILE (row = results.next) %]
[% mylist = [] %]
[% FOREACH col IN [ row.alias row.dns row.port row.device_port.name row.subnet ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]