mirror of
https://github.com/pi-hole/web.git
synced 2026-02-15 07:25:39 +00:00
Add "Reset Sorting" button to remaining pages.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -55,6 +55,7 @@
|
||||
<table id="adlistsTable" class="display table table-striped table-bordered" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Address</th>
|
||||
<th>Status</th>
|
||||
<th>Comment</th>
|
||||
@@ -63,6 +64,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<button type="button" id="resetButton" hidden="true">Reset sorting</button>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
|
||||
@@ -57,12 +57,14 @@
|
||||
<table id="clientsTable" class="display table table-striped table-bordered" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>IP address</th>
|
||||
<th>Group assignment</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<button type="button" id="resetButton" hidden="true">Reset sorting</button>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
<table id="domainsTable" class="display table table-striped table-bordered" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Domain</th>
|
||||
<th>Type</th>
|
||||
<th>Status</th>
|
||||
@@ -73,6 +74,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<button type="button" id="resetButton" hidden="true">Reset sorting</button>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user