diff options
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/luasrc/model/network.lua | 14 | ||||
-rw-r--r-- | modules/luci-base/luasrc/view/cbi/network_ifacelist.htm | 14 |
2 files changed, 21 insertions, 7 deletions
diff --git a/modules/luci-base/luasrc/model/network.lua b/modules/luci-base/luasrc/model/network.lua index 78df72da24..cce559aab1 100644 --- a/modules/luci-base/luasrc/model/network.lua +++ b/modules/luci-base/luasrc/model/network.lua @@ -1348,7 +1348,9 @@ function interface.ip6addrs(self) end function interface.type(self) - if self.wif or _wifi_iface(self.ifname) then + if self.ifname and self.ifname:byte(1) == 64 then + return "alias" + elseif self.wif or _wifi_iface(self.ifname) then return "wifi" elseif _bridge[self.ifname] then return "bridge" @@ -1385,7 +1387,9 @@ end function interface.get_type_i18n(self) local x = self:type() - if x == "wifi" then + if x == "alias" then + return lng.translate("Alias Interface") + elseif x == "wifi" then return lng.translate("Wireless Adapter") elseif x == "bridge" then return lng.translate("Bridge") @@ -1438,7 +1442,11 @@ function interface.bridge_stp(self) end function interface.is_up(self) - return self:_ubus("up") or false + local up = self:_ubus("up") + if up == nil then + up = (self:type() == "alias") + end + return up or false end function interface.is_bridge(self) diff --git a/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm b/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm index abfa33e1ed..a97e9ef6d0 100644 --- a/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm +++ b/modules/luci-base/luasrc/view/cbi/network_ifacelist.htm @@ -26,9 +26,14 @@ else local n = self.network and net:get_network(self.network) if n then - local i - for _, i in ipairs(n:get_interfaces() or { n:get_interface() }) do - checked[i:name()] = true + local a = n:is_alias() + if a then + 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 @@ -50,7 +55,8 @@ --></script> <ul> <% 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 iface:name() ~= self.exclude then %> |