diff --git a/groups-domains.php b/groups-domains.php index f511f9f7..2ac14dd6 100644 --- a/groups-domains.php +++ b/groups-domains.php @@ -113,6 +113,16 @@ require 'scripts/pi-hole/php/header_authenticated.php';

List of domains

+
+
+ + +
+
+ + +
+
diff --git a/scripts/pi-hole/js/groups-domains.js b/scripts/pi-hole/js/groups-domains.js index 9eaeecd5..1dd2c026 100644 --- a/scripts/pi-hole/js/groups-domains.js +++ b/scripts/pi-hole/js/groups-domains.js @@ -402,6 +402,24 @@ function initTable() { }); } +// Enable "filter by type" functionality, using checkboxes +$.fn.dataTable.ext.search.push(function (settings, searchData, index, rowData) { + var types = $(".filter_types input:checkbox:checked") + .map(function () { + return this.value; + }) + .get(); + + if (types.indexOf(rowData.type.toString()) !== -1) { + return true; + } + + return false; +}); +$(".filter_types input:checkbox").on("change", function () { + table.draw(); +}); + // Remove 'bnt-group' class from container, to avoid grouping $.fn.dataTable.Buttons.defaults.dom.container.className = "dt-buttons"; diff --git a/scripts/pi-hole/php/header_authenticated.php b/scripts/pi-hole/php/header_authenticated.php index 8e86a2f4..f84ee5ef 100644 --- a/scripts/pi-hole/php/header_authenticated.php +++ b/scripts/pi-hole/php/header_authenticated.php @@ -137,7 +137,7 @@ $piholeFTLConf = piholeFTLConfig(); require 'header.php'; ?> - +