add csv download option to device, port, and vlan search pages

This commit is contained in:
Eric A. Miller
2013-09-18 23:32:57 -04:00
parent d2b39a3f0e
commit 99ada1132c
10 changed files with 173 additions and 18 deletions

View File

@@ -0,0 +1,12 @@
[% USE CSV -%]
[% CSV.dump([ 'Vlan' 'Device' 'Description' 'Model' 'OS' 'Vendor' ]) %]
[% WHILE (row = results.next) %]
[% mylist = [] %]
[% device = row.dns || row.ip %]
[% FOREACH col IN [ row.vlan.vlan device row.vlan.description row.model row.os row.vendor ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]