diff options
author | Florian Eckert <fe@dev.tdt.de> | 2020-11-27 15:06:22 +0100 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2020-12-16 15:38:41 +0100 |
commit | ba4d067c2a05a2b1e2cbf1ef028cdbe7d011ec42 (patch) | |
tree | f61fce803b7e90b6096506fc2f2a6c08953b215a /applications/luci-app-mwan3/luasrc | |
parent | b4eeb1829e5aa749b014d7d9d39235cd9a55272c (diff) |
luci-app-mwan3: cleanup policy cbi
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-mwan3/luasrc')
-rw-r--r-- | applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua index 9067f7332f..48a4dcce38 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua @@ -5,7 +5,7 @@ local dsp = require "luci.dispatcher" local uci = require "uci" -local m, mwan_policy, use_member, last_resort +local m, s, o function policyCheck() local policy_error = {} @@ -38,7 +38,7 @@ end m = Map("mwan3", translate("MWAN - Policies"), policyError(policyCheck())) -mwan_policy = m:section(TypedSection, "policy", nil, +s = m:section(TypedSection, "policy", nil, translate("Policies are profiles grouping one or more members controlling how MWAN distributes traffic<br />" .. "Member interfaces with lower metrics are used first<br />" .. "Member interfaces with the same metric will be load-balanced<br />" .. @@ -46,13 +46,13 @@ mwan_policy = m:section(TypedSection, "policy", nil, "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" .. "Names must be 15 characters or less<br />" .. "Policies may not share the same name as configured interfaces, members or rules")) -mwan_policy.addremove = true -mwan_policy.dynamic = false -mwan_policy.sectionhead = translate("Policy") -mwan_policy.sortable = true -mwan_policy.template = "cbi/tblsection" -mwan_policy.extedit = dsp.build_url("admin", "network", "mwan", "policy", "%s") -function mwan_policy.create(self, section) +s.addremove = true +s.dynamic = false +s.sectionhead = translate("Policy") +s.sortable = true +s.template = "cbi/tblsection" +s.extedit = dsp.build_url("admin", "network", "mwan", "policy", "%s") +function s.create(self, section) if #section > 15 then self.invalid_cts = true else @@ -62,9 +62,9 @@ function mwan_policy.create(self, section) end end -use_member = mwan_policy:option(DummyValue, "use_member", translate("Members assigned")) -use_member.rawhtml = true -function use_member.cfgvalue(self, s) +o = s:option(DummyValue, "use_member", translate("Members assigned")) +o.rawhtml = true +function o.cfgvalue(self, s) local memberConfig, memberList = self.map:get(s, "use_member"), "" if memberConfig then for k,v in pairs(memberConfig) do @@ -76,9 +76,9 @@ function use_member.cfgvalue(self, s) end end -last_resort = mwan_policy:option(DummyValue, "last_resort", translate("Last resort")) -last_resort.rawhtml = true -function last_resort.cfgvalue(self, s) +o = s:option(DummyValue, "last_resort", translate("Last resort")) +o.rawhtml = true +function o.cfgvalue(self, s) local action = self.map:get(s, "last_resort") if action == "blackhole" then return translate("blackhole (drop)") |