luci-base: fix handling alias interfaces in ifacelist widget

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2018-07-15 17:20:27 +02:00
parent 37aeb77dda
commit ffff1e7c0a

View file

@ -26,9 +26,14 @@
else else
local n = self.network and net:get_network(self.network) local n = self.network and net:get_network(self.network)
if n then if n then
local i local a = n:is_alias()
for _, i in ipairs(n:get_interfaces() or { n:get_interface() }) do if a then
checked[i:name()] = true checked['@' .. a] = true
else
local i
for _, i in ipairs(n:get_interfaces() or { n:get_interface() }) do
checked[i:name()] = true
end
end end
end end
end end
@ -50,7 +55,8 @@
--></script> --></script>
<ul> <ul>
<% for _, iface in ipairs(ifaces) do <% for _, iface in ipairs(ifaces) do
if (not self.nobridges or not iface:is_bridge()) and if (not self.noaliases or iface:type() ~= "alias") and
(not self.nobridges or not iface:is_bridge()) and
(not self.noinactive or iface:is_up()) and (not self.noinactive or iface:is_up()) and
iface:name() ~= self.exclude iface:name() ~= self.exclude
then %> then %>