From 8c158eb7ba28501fdf201d828596bc8066934d1f Mon Sep 17 00:00:00 2001 From: Promofaux Date: Fri, 9 Dec 2016 23:13:11 +0000 Subject: [PATCH 1/2] add percentage tool tip to Top Clients progress bars, as with Top Domains and Top Advertisers --- js/pihole/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/pihole/index.js b/js/pihole/index.js index 944062c0..91609ef9 100644 --- a/js/pihole/index.js +++ b/js/pihole/index.js @@ -295,10 +295,12 @@ function updateTopClientsChart() { for (domain in data.top_sources) { // Sanitize domain domain = escapeHtml(domain); + var url = ""+domain+""; + percentage = data.top_sources[domain] / data.dns_queries_today * 100; clienttable.append(" " + url + - ' ' + data.top_sources[domain] + '
'); + " " + data.top_sources[domain] + "
"); } $('#client-frequency .overlay').remove(); From bba2e38518f3242c3304737dcfdad4273a65d808 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 10 Dec 2016 09:57:10 +0100 Subject: [PATCH 2/2] Add definition for variable 'percentage' --- js/pihole/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/pihole/index.js b/js/pihole/index.js index 91609ef9..af7f7165 100644 --- a/js/pihole/index.js +++ b/js/pihole/index.js @@ -291,7 +291,7 @@ function escapeHtml(text) { function updateTopClientsChart() { $.getJSON("api.php?summaryRaw&getQuerySources", function(data) { var clienttable = $('#client-frequency').find('tbody:last'); - var domain; + var domain, percentage; for (domain in data.top_sources) { // Sanitize domain domain = escapeHtml(domain);