Add DNS reply statistics to settings page

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-02-11 10:50:41 +01:00
parent 69eb8bf3d0
commit c8bdc58fb4
2 changed files with 156 additions and 79 deletions

View File

@@ -63,7 +63,26 @@ function updateCacheInfo() {
$("#sysinfo-cache-valid-ds").text(cache.valid.ds);
$("#sysinfo-cache-valid-dnskey").text(cache.valid.dnskey);
$("#sysinfo-cache-valid-other").text(cache.valid.other);
$("#sysinfo-cache-overlay").hide();
var total =
cache.optimized + cache.local + cache.auth + cache.extra.unanswered + cache.extra.forwarded;
$("#sysinfo-replies-optimized").text(
cache.optimized + " (" + ((100 * cache.optimized) / total).toFixed(1) + "%)"
);
$("#sysinfo-replies-local").text(
cache.local + " (" + ((100 * cache.local) / total).toFixed(1) + "%)"
);
$("#sysinfo-replies-auth").text(
cache.auth + " (" + ((100 * cache.auth) / total).toFixed(1) + "%)"
);
$("#sysinfo-replies-extra-unanswered").text(
cache.extra.unanswered + " (" + ((100 * cache.extra.unanswered) / total).toFixed(1) + "%)"
);
$("#sysinfo-replies-extra-forwarded").text(
cache.extra.forwarded + " (" + ((100 * cache.extra.forwarded) / total).toFixed(1) + "%)"
);
$("#sysinfo-dns-overlay").hide();
// Update every 10 seconds
clearTimeout(cacheinfoTimer);
cacheinfoTimer = setTimeout(updateCacheInfo, 10000);