luci-base: luci.model.network: recognize alias interfaces
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
a48a142599
commit
37aeb77dda
1 changed files with 11 additions and 3 deletions
|
@ -1348,7 +1348,9 @@ function interface.ip6addrs(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function interface.type(self)
|
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"
|
return "wifi"
|
||||||
elseif _bridge[self.ifname] then
|
elseif _bridge[self.ifname] then
|
||||||
return "bridge"
|
return "bridge"
|
||||||
|
@ -1385,7 +1387,9 @@ end
|
||||||
|
|
||||||
function interface.get_type_i18n(self)
|
function interface.get_type_i18n(self)
|
||||||
local x = self:type()
|
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")
|
return lng.translate("Wireless Adapter")
|
||||||
elseif x == "bridge" then
|
elseif x == "bridge" then
|
||||||
return lng.translate("Bridge")
|
return lng.translate("Bridge")
|
||||||
|
@ -1438,7 +1442,11 @@ function interface.bridge_stp(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function interface.is_up(self)
|
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
|
end
|
||||||
|
|
||||||
function interface.is_bridge(self)
|
function interface.is_bridge(self)
|
||||||
|
|
Loading…
Reference in a new issue