Add support for multiple hostnames per client (hardware address).

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-05-14 18:32:10 +02:00
parent 68b99658ad
commit 3e1a1f59aa
3 changed files with 38 additions and 8 deletions

View File

@@ -108,8 +108,26 @@ $(document).ready(function () {
// Set hostname to "unknown" if not available
if (!data.name || data.name.length === 0) {
$("td:eq(3)", row).html("<em>unknown</em>");
} else {
var names = [];
var maxiter = Math.min(data.name.length, MAXIPDISPLAY);
for (var index = 0; index < maxiter; index++) {
var name = data.name[index];
names.push('<a href="queries.php?client=' + name + '">' + name + "</a>");
}
if (data.name.length > MAXIPDISPLAY) {
// We hit the maximum above, add "..." to symbolize we would
// have more to show here
names.push("...");
}
$("td:eq(3)", row).html(names.join("<br>"));
$("td:eq(3)", row).hover(function () {
this.title = data.name.join("\n");
});
}
// Set number of queries to localized string (add thousand separators)
$("td:eq(6)", row).html(data.numQueries.toLocaleString());