From 268d291c268ea895769d68f1eeefd3e3ce3c96cf Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Wed, 1 Feb 2017 20:15:28 +0000 Subject: [PATCH] webui: Only show sysName once if force_ip_to_sysname is enabled #5600 (#5656) * webui: Only show sysName once if force_ip_to_sysname is enabled #5600 * now also display IP (again) if sysName is used --- html/includes/table/devices.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/html/includes/table/devices.inc.php b/html/includes/table/devices.inc.php index 423b0c5285..a5ce711fca 100644 --- a/html/includes/table/devices.inc.php +++ b/html/includes/table/devices.inc.php @@ -196,8 +196,13 @@ foreach (dbFetchRows($sql, $param) as $device) { if ($subformat == 'detail') { $platform = $device['hardware'] . '
' . $device['features']; $os = $device['os_text'] . '
' . $device['version']; + $device['ip'] = inet6_ntop($device['ip']); $uptime = formatUptime($device['uptime'], 'short'); - $hostname .= '
' . $device['sysName']; + if (ip_to_sysname($device, $device['hostname']) !== $device['sysName']) { + $hostname .= '
' . $device['sysName']; + } elseif ($device['hostname'] !== $device['ip']) { + $hostname .= '
' . $device['hostname']; + } if (empty($port_count)) { $port_count = 0; $col_port = '';