projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3734f88
)
luci-base: network.js: implement Hosts.getMACHints()
author
Jo-Philipp Wich
<jo@mein.io>
Fri, 13 Sep 2019 12:18:43 +0000
(14:18 +0200)
committer
Jo-Philipp Wich
<jo@mein.io>
Fri, 13 Sep 2019 12:18:43 +0000
(14:18 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/network.js
patch
|
blob
|
history
diff --git
a/modules/luci-base/htdocs/luci-static/resources/network.js
b/modules/luci-base/htdocs/luci-static/resources/network.js
index 235ea1e418f5adad74181e2ff0cf17505ef4fc56..106139f267e4210614b92c113f04c040687b0a2b 100644
(file)
--- 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] });
}
});