diff --git a/package.json b/package.json
index ecd1fefc..7b31f82f 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,7 @@
"endOfLine": "auto",
"printWidth": 100,
"singleQuote": false,
- "trailingComma": "none"
+ "trailingComma": "es5"
},
"xo": {
"envs": [
diff --git a/scripts/pi-hole/js/auditlog.js b/scripts/pi-hole/js/auditlog.js
index 65b8eecc..0374d6de 100644
--- a/scripts/pi-hole/js/auditlog.js
+++ b/scripts/pi-hole/js/auditlog.js
@@ -100,14 +100,14 @@ function add(domain, list) {
list: list,
token: token,
action: list === "audit" ? "add_audit" : "add_domain",
- comment: "Added from Audit Log"
+ comment: "Added from Audit Log",
},
success: function () {
updateTopLists();
},
error: function (jqXHR, exception) {
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
diff --git a/scripts/pi-hole/js/customcname.js b/scripts/pi-hole/js/customcname.js
index d1a8234e..10ebfe3b 100644
--- a/scripts/pi-hole/js/customcname.js
+++ b/scripts/pi-hole/js/customcname.js
@@ -46,7 +46,7 @@ $(function () {
ajax: {
url: "scripts/pi-hole/php/customcname.php",
data: { action: "get", token: token },
- type: "POST"
+ type: "POST",
},
columns: [{}, {}, { orderable: false, searchable: false }],
columnDefs: [
@@ -62,12 +62,12 @@ $(function () {
'' +
""
);
- }
- }
+ },
+ },
],
lengthMenu: [
[10, 25, 50, 100, -1],
- [10, 25, 50, 100, "All"]
+ [10, 25, 50, 100, "All"],
],
order: [[0, "asc"]],
stateSave: true,
@@ -79,7 +79,7 @@ $(function () {
},
drawCallback: function () {
$(".deleteCustomCNAME").on("click", deleteCustomCNAME);
- }
+ },
});
// Disable autocorrect in the search box
var input = document.querySelector("input[type=search]");
@@ -107,7 +107,7 @@ function addCustomCNAME() {
},
error: function () {
showAlert("error", "Error while adding this custom CNAME record");
- }
+ },
});
}
@@ -130,6 +130,6 @@ function deleteCustomCNAME() {
error: function (jqXHR, exception) {
showAlert("error", "Error while deleting this custom CNAME record");
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
diff --git a/scripts/pi-hole/js/customdns.js b/scripts/pi-hole/js/customdns.js
index 0c9f2f74..655357ff 100644
--- a/scripts/pi-hole/js/customdns.js
+++ b/scripts/pi-hole/js/customdns.js
@@ -46,7 +46,7 @@ $(function () {
ajax: {
url: "scripts/pi-hole/php/customdns.php",
data: { action: "get", token: token },
- type: "POST"
+ type: "POST",
},
columns: [{}, { type: "ip-address" }, { orderable: false, searchable: false }],
columnDefs: [
@@ -62,12 +62,12 @@ $(function () {
'' +
""
);
- }
- }
+ },
+ },
],
lengthMenu: [
[10, 25, 50, 100, -1],
- [10, 25, 50, 100, "All"]
+ [10, 25, 50, 100, "All"],
],
order: [[0, "asc"]],
stateSave: true,
@@ -79,7 +79,7 @@ $(function () {
},
drawCallback: function () {
$(".deleteCustomDNS").on("click", deleteCustomDNS);
- }
+ },
});
// Disable autocorrect in the search box
var input = document.querySelector("input[type=search]");
@@ -107,7 +107,7 @@ function addCustomDNS() {
},
error: function () {
showAlert("error", "Error while adding this custom DNS entry");
- }
+ },
});
}
@@ -130,6 +130,6 @@ function deleteCustomDNS() {
error: function (jqXHR, exception) {
showAlert("error", "Error while deleting this custom DNS entry");
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
diff --git a/scripts/pi-hole/js/db_graph.js b/scripts/pi-hole/js/db_graph.js
index 66ab5f11..ce5fd6e8 100644
--- a/scripts/pi-hole/js/db_graph.js
+++ b/scripts/pi-hole/js/db_graph.js
@@ -28,21 +28,21 @@ $(function () {
Today: [moment().startOf("day"), moment()],
Yesterday: [
moment().subtract(1, "days").startOf("day"),
- moment().subtract(1, "days").endOf("day")
+ moment().subtract(1, "days").endOf("day"),
],
"Last 7 Days": [moment().subtract(6, "days"), moment()],
"Last 30 Days": [moment().subtract(29, "days"), moment()],
"This Month": [moment().startOf("month"), moment()],
"Last Month": [
moment().subtract(1, "month").startOf("month"),
- moment().subtract(1, "month").endOf("month")
+ moment().subtract(1, "month").endOf("month"),
],
"This Year": [moment().startOf("year"), moment()],
- "All Time": [moment(0), moment()]
+ "All Time": [moment(0), moment()],
},
opens: "center",
showDropdowns: true,
- autoUpdateInput: false
+ autoUpdateInput: false,
},
function (startt, endt) {
from = moment(startt).utc().valueOf() / 1000;
@@ -166,7 +166,7 @@ $(function () {
pointRadius: 1,
pointHoverRadius: 5,
data: [],
- pointHitRadius: 5
+ pointHitRadius: 5,
},
{
label: "Permitted DNS Queries",
@@ -177,9 +177,9 @@ $(function () {
pointRadius: 1,
pointHoverRadius: 5,
data: [],
- pointHitRadius: 5
- }
- ]
+ pointHitRadius: 5,
+ },
+ ],
},
options: {
tooltips: {
@@ -267,11 +267,11 @@ $(function () {
}
return data.datasets[tooltipItems.datasetIndex].label + ": " + tooltipItems.yLabel;
- }
- }
+ },
+ },
},
legend: {
- display: false
+ display: false,
},
scales: {
xAxes: [
@@ -287,22 +287,22 @@ $(function () {
week: "MMM DD",
month: "MMM",
quarter: "MMM",
- year: "YYYY MMM"
- }
- }
- }
+ year: "YYYY MMM",
+ },
+ },
+ },
],
yAxes: [
{
stacked: true,
ticks: {
- beginAtZero: true
- }
- }
- ]
+ beginAtZero: true,
+ },
+ },
+ ],
},
- maintainAspectRatio: false
- }
+ maintainAspectRatio: false,
+ },
});
});
diff --git a/scripts/pi-hole/js/db_lists.js b/scripts/pi-hole/js/db_lists.js
index ec535874..b8df039b 100644
--- a/scripts/pi-hole/js/db_lists.js
+++ b/scripts/pi-hole/js/db_lists.js
@@ -30,21 +30,21 @@ $(function () {
Today: [moment().startOf("day"), moment()],
Yesterday: [
moment().subtract(1, "days").startOf("day"),
- moment().subtract(1, "days").endOf("day")
+ moment().subtract(1, "days").endOf("day"),
],
"Last 7 Days": [moment().subtract(6, "days"), moment()],
"Last 30 Days": [moment().subtract(29, "days"), moment()],
"This Month": [moment().startOf("month"), moment()],
"Last Month": [
moment().subtract(1, "month").startOf("month"),
- moment().subtract(1, "month").endOf("month")
+ moment().subtract(1, "month").endOf("month"),
],
"This Year": [moment().startOf("year"), moment()],
- "All Time": [moment(0), moment()]
+ "All Time": [moment(0), moment()],
},
opens: "center",
showDropdowns: true,
- autoUpdateInput: false
+ autoUpdateInput: false,
},
function (startt, endt) {
from = moment(startt).utc().valueOf() / 1000;
diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js
index 2c87dc15..6cc2de32 100644
--- a/scripts/pi-hole/js/db_queries.js
+++ b/scripts/pi-hole/js/db_queries.js
@@ -48,21 +48,21 @@ $(function () {
Today: [moment().startOf("day"), moment()],
Yesterday: [
moment().subtract(1, "days").startOf("day"),
- moment().subtract(1, "days").endOf("day")
+ moment().subtract(1, "days").endOf("day"),
],
"Last 7 Days": [moment().subtract(6, "days"), moment()],
"Last 30 Days": [moment().subtract(29, "days"), moment()],
"This Month": [moment().startOf("month"), moment()],
"Last Month": [
moment().subtract(1, "month").startOf("month"),
- moment().subtract(1, "month").endOf("month")
+ moment().subtract(1, "month").endOf("month"),
],
"This Year": [moment().startOf("year"), moment()],
- "All Time": [moment(0), moment()]
+ "All Time": [moment(0), moment()],
},
opens: "center",
showDropdowns: true,
- autoUpdateInput: false
+ autoUpdateInput: false,
},
function (startt, endt) {
from = moment(startt).utc().valueOf() / 1000;
@@ -310,7 +310,7 @@ $(function () {
x[0] = x[0] * 1e6 + dataIndex++;
return x;
});
- }
+ },
},
autoWidth: false,
processing: true,
@@ -327,26 +327,26 @@ $(function () {
}
return data;
- }
+ },
},
{ width: "10%" },
{ width: "40%", render: $.fn.dataTable.render.text() },
{ width: "20%", type: "ip-address", render: $.fn.dataTable.render.text() },
{ width: "10%" },
- { width: "5%" }
+ { width: "5%" },
],
lengthMenu: [
[10, 25, 50, 100, -1],
- [10, 25, 50, 100, "All"]
+ [10, 25, 50, 100, "All"],
],
columnDefs: [
{
targets: -1,
data: null,
- defaultContent: ""
- }
+ defaultContent: "",
+ },
],
- initComplete: reloadCallback
+ initComplete: reloadCallback,
});
$("#all-queries tbody").on("click", "button", function () {
var data = tableApi.row($(this).parents("tr")).data();
diff --git a/scripts/pi-hole/js/debug.js b/scripts/pi-hole/js/debug.js
index dba012f4..1ed17b3b 100644
--- a/scripts/pi-hole/js/debug.js
+++ b/scripts/pi-hole/js/debug.js
@@ -20,7 +20,7 @@ function eventsource() {
$.ajax({
method: "GET",
url: "scripts/pi-hole/php/debug.php?IE&token=" + token + "&" + checked,
- async: false
+ async: false,
}).done(function (data) {
ta.show();
ta.empty();
diff --git a/scripts/pi-hole/js/groups-adlists.js b/scripts/pi-hole/js/groups-adlists.js
index 6a5baf8a..b8af5b4f 100644
--- a/scripts/pi-hole/js/groups-adlists.js
+++ b/scripts/pi-hole/js/groups-adlists.js
@@ -112,7 +112,7 @@ function initTable() {
ajax: {
url: "scripts/pi-hole/php/groups.php",
data: { action: "get_adlists", token: token },
- type: "POST"
+ type: "POST",
},
order: [[0, "asc"]],
columns: [
@@ -122,7 +122,7 @@ function initTable() {
{ data: "enabled", searchable: false },
{ data: "comment" },
{ data: "groups", searchable: false },
- { data: null, width: "80px", orderable: false }
+ { data: null, width: "80px", orderable: false },
],
drawCallback: function () {
$('button[id^="deleteAdlist_"]').on("click", deleteAdlist);
@@ -198,7 +198,7 @@ function initTable() {
off: "Disabled",
size: "small",
onstyle: "success",
- width: "80px"
+ width: "80px",
});
statusEl.on("change", editAdlist);
@@ -286,7 +286,7 @@ function initTable() {
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
lengthMenu: [
[10, 25, 50, 100, -1],
- [10, 25, 50, 100, "All"]
+ [10, 25, 50, 100, "All"],
],
stateSave: true,
stateSaveCallback: function (settings, data) {
@@ -304,7 +304,7 @@ function initTable() {
data.columns[0].visible = false;
// Apply loaded state to table
return data;
- }
+ },
});
table.on("order.dt", function () {
@@ -368,7 +368,7 @@ function addAdlist() {
action: "add_adlist",
address: address,
comment: comment,
- token: token
+ token: token,
},
success: function (response) {
utils.enableAll();
@@ -386,7 +386,7 @@ function addAdlist() {
utils.enableAll();
utils.showAlert("error", "", "Error while adding new adlist: ", jqXHR.responseText);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
@@ -438,7 +438,7 @@ function editAdlist() {
comment: comment,
status: status,
groups: groups,
- token: token
+ token: token,
},
success: function (response) {
utils.enableAll();
@@ -468,7 +468,7 @@ function editAdlist() {
jqXHR.responseText
);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
@@ -497,6 +497,6 @@ function deleteAdlist() {
utils.enableAll();
utils.showAlert("error", "", "Error while deleting adlist with ID " + id, jqXHR.responseText);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
diff --git a/scripts/pi-hole/js/groups-clients.js b/scripts/pi-hole/js/groups-clients.js
index 31139d3f..c97d88c1 100644
--- a/scripts/pi-hole/js/groups-clients.js
+++ b/scripts/pi-hole/js/groups-clients.js
@@ -69,7 +69,7 @@ $(function () {
$("select").select2({
tags: true,
placeholder: "Select client...",
- allowClear: true
+ allowClear: true,
});
reloadClientSuggestions();
@@ -87,7 +87,7 @@ function initTable() {
ajax: {
url: "scripts/pi-hole/php/groups.php",
data: { action: "get_clients", token: token },
- type: "POST"
+ type: "POST",
},
order: [[0, "asc"]],
columns: [
@@ -95,7 +95,7 @@ function initTable() {
{ data: "ip", type: "ip-address" },
{ data: "comment" },
{ data: "groups", searchable: false },
- { data: "name", width: "80px", orderable: false }
+ { data: "name", width: "80px", orderable: false },
],
drawCallback: function () {
$('button[id^="deleteClient_"]').on("click", deleteClient);
@@ -214,7 +214,7 @@ function initTable() {
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
lengthMenu: [
[10, 25, 50, 100, -1],
- [10, 25, 50, 100, "All"]
+ [10, 25, 50, 100, "All"],
],
stateSave: true,
stateSaveCallback: function (settings, data) {
@@ -232,7 +232,7 @@ function initTable() {
data.columns[0].visible = false;
// Apply loaded state to table
return data;
- }
+ },
});
// Disable autocorrect in the search box
@@ -310,7 +310,7 @@ function addClient() {
utils.enableAll();
utils.showAlert("error", "", "Error while adding new client", jqXHR.responseText);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
@@ -354,7 +354,7 @@ function editClient() {
id: id,
groups: groups,
token: token,
- comment: comment
+ comment: comment,
},
success: function (response) {
utils.enableAll();
@@ -378,7 +378,7 @@ function editClient() {
jqXHR.responseText
);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
@@ -413,6 +413,6 @@ function deleteClient() {
utils.enableAll();
utils.showAlert("error", "", "Error while deleting client with ID " + id, jqXHR.responseText);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
diff --git a/scripts/pi-hole/js/groups-domains.js b/scripts/pi-hole/js/groups-domains.js
index 61c057dc..0eb1bb6f 100644
--- a/scripts/pi-hole/js/groups-domains.js
+++ b/scripts/pi-hole/js/groups-domains.js
@@ -64,7 +64,7 @@ function initTable() {
ajax: {
url: "scripts/pi-hole/php/groups.php",
data: { action: "get_domains", showtype: showtype, token: token },
- type: "POST"
+ type: "POST",
},
order: [[0, "asc"]],
columns: [
@@ -74,7 +74,7 @@ function initTable() {
{ data: "enabled", searchable: false },
{ data: "comment" },
{ data: "groups", searchable: false, visible: showtype === "all" },
- { data: null, width: "80px", orderable: false }
+ { data: null, width: "80px", orderable: false },
],
drawCallback: function () {
$('button[id^="deleteDomain_"]').on("click", deleteDomain);
@@ -143,7 +143,7 @@ function initTable() {
off: "Disabled",
size: "small",
onstyle: "success",
- width: "80px"
+ width: "80px",
});
statusEl.on("change", editDomain);
@@ -243,7 +243,7 @@ function initTable() {
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
lengthMenu: [
[10, 25, 50, 100, -1],
- [10, 25, 50, 100, "All"]
+ [10, 25, 50, 100, "All"],
],
stateSave: true,
stateSaveCallback: function (settings, data) {
@@ -275,7 +275,7 @@ function initTable() {
table.page(page).draw(false);
}
}
- }
+ },
});
// Disable autocorrect in the search box
var input = document.querySelector("input[type=search]");
@@ -360,7 +360,7 @@ function addDomain() {
domain: domain,
type: type,
comment: comment,
- token: token
+ token: token,
},
success: function (response) {
utils.enableAll();
@@ -378,7 +378,7 @@ function addDomain() {
utils.enableAll();
utils.showAlert("error", "", "Error while adding new " + domainRegex, jqXHR.responseText);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
@@ -450,7 +450,7 @@ function editDomain() {
comment: comment,
status: status,
groups: groups,
- token: token
+ token: token,
},
success: function (response) {
utils.enableAll();
@@ -479,7 +479,7 @@ function editDomain() {
jqXHR.responseText
);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
@@ -531,6 +531,6 @@ function deleteDomain() {
jqXHR.responseText
);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
diff --git a/scripts/pi-hole/js/groups.js b/scripts/pi-hole/js/groups.js
index 5dbfa458..cdd621a1 100644
--- a/scripts/pi-hole/js/groups.js
+++ b/scripts/pi-hole/js/groups.js
@@ -17,7 +17,7 @@ $(function () {
ajax: {
url: "scripts/pi-hole/php/groups.php",
data: { action: "get_groups", token: token },
- type: "POST"
+ type: "POST",
},
order: [[0, "asc"]],
columns: [
@@ -25,7 +25,7 @@ $(function () {
{ data: "name" },
{ data: "enabled", searchable: false },
{ data: "description" },
- { data: null, width: "60px", orderable: false }
+ { data: null, width: "60px", orderable: false },
],
drawCallback: function () {
$('button[id^="deleteGroup_"]').on("click", deleteGroup);
@@ -56,7 +56,7 @@ $(function () {
off: "Disabled",
size: "small",
onstyle: "success",
- width: "80px"
+ width: "80px",
});
statusEl.on("change", editGroup);
@@ -83,7 +83,7 @@ $(function () {
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
lengthMenu: [
[10, 25, 50, 100, -1],
- [10, 25, 50, 100, "All"]
+ [10, 25, 50, 100, "All"],
],
stateSave: true,
stateSaveCallback: function (settings, data) {
@@ -101,7 +101,7 @@ $(function () {
data.columns[0].visible = false;
// Apply loaded state to table
return data;
- }
+ },
});
// Disable autocorrect in the search box
@@ -161,7 +161,7 @@ function addGroup() {
utils.enableAll();
utils.showAlert("error", "", "Error while adding new group", jqXHR.responseText);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
@@ -211,7 +211,7 @@ function editGroup() {
name: name,
desc: desc,
status: status,
- token: token
+ token: token,
},
success: function (response) {
utils.enableAll();
@@ -235,7 +235,7 @@ function editGroup() {
jqXHR.responseText
);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
@@ -264,6 +264,6 @@ function deleteGroup() {
utils.enableAll();
utils.showAlert("error", "", "Error while deleting group with ID " + id, jqXHR.responseText);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
}
diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js
index 148f8275..b2dda171 100644
--- a/scripts/pi-hole/js/index.js
+++ b/scripts/pi-hole/js/index.js
@@ -27,7 +27,7 @@ var THEME_COLORS = [
"#8e24aa",
"#d81b60",
"#222222",
- "#d2d6de"
+ "#d2d6de",
];
var customTooltips = function (tooltip) {
@@ -244,7 +244,7 @@ function updateQueriesOverTime() {
pointHitRadius: 5,
pointHoverRadius: 5,
label: labels[i],
- cubicInterpolationMode: "monotone"
+ cubicInterpolationMode: "monotone",
});
}
@@ -399,7 +399,7 @@ function updateClientsOverTime() {
pointHitRadius: 5,
pointHoverRadius: 5,
label: labels[i],
- cubicInterpolationMode: "monotone"
+ cubicInterpolationMode: "monotone",
});
}
@@ -753,7 +753,7 @@ function updateSummaryData(runOnce) {
"dns_queries_today",
"ads_percentage_today|percentage_blocked_today",
"unique_clients",
- "domains_being_blocked"
+ "domains_being_blocked",
].forEach(function (arrayItem, idx) {
var apiElName = arrayItem.split("|");
var apiName = apiElName[0];
@@ -828,7 +828,7 @@ $(function () {
type: utils.getGraphType(),
data: {
labels: [],
- datasets: [{ data: [] }]
+ datasets: [{ data: [] }],
},
options: {
tooltips: {
@@ -868,11 +868,11 @@ $(function () {
}
return data.datasets[tooltipItems.datasetIndex].label + ": " + tooltipItems.yLabel;
- }
- }
+ },
+ },
},
legend: {
- display: false
+ display: false,
},
scales: {
xAxes: [
@@ -882,33 +882,33 @@ $(function () {
time: {
unit: "hour",
displayFormats: {
- hour: "HH:mm"
+ hour: "HH:mm",
},
- tooltipFormat: "HH:mm"
+ tooltipFormat: "HH:mm",
},
gridLines: {
- color: gridColor
+ color: gridColor,
},
ticks: {
- fontColor: ticksColor
- }
- }
+ fontColor: ticksColor,
+ },
+ },
],
yAxes: [
{
stacked: true,
ticks: {
beginAtZero: true,
- fontColor: ticksColor
+ fontColor: ticksColor,
},
gridLines: {
- color: gridColor
- }
- }
- ]
+ color: gridColor,
+ },
+ },
+ ],
},
- maintainAspectRatio: false
- }
+ maintainAspectRatio: false,
+ },
});
// Pull in data via AJAX
@@ -923,7 +923,7 @@ $(function () {
type: utils.getGraphType(),
data: {
labels: [],
- datasets: [{ data: [] }]
+ datasets: [{ data: [] }],
},
options: {
tooltips: {
@@ -946,11 +946,11 @@ $(function () {
},
label: function (tooltipItems, data) {
return data.datasets[tooltipItems.datasetIndex].label + ": " + tooltipItems.yLabel;
- }
- }
+ },
+ },
},
legend: {
- display: false
+ display: false,
},
scales: {
xAxes: [
@@ -960,36 +960,36 @@ $(function () {
time: {
unit: "hour",
displayFormats: {
- hour: "HH:mm"
+ hour: "HH:mm",
},
- tooltipFormat: "HH:mm"
+ tooltipFormat: "HH:mm",
},
gridLines: {
- color: gridColor
+ color: gridColor,
},
ticks: {
- fontColor: ticksColor
- }
- }
+ fontColor: ticksColor,
+ },
+ },
],
yAxes: [
{
ticks: {
beginAtZero: true,
- fontColor: ticksColor
+ fontColor: ticksColor,
},
stacked: true,
gridLines: {
- color: gridColor
- }
- }
- ]
+ color: gridColor,
+ },
+ },
+ ],
},
maintainAspectRatio: false,
hover: {
- animationDuration: 0
- }
- }
+ animationDuration: 0,
+ },
+ },
});
// Pull in data via AJAX
@@ -1048,16 +1048,16 @@ $(function () {
type: "doughnut",
data: {
labels: [],
- datasets: [{ data: [] }]
+ datasets: [{ data: [] }],
},
options: {
elements: {
arc: {
- borderColor: $(".box").css("background-color")
- }
+ borderColor: $(".box").css("background-color"),
+ },
},
legend: {
- display: false
+ display: false,
},
tooltips: {
enabled: false,
@@ -1068,14 +1068,14 @@ $(function () {
},
label: function (tooltipItems, data) {
return doughnutTooltip(tooltipItems, data);
- }
- }
+ },
+ },
},
animation: {
- duration: 750
+ duration: 750,
},
- cutoutPercentage: 0
- }
+ cutoutPercentage: 0,
+ },
});
// Pull in data via AJAX
@@ -1088,16 +1088,16 @@ $(function () {
type: "doughnut",
data: {
labels: [],
- datasets: [{ data: [] }]
+ datasets: [{ data: [] }],
},
options: {
elements: {
arc: {
- borderColor: $(".box").css("background-color")
- }
+ borderColor: $(".box").css("background-color"),
+ },
},
legend: {
- display: false
+ display: false,
},
tooltips: {
enabled: false,
@@ -1108,14 +1108,14 @@ $(function () {
},
label: function (tooltipItems, data) {
return doughnutTooltip(tooltipItems, data);
- }
- }
+ },
+ },
},
animation: {
- duration: 750
+ duration: 750,
},
- cutoutPercentage: 0
- }
+ cutoutPercentage: 0,
+ },
});
// Pull in data via AJAX
diff --git a/scripts/pi-hole/js/ip-address-sorting.js b/scripts/pi-hole/js/ip-address-sorting.js
index 03c15bdf..ecc3aa5f 100644
--- a/scripts/pi-hole/js/ip-address-sorting.js
+++ b/scripts/pi-hole/js/ip-address-sorting.js
@@ -115,5 +115,5 @@ $.extend($.fn.dataTableExt.oSort, {
"ip-address-desc": function (a, b) {
return a < b ? 1 : a > b ? -1 : 0;
- }
+ },
});
diff --git a/scripts/pi-hole/js/messages.js b/scripts/pi-hole/js/messages.js
index 115466d5..e9728508 100644
--- a/scripts/pi-hole/js/messages.js
+++ b/scripts/pi-hole/js/messages.js
@@ -88,7 +88,7 @@ $(function () {
url: "api_db.php?messages",
data: { token: token },
type: "POST",
- dataSrc: "messages"
+ dataSrc: "messages",
},
order: [[0, "asc"]],
columns: [
@@ -100,7 +100,7 @@ $(function () {
{ data: "blob2", visible: false },
{ data: "blob3", visible: false },
{ data: "blob4", visible: false },
- { data: "blob5", visible: false }
+ { data: "blob5", visible: false },
],
dom:
"<'row'<'col-sm-4'l><'col-sm-8'f>>" +
@@ -108,10 +108,10 @@ $(function () {
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
lengthMenu: [
[10, 25, 50, 100, -1],
- [10, 25, 50, 100, "All"]
+ [10, 25, 50, 100, "All"],
],
language: {
- emptyTable: "No issues found."
+ emptyTable: "No issues found.",
},
stateSave: true,
stateSaveCallback: function (settings, data) {
@@ -134,6 +134,6 @@ $(function () {
// Apply loaded state to table
return data;
- }
+ },
});
});
diff --git a/scripts/pi-hole/js/network.js b/scripts/pi-hole/js/network.js
index fbe915f0..23e27926 100644
--- a/scripts/pi-hole/js/network.js
+++ b/scripts/pi-hole/js/network.js
@@ -47,7 +47,7 @@ function mixColors(ratio, rgb1, rgb2) {
return [
(1 - ratio) * rgb1[0] + ratio * rgb2[0],
(1 - ratio) * rgb1[1] + ratio * rgb2[1],
- (1 - ratio) * rgb1[2] + ratio * rgb2[2]
+ (1 - ratio) * rgb1[2] + ratio * rgb2[2],
];
}
@@ -194,7 +194,7 @@ $(function () {
}
return data;
- }
+ },
},
{
data: "lastQuery",
@@ -205,14 +205,14 @@ $(function () {
}
return data;
- }
+ },
},
{ data: "numQueries", width: "9%", render: $.fn.dataTable.render.text() },
- { data: "", width: "6%", orderable: false }
+ { data: "", width: "6%", orderable: false },
],
lengthMenu: [
[10, 25, 50, 100, -1],
- [10, 25, 50, 100, "All"]
+ [10, 25, 50, 100, "All"],
],
stateSave: true,
stateSaveCallback: function (settings, data) {
@@ -225,9 +225,9 @@ $(function () {
{
targets: -1,
data: null,
- defaultContent: ""
- }
- ]
+ defaultContent: "",
+ },
+ ],
});
// Disable autocorrect in the search box
var input = document.querySelector("input[type=search]");
diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js
index d138d99c..6053b7df 100644
--- a/scripts/pi-hole/js/queries.js
+++ b/scripts/pi-hole/js/queries.js
@@ -21,7 +21,7 @@ var replyTypes = [
"SERVFAIL",
"REFUSED",
"NOTIMP",
- "upstream error"
+ "upstream error",
];
var colTypes = ["time", "query type", "domain", "client", "status", "reply type"];
@@ -282,7 +282,7 @@ $(function () {
x[6] = dnssec;
return x;
});
- }
+ },
},
autoWidth: false,
processing: true,
@@ -298,18 +298,18 @@ $(function () {
}
return data;
- }
+ },
},
{ width: "4%" },
{ width: "36%", render: $.fn.dataTable.render.text() },
{ width: "8%", type: "ip-address", render: $.fn.dataTable.render.text() },
{ width: "14%", orderData: 4 },
{ width: "8%", orderData: 5 },
- { width: "10%", orderData: 4 }
+ { width: "10%", orderData: 4 },
],
lengthMenu: [
[10, 25, 50, 100, -1],
- [10, 25, 50, 100, "All"]
+ [10, 25, 50, 100, "All"],
],
stateSave: true,
stateSaveCallback: function (settings, data) {
@@ -322,8 +322,8 @@ $(function () {
{
targets: -1,
data: null,
- defaultContent: ""
- }
+ defaultContent: "",
+ },
],
initComplete: function () {
var api = this.api();
@@ -416,7 +416,7 @@ $(function () {
input.attr("spellcheck", false);
input.attr("placeholder", "Type / Domain / Client");
}
- }
+ },
});
resetColumnsFilters();
diff --git a/scripts/pi-hole/js/queryads.js b/scripts/pi-hole/js/queryads.js
index 6330e61a..e97578e7 100644
--- a/scripts/pi-hole/js/queryads.js
+++ b/scripts/pi-hole/js/queryads.js
@@ -40,7 +40,7 @@ function eventsource() {
$.ajax({
method: "GET",
url: "scripts/pi-hole/php/queryads.php?domain=" + domain.toLowerCase() + "&" + exact + "&IE",
- async: false
+ async: false,
}).done(function (data) {
ta.show();
ta.empty();
diff --git a/scripts/pi-hole/js/settings.js b/scripts/pi-hole/js/settings.js
index 6853e0c7..dd407348 100644
--- a/scripts/pi-hole/js/settings.js
+++ b/scripts/pi-hole/js/settings.js
@@ -33,7 +33,7 @@ $(".confirm-poweroff").confirm({
post: true,
confirmButtonClass: "btn-danger",
cancelButtonClass: "btn-success",
- dialogClass: "modal-dialog"
+ dialogClass: "modal-dialog",
});
$(".confirm-reboot").confirm({
text: "Are you sure you want to send a reboot command to your Pi-hole?",
@@ -49,7 +49,7 @@ $(".confirm-reboot").confirm({
post: true,
confirmButtonClass: "btn-danger",
cancelButtonClass: "btn-success",
- dialogClass: "modal-dialog"
+ dialogClass: "modal-dialog",
});
$(".confirm-restartdns").confirm({
@@ -66,7 +66,7 @@ $(".confirm-restartdns").confirm({
post: true,
confirmButtonClass: "btn-danger",
cancelButtonClass: "btn-success",
- dialogClass: "modal-dialog"
+ dialogClass: "modal-dialog",
});
$(".confirm-flushlogs").confirm({
@@ -83,7 +83,7 @@ $(".confirm-flushlogs").confirm({
post: true,
confirmButtonClass: "btn-danger",
cancelButtonClass: "btn-success",
- dialogClass: "modal-dialog"
+ dialogClass: "modal-dialog",
});
$(".confirm-flusharp").confirm({
@@ -100,7 +100,7 @@ $(".confirm-flusharp").confirm({
post: true,
confirmButtonClass: "btn-warning",
cancelButtonClass: "btn-success",
- dialogClass: "modal-dialog"
+ dialogClass: "modal-dialog",
});
$(".confirm-disablelogging-noflush").confirm({
@@ -117,7 +117,7 @@ $(".confirm-disablelogging-noflush").confirm({
post: true,
confirmButtonClass: "btn-warning",
cancelButtonClass: "btn-success",
- dialogClass: "modal-dialog"
+ dialogClass: "modal-dialog",
});
$(".api-token").confirm({
@@ -135,7 +135,7 @@ $(".api-token").confirm({
post: true,
confirmButtonClass: "btn-danger",
cancelButtonClass: "btn-success",
- dialogClass: "modal-dialog"
+ dialogClass: "modal-dialog",
});
$("#DHCPchk").click(function () {
@@ -184,7 +184,7 @@ $(function () {
},
stateLoadCallback: function () {
return utils.stateLoadCallback("activeDhcpLeaseTable");
- }
+ },
});
}
@@ -203,7 +203,7 @@ $(function () {
},
stateLoadCallback: function () {
return utils.stateLoadCallback("staticDhcpLeaseTable");
- }
+ },
});
}
@@ -300,7 +300,7 @@ $('button[id="removedynamic"]').on("click", function () {
dataType: "json",
data: {
delete_lease: ipaddr,
- token: token
+ token: token,
},
success: function (response) {
utils.enableAll();
@@ -326,6 +326,6 @@ $('button[id="removedynamic"]').on("click", function () {
utils.enableAll();
utils.showAlert("error", "Error while deleting DHCP lease for " + ipname, jqXHR.responseText);
console.log(exception); // eslint-disable-line no-console
- }
+ },
});
});
diff --git a/scripts/pi-hole/js/utils.js b/scripts/pi-hole/js/utils.js
index 468fb441..cad11975 100644
--- a/scripts/pi-hole/js/utils.js
+++ b/scripts/pi-hole/js/utils.js
@@ -14,7 +14,7 @@ function escapeHtml(text) {
"<": "<",
">": ">",
'"': """,
- "'": "'"
+ "'": "'",
};
if (text === null) return null;
@@ -30,7 +30,7 @@ function unescapeHtml(text) {
"<": "<",
">": ">",
""": '"',
- "'": "'"
+ "'": "'",
};
if (text === null) return null;
@@ -72,7 +72,7 @@ function showAlert(type, icon, title, message) {
type: "info",
icon: "far fa-clock",
title: title,
- message: message
+ message: message,
};
info = $.notify(opts);
break;
@@ -81,7 +81,7 @@ function showAlert(type, icon, title, message) {
type: "success",
icon: icon,
title: title,
- message: message
+ message: message,
};
if (info) {
info.update(opts);
@@ -95,7 +95,7 @@ function showAlert(type, icon, title, message) {
type: "warning",
icon: "fas fa-exclamation-triangle",
title: title,
- message: message
+ message: message,
};
if (info) {
info.update(opts);
@@ -109,7 +109,7 @@ function showAlert(type, icon, title, message) {
type: "danger",
icon: "fas fa-times",
title: " Error, something went wrong!
",
- message: message
+ message: message,
};
if (info) {
info.update(opts);
@@ -284,7 +284,7 @@ function addFromQueryLog(domain, list) {
list: list,
token: token,
action: "replace_domain",
- comment: "Added from Query Log"
+ comment: "Added from Query Log",
},
success: function (response) {
alProcessing.hide();
@@ -314,7 +314,7 @@ function addFromQueryLog(domain, list) {
setTimeout(function () {
alertModal.modal("hide");
}, 8000);
- }
+ },
});
});
@@ -346,6 +346,6 @@ window.utils = (function () {
getGraphType: getGraphType,
validateMAC: validateMAC,
validateHostname: validateHostname,
- addFromQueryLog: addFromQueryLog
+ addFromQueryLog: addFromQueryLog,
};
})();