mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Use an app for macvlan
This commit is contained in:
parent
bd80da9204
commit
f9e7d0d30f
8 changed files with 265 additions and 0 deletions
10
luci-app-macvlan/files/luci/controller/macvlan.lua
Normal file
10
luci-app-macvlan/files/luci/controller/macvlan.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
-- Copyright (C) 2019 X-WRT <dev@x-wrt.com>
|
||||
|
||||
module("luci.controller.macvlan", package.seeall)
|
||||
|
||||
function index()
|
||||
local page
|
||||
|
||||
page = entry({"admin", "network", "macvlan"}, cbi("macvlan/macvlan"), _("Macvlan"))
|
||||
page.leaf = true
|
||||
end
|
14
luci-app-macvlan/files/luci/i18n/macvlan.zh-cn.po
Normal file
14
luci-app-macvlan/files/luci/i18n/macvlan.zh-cn.po
Normal file
|
@ -0,0 +1,14 @@
|
|||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "Macvlan"
|
||||
msgstr "Macvlan"
|
||||
|
||||
msgid "Macvlan Settings"
|
||||
msgstr "Macvlan设置"
|
||||
|
||||
msgid "Interface"
|
||||
msgstr "网络接口"
|
||||
|
||||
msgid "Index"
|
||||
msgstr "序号"
|
22
luci-app-macvlan/files/luci/model/cbi/macvlan/macvlan.lua
Normal file
22
luci-app-macvlan/files/luci/model/cbi/macvlan/macvlan.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
-- 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() }
|
||||
|
||||
m = Map("macvlan", translate("Macvlan"))
|
||||
|
||||
s = m:section(TypedSection, "macvlan", translate("Macvlan Settings"))
|
||||
s.addremove = true
|
||||
s.anonymous = false
|
||||
s.template = "cbi/tblsection"
|
||||
|
||||
hn = s:option(ListValue, "ifname", translate("Interface"))
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue