1 -- Copyright 2014 Aedan Renner <chipdankly@gmail.com>
2 -- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
3 -- Licensed to the public under the GNU General Public License v2.
5 local dsp = require "luci.dispatcher"
9 m = Map("mwan3", translate("MWAN - Members"))
11 s = m:section(TypedSection, "member", nil,
12 translate("Members are profiles attaching a metric and weight to an MWAN interface<br />" ..
13 "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" ..
14 "Members may not share the same name as configured interfaces, policies or rules"))
17 s.sectionhead = translate("Member")
19 s.template = "cbi/tblsection"
20 s.extedit = dsp.build_url("admin", "network", "mwan", "member", "%s")
21 function s.create(self, section)
22 TypedSection.create(self, section)
24 luci.http.redirect(dsp.build_url("admin", "network", "mwan", "member", section))
27 o = s:option(DummyValue, "interface", translate("Interface"))
29 function o.cfgvalue(self, s)
30 return self.map:get(s, "interface") or "—"
33 o = s:option(DummyValue, "metric", translate("Metric"))
35 function o.cfgvalue(self, s)
36 return self.map:get(s, "metric") or "1"
39 o = s:option(DummyValue, "weight", translate("Weight"))
41 function o.cfgvalue(self, s)
42 return self.map:get(s, "weight") or "1"