luci-app-mwan3: fix unify luci code styling
[project/luci.git] / applications / luci-app-mwan3 / luasrc / model / cbi / mwan / policyconfig.lua
1 dsp = require "luci.dispatcher"
2 arg[1] = arg[1] or ""
3
4
5 m5 = Map("mwan3", translatef("MWAN Policy Configuration - %s", arg[1]))
6 m5.redirect = dsp.build_url("admin", "network", "mwan", "policy")
7
8 mwan_policy = m5:section(NamedSection, arg[1], "policy", "")
9 mwan_policy.addremove = false
10 mwan_policy.dynamic = false
11
12 member = mwan_policy:option(DynamicList, "use_member", translate("Member used"))
13 m5.uci:foreach("mwan3", "member",
14         function(s)
15                 member:value(s['.name'], s['.name'])
16         end
17 )
18
19 last_resort = mwan_policy:option(ListValue, "last_resort", translate("Last resort"),
20         translate("When all policy members are offline use this behavior for matched traffic"))
21 last_resort.default = "unreachable"
22 last_resort:value("unreachable", translate("unreachable (reject)"))
23 last_resort:value("blackhole", translate("blackhole (drop)"))
24 last_resort:value("default", translate("default (use main routing table)"))
25
26 return m5