Merge pull request #2281 from TDT-AG/pr/20181114-luci-app-mwan3

luci-app-mwan3: add/remove options
This commit is contained in:
Hannu Nyman 2018-11-14 16:36:08 +02:00 committed by GitHub
commit e064e5be1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,22 +3,11 @@
local net = require "luci.model.network".init()
local s, m, mask, rtmon, rtlookup
m = Map("mwan3", translate("MWAN - Globals"))
s = m:section(NamedSection, "globals", "globals", nil)
n = s:option(ListValue, "local_source",
translate("Local source interface"),
translate("Use the IP address of this interface as source IP " ..
"address for traffic initiated by the router itself"))
n:value("none")
n.default = "none"
for _, net in ipairs(net:get_networks()) do
if net:name() ~= "loopback" then
n:value(net:name())
end
end
n.rmempty = false
mask = s:option(
Value,
@ -28,4 +17,26 @@ mask = s:option(
mask.datatype = "hex(4)"
mask.default = "0xff00"
rtmon = s:option(
Value,
"rtmon_interval",
translate("Update interval"),
translate("How often should rtmon update the interface routing table"))
rtmon.datatype = "integer"
rtmon.default = "5"
rtmon:value("1", translatef("%d second", 1))
rtmon:value("3", translatef("%d seconds", 3))
rtmon:value("5", translatef("%d seconds", 5))
rtmon:value("7", translatef("%d seconds", 7))
rtmon:value("10", translatef("%d seconds", 10))
rtlookup = s:option(DynamicList,
"rt_table_lookup",
translate("Routing table lookup"),
translate("Also scan this Routing table for connected networks"))
rtlookup.datatype = "integer"
rtlookup:value("1", translatef("Routing table %d", 1))
rtlookup:value("2", translatef("Routing table %d", 2))
rtlookup:value("220", translatef("Routing table %d", 220))
return m