Skip to content

Commit

Permalink
Add a tooltip to the dashboard showing the last time gravity was upda…
Browse files Browse the repository at this point in the history
…ted (#3134)
  • Loading branch information
rdwebdesign authored Sep 3, 2024
2 parents edc5ba0 + 18d6613 commit 87aaff1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/pi-hole/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 87aaff1

Please sign in to comment.