diff --git a/groups-adlists.php b/groups-adlists.php index f75d6caf..9b806967 100644 --- a/groups-adlists.php +++ b/groups-adlists.php @@ -55,6 +55,7 @@ + @@ -63,6 +64,7 @@
ID Address Status Comment
+ diff --git a/groups-clients.php b/groups-clients.php index e07760b2..2fb91834 100644 --- a/groups-clients.php +++ b/groups-clients.php @@ -57,12 +57,14 @@ +
ID IP address Group assignment Action
+ diff --git a/groups-domains.php b/groups-domains.php index 237000d0..c6a1836d 100644 --- a/groups-domains.php +++ b/groups-domains.php @@ -64,6 +64,7 @@ + @@ -73,6 +74,7 @@
ID Domain Type Status
+ diff --git a/scripts/pi-hole/js/groups-adlists.js b/scripts/pi-hole/js/groups-adlists.js index 5584d9e6..94a2a57d 100644 --- a/scripts/pi-hole/js/groups-adlists.js +++ b/scripts/pi-hole/js/groups-adlists.js @@ -99,6 +99,7 @@ function initTable() { }, order: [[0, "asc"]], columns: [ + { data: "id", visible: false }, { data: "address" }, { data: "enabled", searchable: false }, { data: "comment" }, @@ -201,6 +202,19 @@ function initTable() { return data; } }); + + table.on("order.dt", function() { + var order = table.order(); + if (order[0][0] !== 0 || order[0][1] !== "asc") { + $("#resetButton").show(); + } else { + $("#resetButton").hide(); + } + }); + $("#resetButton").on("click", function() { + table.order([[0, "asc"]]).draw(); + $("#resetButton").hide(); + }); } function addAdlist() { diff --git a/scripts/pi-hole/js/groups-clients.js b/scripts/pi-hole/js/groups-clients.js index 3fb2afd8..8c84bc78 100644 --- a/scripts/pi-hole/js/groups-clients.js +++ b/scripts/pi-hole/js/groups-clients.js @@ -127,6 +127,7 @@ function initTable() { }, order: [[0, "asc"]], columns: [ + { data: "id", visible: false }, { data: "ip" }, { data: "groups", searchable: false }, { data: "name", width: "80px", orderable: false } @@ -209,6 +210,19 @@ function initTable() { return data; } }); + + table.on("order.dt", function() { + var order = table.order(); + if (order[0][0] !== 0 || order[0][1] !== "asc") { + $("#resetButton").show(); + } else { + $("#resetButton").hide(); + } + }); + $("#resetButton").on("click", function() { + table.order([[0, "asc"]]).draw(); + $("#resetButton").hide(); + }); } function addClient() { diff --git a/scripts/pi-hole/js/groups-domains.js b/scripts/pi-hole/js/groups-domains.js index 282c7009..12872597 100644 --- a/scripts/pi-hole/js/groups-domains.js +++ b/scripts/pi-hole/js/groups-domains.js @@ -99,6 +99,7 @@ function initTable() { }, order: [[0, "asc"]], columns: [ + { data: "id", visible: false }, { data: "domain" }, { data: "type", searchable: false }, { data: "enabled", searchable: false }, @@ -218,6 +219,19 @@ function initTable() { return data; } }); + + table.on("order.dt", function() { + var order = table.order(); + if (order[0][0] !== 0 || order[0][1] !== "asc") { + $("#resetButton").show(); + } else { + $("#resetButton").hide(); + } + }); + $("#resetButton").on("click", function() { + table.order([[0, "asc"]]).draw(); + $("#resetButton").hide(); + }); } function addDomain() { diff --git a/scripts/pi-hole/js/groups.js b/scripts/pi-hole/js/groups.js index d3b31e16..16699fcd 100644 --- a/scripts/pi-hole/js/groups.js +++ b/scripts/pi-hole/js/groups.js @@ -65,10 +65,6 @@ function datetime(date) { $(document).ready(function() { $("#btnAdd").on("click", addGroup); - $("#resetButton").on("click", function() { - table.order([[0, "asc"]]).draw(); - $("#resetButton").hide(); - }); table = $("#groupsTable").DataTable({ ajax: { @@ -173,6 +169,10 @@ $(document).ready(function() { $("#resetButton").hide(); } }); + $("#resetButton").on("click", function() { + table.order([[0, "asc"]]).draw(); + $("#resetButton").hide(); + }); }); function addGroup() {