summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2018-01-17 17:10:06 +0100
committerFlorian Eckert <fe@dev.tdt.de>2018-01-18 15:09:50 +0100
commitd369c80beccedf883b4cd47b4e3c1debc9f37e9a (patch)
treec325b7b6a9fe44894834d0a4200a78ef634cf10e /applications
parentb4350f21ff2f31b7dbcdbc5f034659ba580c059f (diff)
luci-app-mwan3: refactoring member config pages
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'applications')
-rw-r--r--applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua4
-rw-r--r--applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua22
2 files changed, 6 insertions, 20 deletions
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua
index 67030cc8db..0865fccaf7 100644
--- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua
+++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua
@@ -1,5 +1,3 @@
--- ------ member configuration ------ --
-
ds = require "luci.dispatcher"
@@ -21,7 +19,6 @@ mwan_member = m5:section(TypedSection, "member", nil,
luci.http.redirect(ds.build_url("admin", "network", "mwan", "member", section))
end
-
interface = mwan_member:option(DummyValue, "interface", translate("Interface"))
interface.rawhtml = true
function interface.cfgvalue(self, s)
@@ -40,5 +37,4 @@ weight = mwan_member:option(DummyValue, "weight", translate("Weight"))
return self.map:get(s, "weight") or "1"
end
-
return m5
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 8b606cdebd..1208905c39 100644
--- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua
+++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua
@@ -1,30 +1,20 @@
--- ------ extra functions ------ --
-
-function cbi_add_interface(field)
- uci.cursor():foreach("mwan3", "interface",
- function (section)
- field:value(section[".name"])
- end
- )
-end
-
--- ------ member configuration ------ --
-
dsp = require "luci.dispatcher"
arg[1] = arg[1] or ""
m5 = Map("mwan3", translatef("MWAN Member Configuration - %s", arg[1]))
- m5.redirect = dsp.build_url("admin", "network", "mwan", "member")
-
+m5.redirect = dsp.build_url("admin", "network", "mwan", "member")
mwan_member = m5:section(NamedSection, arg[1], "member", "")
mwan_member.addremove = false
mwan_member.dynamic = false
-
interface = mwan_member:option(Value, "interface", translate("Interface"))
- cbi_add_interface(interface)
+m5.uci:foreach("mwan3", "interface",
+ function(s)
+ interface:value(s['.name'], s['.name'])
+ end
+)
metric = mwan_member:option(Value, "metric", translate("Metric"),
translate("Acceptable values: 1-256. Defaults to 1 if not set"))