Show at only the three most recent IP addresses for each device. The hover text of contains all IP addresses.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-06-14 19:17:52 +02:00
parent 0895a6f044
commit 425b6ba5a7
2 changed files with 13 additions and 7 deletions

View File

@@ -8,6 +8,9 @@ var tableApi;
var APIstring = "api_db.php?network";
// How many IPs do we show at most per device?
var MAXIPDISPLAY = 3;
function refreshData() {
tableApi.ajax.url(APIstring).load();
}
@@ -113,12 +116,15 @@ $(document).ready(function() {
// Set number of queries to localized string (add thousand separators)
$("td:eq(6)", row).html(data["numQueries"].toLocaleString());
// Client -> jump to Query Log on click
$("td:eq(0)", row).click( function () { openInNewTab("/admin/queries.php?client="+this.innerHTML); } );
$("td:eq(0)", row).css("cursor","pointer");
$("td:eq(0)", row).hover(
function () { this.title="Click to show recent queries made by "+this.innerHTML; this.style.color="#72afd2"; },
function () { this.style.color=""; } );
var ips = data["ip"];
var shortips = ips;
if(ips.length > MAXIPDISPLAY)
{
shortips = ips.slice(0,MAXIPDISPLAY-1);
shortips.push("...");
}
$("td:eq(0)", row).html(shortips.join("<br>"));
$("td:eq(0)", row).hover(function () { this.title=ips.join("\n");});
// MAC + Vendor field if available
if(data["macVendor"] && data["macVendor"].length > 0)