--- ------ member configuration ------ --
-
ds = require "luci.dispatcher"
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)
return self.map:get(s, "weight") or "1"
end
-
return m5
--- ------ 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"))