Skip to content

Commit

Permalink
Update summary data with new count
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Jun 29, 2024
1 parent 22fe50f commit 2174eaa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/pi-hole/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,6 @@ function updateSummaryData(runOnce = false) {
$.getJSON("/api/stats/summary", function (data) {
var intl = new Intl.NumberFormat();
const newCount = parseInt(data.queries.total, 10);
if (previousCount === 0) {
previousCount = newCount;
}

$("span#dns_queries").text(intl.format(newCount));
$("span#active_clients").text(intl.format(parseInt(data.clients.active, 10)));
Expand All @@ -422,6 +419,8 @@ function updateSummaryData(runOnce = false) {
updateForwardDestinationsPie();
updateTopLists();
}

previousCount = newCount;
})
.done(function () {
if (!runOnce) utils.setTimer(updateSummaryData, REFRESH_INTERVAL.summary);
Expand Down

0 comments on commit 2174eaa

Please sign in to comment.