mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Top Clients List: Show IP address of host name when hovering over the link
This commit is contained in:
@@ -132,7 +132,7 @@ function escapeHtml(text) {
|
||||
function updateTopClientsChart() {
|
||||
$.getJSON("api.php?summaryRaw&getQuerySources", function(data) {
|
||||
var clienttable = $("#client-frequency").find("tbody:last");
|
||||
var domain, percentage, domainname;
|
||||
var domain, percentage, domainname, domainip;
|
||||
for (domain in data.top_sources) {
|
||||
|
||||
if ({}.hasOwnProperty.call(data.top_sources, domain)){
|
||||
@@ -140,14 +140,17 @@ function updateTopClientsChart() {
|
||||
domain = escapeHtml(domain);
|
||||
if(domain.indexOf("|") > -1)
|
||||
{
|
||||
domainname = domain.substr(0, domain.indexOf("|"));
|
||||
var idx = domain.indexOf("|");
|
||||
domainname = domain.substr(0, idx);
|
||||
domainip = domain.substr(idx+1, domain.length-idx);
|
||||
}
|
||||
else
|
||||
{
|
||||
domainname = domain;
|
||||
domainip = domain;
|
||||
}
|
||||
|
||||
var url = "<a href=\"queries.php?client="+domain+"\">"+domainname+"</a>";
|
||||
var url = "<a href=\"queries.php?client="+domain+"\" title=\""+domainip+"\">"+domainname+"</a>";
|
||||
percentage = data.top_sources[domain] / data.dns_queries_today * 100;
|
||||
clienttable.append("<tr> <td>" + url +
|
||||
"</td> <td>" + data.top_sources[domain] + "</td> <td> <div class=\"progress progress-sm\" title=\""+percentage.toFixed(1)+"%\"> <div class=\"progress-bar progress-bar-blue\" style=\"width: " +
|
||||
|
||||
Reference in New Issue
Block a user