luci-app-mwan3: cleanup member cbi
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 27 Nov 2020 10:31:39 +0000 (11:31 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Wed, 16 Dec 2020 14:38:46 +0000 (15:38 +0100)
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua

index 4125aae0beffae989dba8fb85fffc83d7dc81d9b..5c3d0c152425b8304138418406ec51eae44fe3d5 100644 (file)
@@ -4,41 +4,41 @@
 
 local dsp = require "luci.dispatcher"
 
-local m, mwan_member, interface, metric, weight
+local m, s, o
 
 m = Map("mwan3", translate("MWAN - Members"))
 
-mwan_member = m:section(TypedSection, "member", nil,
+s = m:section(TypedSection, "member", nil,
        translate("Members are profiles attaching a metric and weight to an MWAN interface<br />" ..
        "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" ..
        "Members may not share the same name as configured interfaces, policies or rules"))
-mwan_member.addremove = true
-mwan_member.dynamic = false
-mwan_member.sectionhead = translate("Member")
-mwan_member.sortable = true
-mwan_member.template = "cbi/tblsection"
-mwan_member.extedit = dsp.build_url("admin", "network", "mwan", "member", "%s")
-function mwan_member.create(self, section)
+s.addremove = true
+s.dynamic = false
+s.sectionhead = translate("Member")
+s.sortable = true
+s.template = "cbi/tblsection"
+s.extedit = dsp.build_url("admin", "network", "mwan", "member", "%s")
+function s.create(self, section)
        TypedSection.create(self, section)
        m.uci:save("mwan3")
        luci.http.redirect(dsp.build_url("admin", "network", "mwan", "member", section))
 end
 
-interface = mwan_member:option(DummyValue, "interface", translate("Interface"))
-interface.rawhtml = true
-function interface.cfgvalue(self, s)
+o = s:option(DummyValue, "interface", translate("Interface"))
+o.rawhtml = true
+function o.cfgvalue(self, s)
        return self.map:get(s, "interface") or "&#8212;"
 end
 
-metric = mwan_member:option(DummyValue, "metric", translate("Metric"))
-metric.rawhtml = true
-function metric.cfgvalue(self, s)
+o = s:option(DummyValue, "metric", translate("Metric"))
+o.rawhtml = true
+function o.cfgvalue(self, s)
        return self.map:get(s, "metric") or "1"
 end
 
-weight = mwan_member:option(DummyValue, "weight", translate("Weight"))
-weight.rawhtml = true
-function weight.cfgvalue(self, s)
+o = s:option(DummyValue, "weight", translate("Weight"))
+o.rawhtml = true
+function o.cfgvalue(self, s)
        return self.map:get(s, "weight") or "1"
 end