From 68b99658ade32a2d1d8445c5b562edabfa058477 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 13 May 2020 22:59:28 +0200 Subject: [PATCH] Ensure IP addresses w/o MAC addresses are also shown and that already added clients are hidden. Signed-off-by: DL6ER --- scripts/pi-hole/js/groups-clients.js | 14 +++++++------- scripts/pi-hole/php/groups.php | 9 ++++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/scripts/pi-hole/js/groups-clients.js b/scripts/pi-hole/js/groups-clients.js index 919eb5aa..74614de9 100644 --- a/scripts/pi-hole/js/groups-clients.js +++ b/scripts/pi-hole/js/groups-clients.js @@ -32,12 +32,12 @@ function reload_client_suggestions() { continue; } - // Add MAC address - var text = key.toUpperCase(); - - // Check if this is a valid MAC address (skip mock devices) - if (!utils.validateMAC(text)) { - continue; + var text = key, + key_plain = key; + if (key.startsWith("IP-")) { + // Mock MAC address for address-only devices + key_plain = key.substring(3); + text = key_plain; } // Append host name if available @@ -45,7 +45,7 @@ function reload_client_suggestions() { text += " (" + data[key] + ")"; } - sel.append($("