From f3d7eb296a117bd5312d2273519f7f696fb34d37 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 5 May 2023 20:02:02 +0200 Subject: [PATCH] Ported groups-clients.lp Signed-off-by: DL6ER --- groups-clients.php => groups-clients.lp | 15 +- scripts/pi-hole/js/groups-clients.js | 245 ++++++++++++------------ scripts/pi-hole/js/groups.js | 46 ++--- scripts/pi-hole/lua/sidebar.lp | 2 +- 4 files changed, 152 insertions(+), 156 deletions(-) rename groups-clients.php => groups-clients.lp (93%) diff --git a/groups-clients.php b/groups-clients.lp similarity index 93% rename from groups-clients.php rename to groups-clients.lp index 5a027b39..f778fa69 100644 --- a/groups-clients.php +++ b/groups-clients.lp @@ -1,12 +1,11 @@ - diff --git a/scripts/pi-hole/js/groups-clients.js b/scripts/pi-hole/js/groups-clients.js index f2ad8246..024848b7 100644 --- a/scripts/pi-hole/js/groups-clients.js +++ b/scripts/pi-hole/js/groups-clients.js @@ -5,17 +5,18 @@ * This file is copyright under the latest version of the EUPL. * Please see LICENSE file for your rights under this license. */ -/* global utils:false */ +/* global utils:false, updateFtlInfo:false */ var table; var groups = []; var token = $("#token").text(); function reloadClientSuggestions() { - $.post( - "scripts/pi-hole/php/groups.php", - { action: "get_unconfigured_clients", token: token }, - function (data) { + $.ajax({ + url: "/api/clients/_suggestions", + type: "GET", + dataType: "json", + success: function (data) { var sel = $("#select"); sel.empty(); @@ -27,41 +28,62 @@ function reloadClientSuggestions() { sel.append($("