mirror of
https://github.com/pi-hole/web.git
synced 2025-12-23 20:28:28 +00:00
Merge branch 'devel' into new/nonfatal-dnsmasq-warnings
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -360,6 +360,26 @@ function colorBar(percentage, total, cssClass) {
|
||||
return '<div class="progress progress-sm" title="' + title + '"> ' + bar + " </div>";
|
||||
}
|
||||
|
||||
function checkMessages() {
|
||||
var ignoreNonfatal = localStorage
|
||||
? localStorage.getItem("hideNonfatalDnsmasqWarnings_chkbox") === "true"
|
||||
: false;
|
||||
$.getJSON("api_db.php?status" + (ignoreNonfatal ? "&ignore=DNSMASQ_WARN" : ""), function (data) {
|
||||
if ("message_count" in data && data.message_count > 0) {
|
||||
var title =
|
||||
data.message_count > 1
|
||||
? "There are " + data.message_count + " warnings. Click for further details."
|
||||
: "There is one warning. Click for further details.";
|
||||
|
||||
$("#pihole-diagnosis").prop("title", title);
|
||||
$("#pihole-diagnosis-count").text(data.message_count);
|
||||
$("#pihole-diagnosis").removeClass("hidden");
|
||||
} else {
|
||||
$("#pihole-diagnosis").addClass("hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.utils = (function () {
|
||||
return {
|
||||
escapeHtml: escapeHtml,
|
||||
@@ -382,5 +402,6 @@ window.utils = (function () {
|
||||
addFromQueryLog: addFromQueryLog,
|
||||
addTD: addTD,
|
||||
colorBar: colorBar,
|
||||
checkMessages: checkMessages,
|
||||
};
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user