mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Fix gravity count when FTL fails to return this value (#3160)
This commit is contained in:
@@ -414,7 +414,6 @@ function updateSummaryData(runOnce = false) {
|
|||||||
$("span#blocked_queries").text(intl.format(parseFloat(data.queries.blocked)));
|
$("span#blocked_queries").text(intl.format(parseFloat(data.queries.blocked)));
|
||||||
var formattedPercentage = utils.toPercent(data.queries.percent_blocked, 1);
|
var formattedPercentage = utils.toPercent(data.queries.percent_blocked, 1);
|
||||||
$("span#percent_blocked").text(formattedPercentage);
|
$("span#percent_blocked").text(formattedPercentage);
|
||||||
$("span#gravity_size").text(intl.format(parseInt(data.gravity.domains_being_blocked, 10)));
|
|
||||||
updateQueryFrequency(intl, data.queries.frequency);
|
updateQueryFrequency(intl, data.queries.frequency);
|
||||||
|
|
||||||
const lastupdate = parseInt(data.gravity.last_update, 10);
|
const lastupdate = parseInt(data.gravity.last_update, 10);
|
||||||
@@ -428,6 +427,15 @@ function updateSummaryData(runOnce = false) {
|
|||||||
")";
|
")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const gravityCount = parseInt(data.gravity.domains_being_blocked, 10);
|
||||||
|
if (gravityCount < 0) {
|
||||||
|
// Error. Change the title text and show the error code in parentheses
|
||||||
|
updatetxt = "Error! Update gravity to reset this value.";
|
||||||
|
$("span#gravity_size").text("Error (" + gravityCount + ")");
|
||||||
|
} else {
|
||||||
|
$("span#gravity_size").text(intl.format(gravityCount));
|
||||||
|
}
|
||||||
|
|
||||||
$(".small-box:has(#gravity_size)").attr("title", updatetxt);
|
$(".small-box:has(#gravity_size)").attr("title", updatetxt);
|
||||||
|
|
||||||
if (2 * previousCount < newCount && newCount > 100 && !firstSummaryUpdate) {
|
if (2 * previousCount < newCount && newCount > 100 && !firstSummaryUpdate) {
|
||||||
|
|||||||
Reference in New Issue
Block a user