summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2017-11-16 08:22:14 +0100
committerMathias Kresin <dev@kresin.me>2017-11-17 01:37:21 +0100
commit0a2c7b9e5c1745e28451825c838fc38752bebf60 (patch)
treec59793eb8d57d30588b20833f1ec9cb0573961ca /modules
parent9f5a1de8b1f32c30c6f9c0ade42b418ce0aeacd4 (diff)
luci-mod-admin-full: indicate DHCPv6 hostname mismatch
In case the DUID can be mapped to the MAC-Address of an already known host, show the already know hostname next to the DHCPv6 supplied one in case they differ. Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm5
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm5
2 files changed, 8 insertions, 2 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
index 1f50db5b9..ea6ee91c7 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
@@ -84,7 +84,10 @@
? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">? (%h)</div>'.format(host.name || host.ipv4 || host.ipv6)
: '?';
else
- tr.insertCell(-1).innerHTML = st[1][i].hostname;
+ tr.insertCell(-1).innerHTML =
+ (host && host.name && st[1][i].hostname != host.name)
+ ? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">%h (%h)</div>'.format(st[1][i].hostname, host.name)
+ : st[1][i].hostname;
tr.insertCell(-1).innerHTML = st[1][i].ip6addr;
tr.insertCell(-1).innerHTML = st[1][i].duid;
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
index 626532e1b..9f44ac76d 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
@@ -423,7 +423,10 @@
? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">? (%h)</div>'.format(host.name || host.ipv4 || host.ipv6)
: '?';
else
- tr.insertCell(-1).innerHTML = info.leases6[i].hostname;
+ tr.insertCell(-1).innerHTML =
+ (host && host.name && info.leases6[i].hostname != host.name)
+ ? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">%h (%h)</div>'.format(info.leases6[i].hostname, host.name)
+ : info.leases6[i].hostname;
tr.insertCell(-1).innerHTML = info.leases6[i].ip6addr;
tr.insertCell(-1).innerHTML = info.leases6[i].duid;