summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2019-01-17 11:12:52 +0100
committerFlorian Eckert <fe@dev.tdt.de>2019-01-17 11:12:52 +0100
commitc95fdfcc1af9fb52a79853f59e67aed02193a16d (patch)
tree468bb977e29427c3437ef9e02206e554ec2aa1b9 /applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua
parent8fc68bee2c43b57b24d4f6b6ffdc60ef52afc76b (diff)
luci-app-mwan3: fix cbi local scope
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua')
-rw-r--r--applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua
index 27d9a3e85..3464ebfc9 100644
--- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua
+++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua
@@ -2,19 +2,21 @@
-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
-- Licensed to the public under the GNU General Public License v2.
-dsp = require "luci.dispatcher"
-arg[1] = arg[1] or ""
+local dsp = require "luci.dispatcher"
+
+local m, mwan_member, interface, metric, weight
+arg[1] = arg[1] or ""
-m5 = Map("mwan3", translatef("MWAN Member Configuration - %s", arg[1]))
-m5.redirect = dsp.build_url("admin", "network", "mwan", "member")
+m = Map("mwan3", translatef("MWAN Member Configuration - %s", arg[1]))
+m.redirect = dsp.build_url("admin", "network", "mwan", "member")
-mwan_member = m5:section(NamedSection, arg[1], "member", "")
+mwan_member = m:section(NamedSection, arg[1], "member", "")
mwan_member.addremove = false
mwan_member.dynamic = false
interface = mwan_member:option(Value, "interface", translate("Interface"))
-m5.uci:foreach("mwan3", "interface",
+m.uci:foreach("mwan3", "interface",
function(s)
interface:value(s['.name'], s['.name'])
end
@@ -28,4 +30,4 @@ weight = mwan_member:option(Value, "weight", translate("Weight"),
translate("Acceptable values: 1-1000. Defaults to 1 if not set"))
weight.datatype = "range(1, 1000)"
-return m5
+return m