[#70] SSID Search (port)

This commit is contained in:
Eric A. Miller
2014-02-15 23:25:07 -05:00
parent ad8bcc3dfc
commit adf95689f6
8 changed files with 220 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
[% USE Number.Format %]
[% IF results.first.device.ip %]
[% row = results.reset %]
<table class="table table-bordered table-condensed table-striped nd_floatinghead">
<thead>
<tr>
<th>Device (Port)</th>
<th>Broadcast</th>
<th>Model</th>
<th>SSID</th>
<th>Vendor</th>
</tr>
</thead>
</tbody>
[% WHILE (row = results.next) %]
<tr>
<td>
<a class="nd_linkcell"
href="[% device_ports %]&q=[% row.port.ip | uri %]&f=[% row.port.port | uri %]&c_nodes=on&n_ssid=on">
[% row.device.dns || row.device.name || row.device.ip | html_entity %] ( [% row.port.port | html_entity %] )</a>
</td>
<td>[% row.broadcast ? 'Yes' : 'No' %]</td>
<td>[% row.device.model | html_entity %]</td>
<td>[% row.ssid | html_entity %]</td>
<td>[% row.device.vendor | html_entity %]</td>
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
[% row = results.reset %]
<table class="table table-bordered table-condensed table-striped nd_floatinghead">
<thead>
<tr>
<th class="nd_center-cell">SSID</th>
<th class="nd_center-cell">Broadcast</th>
<th class="nd_center-cell">Count</th>
</tr>
</thead>
</tbody>
[% WHILE (row = results.next) %]
<tr>
<td>
<a class="nd_linkcell"
href="[% uri_for('/report/portssid') %]?ssid=[% row.ssid | uri %]">
[% row.ssid | html %]</a>
</td>
<td class="nd_center-cell">[% row.broadcast ? 'Yes' : 'No' %]</td>
<td class="nd_center-cell">[% row.count | format_number %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]

View File

@@ -0,0 +1,28 @@
[% USE CSV -%]
[% IF results.first.ip %]
[% row = results.reset %]
[% CSV.dump(['Device' 'Port' 'Name' 'Broadcast' 'Model' 'SSID' 'Vendor']) %]
[% WHILE (row = results.next) %]
[% mylist = [] %]
[% device = row.device.dns || row.device.name || row.device.ip %]
[% broadcast = row.broadcast ? 'Yes' : 'No' %]
[% FOREACH col IN [ device row.port.port row.device.name broadcast row.device.model row.ssid row.device.vendor ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]
[% ELSE %]
[% row = results.reset %]
[% CSV.dump(['SSID' 'Count']) %]
[% WHILE (row = results.next) %]
[% mylist = [] %]
[% FOREACH col IN [ row.ssid row.count ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]
[% END %]