diff options
author | danrl <mail@danrl.com> | 2017-02-17 11:22:01 +0100 |
---|---|---|
committer | danrl <mail@danrl.com> | 2017-02-17 11:22:01 +0100 |
commit | a25c71f55697d13c0a12da104bde7fee57d00f2c (patch) | |
tree | 7398b15679d049fc3eb9db06451e6898991fd68e /applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua | |
parent | 9726e26a7a2ea6052827472bfbec3c9914abedf8 (diff) |
luci-app-mwan3: initial commit
Moved over here from the packages repository.
Signed-off-by: Dan Luedtke <mail@danrl.com>
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.lua | 47 |
1 files changed, 47 insertions, 0 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 new file mode 100644 index 000000000..181d22e06 --- /dev/null +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua @@ -0,0 +1,47 @@ +-- ------ 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", translate("MWAN Member Configuration - ") .. arg[1]) + m5.redirect = dsp.build_url("admin", "network", "mwan", "configuration", "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) + +metric = mwan_member:option(Value, "metric", translate("Metric"), + translate("Acceptable values: 1-1000. Defaults to 1 if not set")) + metric.datatype = "range(1, 1000)" + +weight = mwan_member:option(Value, "weight", translate("Weight"), + translate("Acceptable values: 1-1000. Defaults to 1 if not set")) + weight.datatype = "range(1, 1000)" + + +-- ------ currently configured interfaces ------ -- + +mwan_interface = m5:section(TypedSection, "interface", translate("Currently Configured Interfaces")) + mwan_interface.addremove = false + mwan_interface.dynamic = false + mwan_interface.sortable = false + mwan_interface.template = "cbi/tblsection" + + +return m5 |