implement first device tab - details

This commit is contained in:
Oliver Gorwits
2012-01-09 00:51:45 +00:00
parent a400312e6b
commit 4e94c248e3
15 changed files with 273 additions and 6 deletions

View File

@@ -0,0 +1,29 @@
<table class="bordered-table condensed-table zebra-striped">
<thead>
<tr>
<th>Device</th>
<th>Contact</th>
<th>Location</th>
<th>System Name</th>
<th>Model</th>
<th>OS Version</th>
<th>Management IP</th>
<th>Serial</th>
</tr>
</thead>
</tbody>
[% WHILE (row = results.next) %]
<tr>
<td><a href="/device?ip=[% row.ip %]">[% row.dns.remove(settings.domain_suffix) %]</a></td>
<td>[% row.contact %]</td>
<td>[% row.location %]</td>
<td>[% row.name %]</td>
<!-- <td>[% row.description.substr(0, 100) %][% ' &hellip;' IF row.description.length > 100 %]</td> -->
<td>[% row.model %]</td>
<td>[% row.os_ver %]</td>
<td>[% row.ip %]</td>
<td>[% row.serial %]</td>
</tr>
[% END %]
</tbody>
</table>

View File

@@ -0,0 +1,70 @@
<table class="bordered-table condensed-table zebra-striped">
<thead>
<tr>
<th>MAC</th>
[% IF params.vendor %]
<th>Vendor</th>
[% END %]
<th>Match</th>
<th>Device or Node</th>
[% IF params.stamps %]
<th>First Seen</th>
<th>Last Seen</th>
[% END %]
</tr>
</thead>
</tbody>
[% WHILE (row = results.next) %]
<tr>
<td><a class="nd_linkcell"
href="/search?[% vars.query_defaults.node %]&q=[% row.mac | uri %]">[% row.mac %]</a></td>
[% IF params.vendor %]
<td>[% row.oui.company %]</td>
[% END %]
<td>IP &rarr; MAC</td>
<td><a href="/search?[% vars.query_defaults.node %]&q=[% row.ip | uri %]">[% row.ip %]</a>
[% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %]
[% ' <span class="label warning">a</span>' IF NOT row.active %]
</td>
[% IF params.stamps %]
<td>[% row.time_first %]</td>
<td>[% row.time_last %]</td>
[% END %]
</tr>
[% FOREACH node IN row.node_sightings(params.archived) %]
<tr>
<td>&nbsp;</td>
[% IF params.vendor %]
<td>&nbsp;</td>
[% END %]
<td>Switch Port</td>
<td><a href="/device?ip=[% node.switch | url %]&port=[% node.port | url %]">[% node.switch %] [ [% node.port %] ]</a>
[% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %]
[% ' <span class="label warning">a</span>' IF NOT node.active %]
</td>
[% IF params.stamps %]
<td>[% node.time_first %]</td>
<td>[% node.time_last %]</td>
[% END %]
</tr>
[% END %]
[% FOREACH nodeip IN row.ip_aliases(params.archived) %]
<tr>
<td>&nbsp;</td>
[% IF params.vendor %]
<td>&nbsp;</td>
[% END %]
<td>MAC &rarr; IP</td>
<td><a href="/search?[% vars.query_defaults.node %]&q=[% nodeip.ip | uri %]">[% nodeip.ip %]</a>
[% ' (' _ nodeip.dns.remove(settings.domain_suffix) _ ')' IF nodeip.dns %]
[% ' <span class="label warning">a</span>' IF NOT nodeip.active %]
</td>
[% IF params.stamps %]
<td>[% nodeip.time_first %]</td>
<td>[% nodeip.time_last %]</td>
[% END %]
</tr>
[% END %]
[% END %]
</tbody>
</table>

View File

