luci-mod-admin-full: indicate DHCPv6 hostname mismatch 1452/head
authorMathias Kresin <dev@kresin.me>
Thu, 16 Nov 2017 07:22:14 +0000 (08:22 +0100)
committerMathias Kresin <dev@kresin.me>
Fri, 17 Nov 2017 00:37:21 +0000 (01:37 +0100)
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>
modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm

index 1f50db5b9e45ac3df63d7c61926ad5513b093f5b..ea6ee91c7146f8e32a61a3b6c04e0b50a8e5f133 100644 (file)
                                                                ? '<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;
index 626532e1b9bb50ede8478192786cf78a281f0d05..9f44ac76d5b78c94ee32ae7756fe7f58f098d5da 100644 (file)
                                                                ? '<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;