Add a tooltip to the dashboard showing the last time gravity was updated (#3134)
CodeQL / Analyze (push) Waiting to run
Codespell / spell-check (push) Waiting to run
editorconfig-checker / editorconfig-checker (push) Waiting to run
Check for merge conflicts / main (push) Waiting to run
Tests / Node (push) Waiting to run

This commit is contained in:
RD WebDesign
2024-09-03 15:05:36 -03:00
committed by GitHub
+13
View File
@@ -416,6 +416,19 @@ function updateSummaryData(runOnce = false) {
$("span#percent_blocked").text(formattedPercentage);
$("span#gravity_size").text(intl.format(parseInt(data.gravity.domains_being_blocked, 10)));
const lastupdate = parseInt(data.gravity.last_update, 10);
var updatetxt = "Lists were never updated";
if (lastupdate > 0) {
updatetxt =
"Lists updated " +
utils.datetimeRelative(lastupdate) +
"\n(" +
utils.datetime(lastupdate, false, false) +
")";
}
$(".small-box:has(#gravity_size)").attr("title", updatetxt);
if (2 * previousCount < newCount && newCount > 100 && !firstSummaryUpdate) {
// Update the charts if the number of queries has increased significantly
// Do not run this on the first update as reloading the same data after