@@ -0,0 +1,83 @@
<table class="bordered-table condensed-table zebra-striped">
<thead>
<tr>
<th>MAC</th>
[% IF params.vendor %]
<th>Vendor</th>
[% END %]
<th>Match</th>
<th>Device or Node</th>
[% IF params.stamps %]
<th>First Seen</th>
<th>Last Seen</th>
[% END %]
</tr>
</thead>
</tbody>
[% SET first_row = 1 %]
[% WHILE (row = ips.next) %]
<tr>
<td>
[% IF first_row %]
<a class="nd_linkcell"
href="/search?[% vars.query_defaults.node %]&q=[% row.mac | uri %]">[% row.mac %]</a>
[% ELSE %]
&nbsp;
[% END %]
</a>
[% IF params.vendor %]
<td>
[% IF first_row %]
[% row.oui.company %]
[% ELSE %]
&nbsp;
[% END %]
</td>
[% END %]
<td>MAC &rarr; IP</td>
<td><a href="/search?[% vars.query_defaults.node %]&q=[% row.ip | uri %]">[% row.ip %]</a>
[% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %]
[% ' <span class="label warning">a</span>' IF NOT row.active %]
</td>
[% IF params.stamps %]
<td>[% row.time_first %]</td>
<td>[% row.time_last %]</td>
[% END %]
</tr>
[% SET first_row = 0 %]
[% END %]
[% WHILE (node = sightings.next) %]
<tr>
<td>&nbsp;</td>
[% IF params.vendor %]
<td>&nbsp;</td>
[% END %]
<td>Switch Port</td>
<td><a href="/device?ip=[% node.switch | url %]&port=[% node.port | url %]">[% node.switch %] [ [% node.port %] ]</a>
[% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %]
[% ' <span class="label warning">a</span>' IF NOT node.active %]
</td>
[% IF params.stamps %]
<td>[% node.time_first %]</td>
<td>[% node.time_last %]</td>
[% END %]
</tr>
[% END %]
[% WHILE (port = ports.next) %]
<tr>
<td>&nbsp;</td>
[% IF params.vendor %]
<td>&nbsp;</td>
[% END %]
<td>Switch Port</td>
<td><a href="/device?ip=[% port.ip | url %]&port=[% port.port | url %]">[% port.ip %] [ [% port.port %] ]</a>
[% ' (' _ port.device.dns.remove(settings.domain_suffix) _ ')' IF port.device.dns %]
</td>
[% IF params.stamps %]
<td>[% port.creation %]</td>
<td>[% port.creation %]</td>
[% END %]
</tr>
[% END %]
</tbody>
</table>

View File

@@ -0,0 +1,22 @@
<table class="bordered-table condensed-table zebra-striped">
<thead>
<tr>
<th>Description</th>
<th>Port</th>
<th>Name</th>
<th>Vlan</th>
</tr>
</thead>
</tbody>
[% WHILE (row = results.next) %]
<tr>
<td>[% row.name %]</td>
<td><a href="/device?ip=[% row.ip %]&port=[% row.port %]">[% row.ip %] [ [% row.port %] ]</a>
[% ' (' _ row.device.dns.remove(settings.domain_suffix) _ ')' IF row.device.dns %]
</td>
<td>[% row.descr %]</td>
<td>[% row.vlan %]</td>
</tr>
[% END %]
</tbody>
</table>

View File

@@ -0,0 +1,30 @@
<table class="bordered-table condensed-table zebra-striped">
<thead>
<tr>
<th>Vlan</th>
<th>Device</th>
<th>Description</th>
<th>Model</th>
<th>OS</th>
<th>Vendor</th>
</tr>
</thead>
</tbody>
[% WHILE (row = results.next) %]
<tr>
<td><a class="nd_linkcell nd_stealthlink"
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.vlan.vlan %]</a></td>
<td><a class="nd_linkcell"
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.dns %]</a></td>
<td><a class="nd_linkcell nd_stealthlink"
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.vlan.description %]</a></td>
<td><a class="nd_linkcell nd_stealthlink"
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.model %]</a></td>
<td><a class="nd_linkcell nd_stealthlink"
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.os %]</a></td>
<td><a class="nd_linkcell nd_stealthlink"
href="/device?ip=[% row.ip %]&vlan=[% row.vlan.vlan %]">[% row.vendor %]</a></td>
</tr>
[% END %]
</tbody>
</table>