Show active instead of clients-ever-seen on the dashboard (#2769)

This commit is contained in:
DL6ER
2023-10-22 19:51:30 +02:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@@ -22,8 +22,8 @@ mg.include('scripts/pi-hole/lua/header_authenticated.lp','r')
<div class="icon">
<i class="fas fa-globe-americas"></i>
</div>
<a href="network.lp" class="small-box-footer" title="">
<span id="total_clients">-</span> active clients <i class="fa fa-arrow-circle-right"></i>
<a href="network.lp" class="small-box-footer" title="" id="total_clients">
<span id="active_clients">-</span> active clients <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -384,7 +384,11 @@ function updateSummaryData(runOnce) {
$.getJSON("/api/stats/summary", function (data) {
var intl = new Intl.NumberFormat();
glowIfChanged($("span#dns_queries"), intl.format(parseInt(data.queries.total, 10)));
glowIfChanged($("span#total_clients"), intl.format(parseInt(data.clients.total, 10)));
glowIfChanged($("span#active_clients"), intl.format(parseInt(data.clients.active, 10)));
$("a#total_clients").attr(
"title",
intl.format(parseInt(data.clients.total, 10)) + " total clients"
);
glowIfChanged($("span#blocked_queries"), intl.format(parseFloat(data.queries.blocked)));
glowIfChanged(
$("span#percent_blocked"),