When linking to devices, use the DNS name in preference to the IP

This commit is contained in:
Oliver Gorwits
2013-02-10 15:31:55 +00:00
parent b7e971074f
commit 4d832cb2a5
14 changed files with 41 additions and 29 deletions

View File

@@ -14,7 +14,7 @@
</tbody>
[% WHILE (row = results.next) %]
<tr>
<td><a href="[% uri_for('/device') %]?q=[% row.ip %]">[% row.dns.remove(settings.domain_suffix) || row.ip %]</a></td>
<td><a href="[% uri_for('/device') %]?q=[% row.dns || row.ip %]">[% row.dns || row.ip %]</a></td>
<td>[% row.contact %]</td>
<td>[% row.location %]</td>
<td>[% row.name %]</td>

View File

@@ -38,8 +38,8 @@
<td>&nbsp;</td>
[% END %]
<td>Switch Port</td>
<td><a href="[% device_ports %]&q=[% node.switch | url %]&f=[% node.port | url %]&c_nodes=on&c_neighbor=on">[% node.switch %] [ [% node.port %] ]</a>
[% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %]
<td><a href="[% device_ports %]&q=[% node.device.dns || node.switch %]&f=[% node.port | uri %]&c_nodes=on&c_neighbors=on">[% node.switch %] [ [% node.port %] ]</a>
[% ' (' _ node.device.dns _ ')' IF node.device.dns %]
[% ' <span class="label label-warning">A</span>' IF NOT node.active %]
</td>
[% IF params.stamps %]

View File

@@ -66,8 +66,8 @@
</td>
[% END %]
<td>Switch Port</td>
<td><a href="[% device_ports %]&q=[% node.switch | url %]&f=[% node.port | url %]&c_nodes=on&c_neighbor=on">[% node.switch %] [ [% node.port %] ]</a>
[% ' (' _ node.device.dns.remove(settings.domain_suffix) _ ')' IF node.device.dns %]
<td><a href="[% device_ports %]&q=[% node.device.dns || node.switch %]&f=[% node.port %]&c_nodes=on&c_neighbors=on">[% node.switch %] [ [% node.port %] ]</a>
[% ' (' _ node.device.dns _ ')' IF node.device.dns %]
[% ' <span class="label label-warning">A</span>' IF NOT node.active %]
</td>
[% IF params.stamps %]
@@ -97,8 +97,8 @@
</td>
[% END %]
<td>Switch Port</td>
<td><a href="[% device_ports %]&q=[% port.ip | url %]&f=[% port.port | url %]&c_nodes=on&c_neighbor=on">[% port.ip %] [ [% port.port %] ]</a>
[% ' (' _ port.device.dns.remove(settings.domain_suffix) _ ')' IF port.device.dns %]
<td><a href="[% device_ports %]&q=[% port.device.dns || port.ip %]&f=[% port.port %]&c_mac=on&c_nodes=on&c_neighbors=on">[% port.ip %] [ [% port.port %] ]</a>
[% ' (' _ port.device.dns _ ')' IF port.device.dns %]
</td>
[% IF params.stamps %]
<td>[% port.creation %]</td>

View File

@@ -11,8 +11,8 @@
[% WHILE (row = results.next) %]
<tr>
<td>[% row.name %]</td>
<td><a href="[% device_ports %]&q=[% row.ip %]&f=[% row.port %]">[% row.ip %] [ [% row.port %] ]</a>
[% ' (' _ row.device.dns.remove(settings.domain_suffix) _ ')' IF row.device.dns %]
<td><a href="[% device_ports %]&q=[% row.device.dns || row.ip %]&f=[% row.port %]">[% row.ip %] [ [% row.port %] ]</a>
[% ' (' _ row.device.dns _ ')' IF row.device.dns %]
</td>
<td>[% row.descr %]</td>
<td>[% row.vlan %]</td>

View File

@@ -13,17 +13,17 @@
[% WHILE (row = results.next) %]
<tr>
<td><a class="nd_linkcell nd_stealthlink"
href="[% device_ports %]&q=[% row.ip %]&f=[% row.vlan.vlan %]">[% row.vlan.vlan %]</a></td>
href="[% device_ports %]&q=[% row.dns || row.ip %]&f=[% row.vlan.vlan %]">[% row.vlan.vlan %]</a></td>
<td><a class="nd_linkcell"
href="[% device_ports %]&q=[% row.ip %]&f=[% row.vlan.vlan %]">[% row.dns.remove(settings.domain_suffix) || row.ip %]</a></td>
href="[% device_ports %]&q=[% row.dns || row.ip %]&f=[% row.vlan.vlan %]">[% row.dns || row.ip %]</a></td>
<td><a class="nd_linkcell nd_stealthlink"
href="[% device_ports %]&q=[% row.ip %]&f=[% row.vlan.vlan %]">[% row.vlan.description %]</a></td>
href="[% device_ports %]&q=[% row.dns || row.ip %]&f=[% row.vlan.vlan %]">[% row.vlan.description %]</a></td>
<td><a class="nd_linkcell nd_stealthlink"
href="[% device_ports %]&q=[% row.ip %]&f=[% row.vlan.vlan %]">[% row.model %]</a></td>
href="[% device_ports %]&q=[% row.dns || row.ip %]&f=[% row.vlan.vlan %]">[% row.model %]</a></td>
<td><a class="nd_linkcell nd_stealthlink"
href="[% device_ports %]&q=[% row.ip %]&f=[% row.vlan.vlan %]">[% row.os %]</a></td>
href="[% device_ports %]&q=[% row.dns || row.ip %]&f=[% row.vlan.vlan %]">[% row.os %]</a></td>
<td><a class="nd_linkcell nd_stealthlink"
href="[% device_ports %]&q=[% row.ip %]&f=[% row.vlan.vlan %]">[% row.vendor %]</a></td>
href="[% device_ports %]&q=[% row.dns || row.ip %]&f=[% row.vlan.vlan %]">[% row.vendor %]</a></td>
</tr>
[% END %]
</tbody>