diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-06-03 10:03:48 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-06-03 10:03:48 +0200 |
commit | dc0cfc642e42eefcac91bb965f9aa612089fad5d (patch) | |
tree | 2dd2154c3eb395469c841f2612b44e0e1182624f /applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js | |
parent | bc1015f7db57506b2468846f79dbd5bfe0dbea7a (diff) |
luci-app-firewall: further luci-rpc/getHostHints compatibility fixes
Rework some further code instances to fall back to the legacy ipv4/ipv6
properties if needed.
Fixes: c7b7b42cd3 ("treewide: Update JS using luci-rpc getHostHints")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js')
-rw-r--r-- | applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js index 1f2eff3747..3f6a309033 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js @@ -398,11 +398,11 @@ return baseclass.extend({ ipaddrs = {}; for (var mac in hosts) { - L.toArray(hosts[mac].ipaddrs).forEach(function(ip) { + L.toArray(hosts[mac].ipaddrs || hosts[mac].ipv4).forEach(function(ip) { ipaddrs[ip] = mac; }); - L.toArray(hosts[mac].ip6addrs).forEach(function(ip) { + L.toArray(hosts[mac].ip6addrs || hosts[mac].ipv6).forEach(function(ip) { ip6addrs[ip] = mac; }); } @@ -511,8 +511,9 @@ return baseclass.extend({ L.sortedKeys(hosts).forEach(function(mac) { o.value(mac, E([], [ mac, ' (', E('strong', {}, [ hosts[mac].name || - (hosts[mac].ipaddrs && hosts[mac].ipaddrs.length && hosts[mac].ipaddrs[0]) || - (hosts[mac].ip6addrs && hosts[mac].ip6addrs.length && hosts[mac].ip6addrs[0]) || '?' + L.toArray(hosts[mac].ipaddrs || hosts[mac].ipv4)[0] || + L.toArray(hosts[mac].ip6addrs || hosts[mac].ipv6)[0] || + '?' ]), ')' ])); }); |