X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=modules%2Fluci-mod-admin-full%2Fluasrc%2Fview%2Fadmin_status%2Findex.htm;h=ff5e26de94114c5c8fa068eeb8b5dbe3e7652c55;hb=8b39d9a76b6efcf618fe3ca527ca3e593deacaf0;hp=d29a89427687738fca1b2493134ac8c01ecc8f9f;hpb=1b42d7a02df97c77ff9653de5e53b115610b3121;p=project%2Fluci.git 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 d29a89427..ff5e26de9 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 @@ -38,7 +38,7 @@ local wan6 = ntm:get_wan6net() local conn_count = tonumber( - fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count")) or 0 + fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count") or "") or 0 local conn_max = tonumber(( luci.sys.exec("sysctl net.nf_conntrack_max") or @@ -150,7 +150,7 @@ return duid.substr(16).replace(/(..)(?=..)/g, '$1:').toUpperCase(); // DUID-LL / Ethernet - if (duid.length === 24 && duid.substr(0, 8) === '00030001') + if (duid.length === 20 && duid.substr(0, 8) === '00030001') return duid.substr(8).replace(/(..)(?=..)/g, '$1:').toUpperCase(); return null; @@ -417,15 +417,16 @@ tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1); var host = hosts[duid2mac(info.leases6[i].duid)]; - if (host) - tr.insertCell(-1).innerHTML = String.format( - '
%s
', - ((host.name && (host.ipv4 || host.ipv6)) - ? '%h (%s)'.format(host.name, host.ipv4 || host.ipv6) - : '%h'.format(host.name || host.ipv4 || host.ipv6)).nobr() - ); + if (!info.leases6[i].hostname) + tr.insertCell(-1).innerHTML = + (host && (host.name || host.ipv4 || host.ipv6)) + ? '
? (%h)
'.format(host.name || host.ipv4 || host.ipv6) + : '?'; else - tr.insertCell(-1).innerHTML = info.leases6[i].hostname ? info.leases6[i].hostname : '?'; + tr.insertCell(-1).innerHTML = + (host && host.name && info.leases6[i].hostname != host.name) + ? '
%h (%h)
'.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;