diff options
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/network.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index 235ea1e418..106139f267 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -1307,6 +1307,18 @@ Hosts = L.Class.extend({ if (this.hosts[mac].ipv6 == ip6addr) return mac; return null; + }, + + getMACHints: function(preferIp6) { + var rv = []; + for (var mac in this.hosts) { + var hint = this.hosts[mac].name || + this.hosts[mac][preferIp6 ? 'ipv6' : 'ipv4'] || + this.hosts[mac][preferIp6 ? 'ipv4' : 'ipv6']; + + rv.push([mac, hint]); + } + return rv.sort(function(a, b) { return a[0] > b[0] }); } }); |