From 043eef9d4d21153a1c35081f31ab0992d850ccac Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 2 Mar 2013 16:04:22 +0000 Subject: [PATCH] clarify Device or Node data in Node Search --- Netdisco/share/views/ajax/search/node_by_ip.tt | 12 ++++++++---- .../share/views/ajax/search/node_by_mac.tt | 18 +++++++++++++----- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Netdisco/share/views/ajax/search/node_by_ip.tt b/Netdisco/share/views/ajax/search/node_by_ip.tt index e9811256..b4794be1 100644 --- a/Netdisco/share/views/ajax/search/node_by_ip.tt +++ b/Netdisco/share/views/ajax/search/node_by_ip.tt @@ -23,8 +23,8 @@ [% END %] IP → MAC [% row.ip %] - [% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %] [% ' A' IF NOT row.active %] + [% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %] [% IF params.stamps %] [% row.time_first_stamp %] @@ -38,9 +38,13 @@   [% END %] Switch Port - [% node.switch %] [ [% node.port %] ] - [% ' (' _ node.device.dns _ ')' IF node.device.dns %] + + [% node.switch %] - [% node.port %] [% ' A' IF NOT node.active %] + [% IF node.device.dns AND node.device_port AND node.device_port.name %] + ([% node.device.dns %] - [% node.device_port.name %]) + [% END %] [% IF params.stamps %] [% node.time_first_stamp %] @@ -56,8 +60,8 @@ [% END %] MAC → IP [% nodeip.ip %] - [% ' (' _ nodeip.dns.remove(settings.domain_suffix) _ ')' IF nodeip.dns %] [% ' A' IF NOT nodeip.active %] + [% ' (' _ nodeip.dns.remove(settings.domain_suffix) _ ')' IF nodeip.dns %] [% IF params.stamps %] [% nodeip.time_first_stamp %] diff --git a/Netdisco/share/views/ajax/search/node_by_mac.tt b/Netdisco/share/views/ajax/search/node_by_mac.tt index 7a76d82a..c9463bce 100644 --- a/Netdisco/share/views/ajax/search/node_by_mac.tt +++ b/Netdisco/share/views/ajax/search/node_by_mac.tt @@ -36,8 +36,8 @@ [% END %] MAC → IP [% row.ip %] - [% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %] [% ' A' IF NOT row.active %] + [% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %] [% IF params.stamps %] [% row.time_first_stamp %] @@ -66,9 +66,13 @@ [% END %] Switch Port - [% node.switch %] [ [% node.port %] ] - [% ' (' _ node.device.dns _ ')' IF node.device.dns %] + + [% node.switch %] - [% node.port %] [% ' A' IF NOT node.active %] + [% IF node.device.dns AND node.device_port AND node.device_port.name %] + ([% node.device.dns %] - [% node.device_port.name %]) + [% END %] [% IF params.stamps %] [% node.time_first_stamp %] @@ -97,8 +101,12 @@ [% END %] Switch Port - [% port.ip %] [ [% port.port %] ] - [% ' (' _ port.device.dns _ ')' IF port.device.dns %] + + [% port.ip %] - [% port.descr %] + [% IF port.device.dns AND port.name %] + ([% port.device.dns %] - [% port.name %]) + [% END %] [% IF params.stamps %] [% port.creation %]