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([ 'Description' 'Port' 'Name' 'Vlan' ]) %]
[% WHILE (row = results.next) %]
[% mylist = [] %]
[% myport = "$row.ip [ $row.port ] (" _ row.device.dns _ ")" IF row.device.dns %]
[% FOREACH col IN [ row.name myport row.descr row.vlan ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]