implement connected devices list for ports

This commit is contained in:
Oliver Gorwits
2012-01-13 00:01:10 +00:00
parent f1eb6eb201
commit 9d335ee663
2 changed files with 76 additions and 15 deletions

View File

@@ -3,8 +3,8 @@
<tr>
<th></th>
[% FOREACH item IN vars.port_columns %]
[% NEXT UNLESS params.${item.name} %]
<th[% ' class="center_cell"' IF NOT loop.first %]>[% item.label %]</th>
[% NEXT UNLESS params.${item.name} %]
<th[% ' class="center_cell"' IF NOT loop.first %]>[% item.label %]</th>
[% END %]
</tr>
</thead>
@@ -74,15 +74,44 @@
[% SET count = count + 1 %]
[% END %]
[% IF count > 10 %]
[% SET output = '<div class="vlan_total">(' _ count _ ')</div><a href="#" class="nd_linkcell nd_collapse_vlans">'
_ 'Show VLANs</a><div class="nd_collapse_pre_hidden">' _ output %]
[% SET output = output _ '</div>' %]
[% SET output = '<div class="vlan_total">(' _ count _ ')</div><a href="#" class="nd_linkcell nd_collapse_vlans">'
_ 'Show VLANs</a><div class="nd_collapse_pre_hidden">' _ output %]
[% SET output = output _ '</div>' %]
[% END %]
[% output %]
</td>
[% END %]
[% IF params.c_connected %]
<td>[% row.connected | html_entity %]</td>
<td>
[% IF row.remote_ip %]
[% IF row.neighbor %]
<a href="/device?tab=ports&ip=[% row.neighbor.ip | uri %]&q=[% row.remote_port | uri %]">
[% row.neighbor.dns.remove(settings.domain_suffix) || row.neighbor.ip %]
([% row.remote_port | html_entity %])</a>
[% ELSE %]
<span class="label important">n</span>
<a href="/search?tab=node&q=[% row.remote_ip | uri %]">[% row.remote_ip %] ([% row.remote_port %])
<br/>&nbsp; ([% row.remote_type %]) / ([% row.remote_id %]</a>
[% END %]
[% END %]
[% FOREACH node IN row.get_nodes(params.n_archived) %]
[% '<br/>' IF row.remote_ip OR NOT loop.first %]
[% '<span class="label warning">a</span> &nbsp;' IF NOT node.active %]
<a href="/search?tab=node&q=[% node.mac | uri %]">[% node.mac %]</a>
[% ' (' _ node.time_last _ ')' IF params.n_age %]
[% IF params.n_ip %]
[% FOREACH ip IN node.ips %]
<br/>&nbsp; [% '<span class="label warning">a</span> &nbsp;' IF NOT node.active %]
[% SET dns = ip.dns %]
[% IF dns %]
<a href="/search?tab=node&q=[% ip.ip | uri %]">[% ip.dns %] ([% ip.ip %])</a>
[% ELSE %]
<a href="/search?tab=node&q=[% ip.ip | uri %]">[% ip.ip %]</a>
[% END %]
[% END %]
[% END %]
[% END %]
</td>
[% END %]
[% IF params.c_stp %]
<td class="center_cell">[% row.stp | html_entity %]</td>