Make IP addresses links that send to the Query Log.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-01-20 19:35:43 +01:00
parent 3cac308e72
commit 86f56ee5df

View File

@@ -101,16 +101,21 @@ $(document).ready(function() {
// Set number of queries to localized string (add thousand separators)
$("td:eq(6)", row).html(data.numQueries.toLocaleString());
var ips = data.ip;
var shortips = ips;
if (ips.length > MAXIPDISPLAY) {
shortips = ips.slice(0, MAXIPDISPLAY - 1);
shortips.push("...");
var ips = [];
var maxiter = Math.min(data.ip.length, MAXIPDISPLAY);
for (let index = 0; index < maxiter; index++) {
var ip = data.ip[index];
ips.push('<a href="queries.php?client=' + ip + '">' + ip + '</a>');
}
if (data.ip.length > MAXIPDISPLAY) {
// We hit the maximum above, add "..." to symbolize we would
// have more to show here
ips.push("...");
}
$("td:eq(0)", row).html(shortips.join("<br>"));
$("td:eq(0)", row).html(ips.join("<br>"));
$("td:eq(0)", row).hover(function() {
this.title = ips.join("\n");
this.title = data.ip.join("\n");
});
// MAC + Vendor field if available