mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 04:38:28 +00:00
Add interpretation for Pi-hole message type ADLIST
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
var table;
|
||||
var groups = [];
|
||||
var token = $("#token").text();
|
||||
var GETDict = {};
|
||||
|
||||
function getGroups() {
|
||||
$.post(
|
||||
@@ -24,6 +25,13 @@ function getGroups() {
|
||||
}
|
||||
|
||||
$(function () {
|
||||
window.location.search
|
||||
.substr(1)
|
||||
.split("&")
|
||||
.forEach(function (item) {
|
||||
GETDict[item.split("=")[0]] = item.split("=")[1];
|
||||
});
|
||||
|
||||
$("#btnAdd").on("click", addAdlist);
|
||||
|
||||
utils.setBsSelectDefaults();
|
||||
@@ -289,6 +297,11 @@ function initTable() {
|
||||
|
||||
var applyBtn = "#btn_apply_" + data.id;
|
||||
|
||||
// Highlight row (if url parameter "adlistid=" is used)
|
||||
if ("adlistid" in GETDict && data.id === parseInt(GETDict.adlistid, 10)) {
|
||||
$(row).find("td").addClass("highlight");
|
||||
}
|
||||
|
||||
var button =
|
||||
'<button type="button" class="btn btn-danger btn-xs" id="deleteAdlist_' +
|
||||
data.id +
|
||||
@@ -371,6 +384,18 @@ function initTable() {
|
||||
// Apply loaded state to table
|
||||
return data;
|
||||
},
|
||||
initComplete: function () {
|
||||
if ("adlistid" in GETDict) {
|
||||
var pos = table
|
||||
.column(0, { order: "current" })
|
||||
.data()
|
||||
.indexOf(parseInt(GETDict.adlistid, 10));
|
||||
if (pos >= 0) {
|
||||
var page = Math.floor(pos / table.page.info().length);
|
||||
table.page(page).draw(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
table.on("init select deselect", function () {
|
||||
|
||||
Reference in New Issue
Block a user