Convert q/s to q/m if there aren't all that many queries on this Pi-hole

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2024-09-07 06:25:27 +02:00
parent 15c072bb01
commit e2b9771f05

View File

@@ -234,13 +234,23 @@ function updateInfo() {
}
function updateQueryFrequency(intl, frequency) {
let freq = parseFloat(frequency);
let unit = "q/s";
let title = "Queries per second";
if (freq < 0.5) {
freq *= 60;
unit = "q/m";
title = "Queries per minute";
}
$("#query_frequency")
.html(
'<i class="fa fa-fw fa-clock-rotate-left text-green-light"></i>&nbsp;&nbsp;' +
intl.format(parseFloat(frequency)) +
" q/s"
'<i class="fa fa-fw fa-gauge-high text-green-light"></i>&nbsp;&nbsp;' +
intl.format(freq) +
"&thinsp;" +
unit
)
.attr("title", "Queries per second");
.attr("title", title);
}
var ftlinfoTimer = null;