From fa6033ab56dca49c2b2cb32d29d48c019e264bb9 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 20 Jan 2020 19:03:00 +0100 Subject: [PATCH] Sort by first IP if multiple IPs are available for a given device. Signed-off-by: DL6ER --- scripts/pi-hole/js/ip-address-sorting.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/pi-hole/js/ip-address-sorting.js b/scripts/pi-hole/js/ip-address-sorting.js index 3055b3c1..21343fa2 100644 --- a/scripts/pi-hole/js/ip-address-sorting.js +++ b/scripts/pi-hole/js/ip-address-sorting.js @@ -14,6 +14,12 @@ jQuery.extend(jQuery.fn.dataTableExt.oSort, { } var i, item; + // Use the first IP in case there is a list of IPs + // for a given device + if (Array.isArray(a)) { + a = a[0]; + } + var m = a.split("."), n = a.split(":"), x = "",