1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00
openmptcprouter-feeds/luci-app-macvlan/files/luci/model/cbi/macvlan/macvlan.lua

23 lines
644 B
Lua
Raw Normal View History

2019-10-20 19:12:40 +00:00
-- Copyright (C) 2019 X-WRT <dev@x-wrt.com>
local net = require "luci.model.network".init()
local ifaces = net:get_interfaces() or { net:get_interface() }
2019-10-27 08:32:31 +00:00
m = Map("macvlan", translate("Macvlan"), translate("You can configure Macvlan virtual interfaces base on the real itnerface you want."))
2019-10-20 19:12:40 +00:00
s = m:section(TypedSection, "macvlan", translate("Macvlan Settings"))
s.addremove = true
s.anonymous = false
s.template = "cbi/tblsection"
hn = s:option(Value, "ifname", translate("Interface"))
2019-10-20 19:12:40 +00:00
hn.rmempty = false
for _, iface in ipairs(ifaces) do
if iface:type() ~= "macvlan" then
hn:value(iface:name(),"%s" % iface:name())
end
end
return m