From f7647c9c6dd41c5b0522b06fe86a7494d2a28cdd Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 15 May 2020 00:00:36 +0200 Subject: [PATCH] Show hostname(s) first, then MAC vendor (if applicable) and then IP address(es). Signed-off-by: DL6ER --- scripts/pi-hole/php/groups.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/pi-hole/php/groups.php b/scripts/pi-hole/php/groups.php index 50dc04c0..06867ce3 100644 --- a/scripts/pi-hole/php/groups.php +++ b/scripts/pi-hole/php/groups.php @@ -229,18 +229,19 @@ if ($_POST['action'] == 'get_groups') { // Prepare extra information $extrainfo = ""; - // Add device vendor to info string (if available) - if (strlen($res["macVendor"]) > 0) { - $extrainfo = "vendor: ".htmlspecialchars($res["macVendor"]); - if (count($names) > 0) - $extrainfo .= ", "; - } // Add list of associated host names to info string (if available) if(count($names) === 1) $extrainfo .= "hostname: ".$names[0]; else if(count($names) > 0) $extrainfo .= "hostnames: ".implode(", ", $names); + // Add device vendor to info string (if available) + if (strlen($res["macVendor"]) > 0) { + if (count($names) > 0) + $extrainfo .= "; "; + $extrainfo .= "vendor: ".htmlspecialchars($res["macVendor"]); + } + // Add list of associated host names to info string (if available and if this is not a mock device) if (stripos($res["hwaddr"], "ip-") === FALSE) { @@ -253,7 +254,7 @@ if ($_POST['action'] == 'get_groups') { $query_ips->finalize(); if (count($names) > 0 && count($addresses) > 0) - $extrainfo .= ", "; + $extrainfo .= "; "; if(count($addresses) === 1) $extrainfo .= "address: ".$addresses[0];