policyconfig.lua 1.1 KB

123456789101112131415161718192021222324252627282930
  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.
  4. dsp = require "luci.dispatcher"
  5. arg[1] = arg[1] or ""
  6. m5 = Map("mwan3", translatef("MWAN Policy Configuration - %s", arg[1]))
  7. m5.redirect = dsp.build_url("admin", "network", "mwan", "policy")
  8. mwan_policy = m5:section(NamedSection, arg[1], "policy", "")
  9. mwan_policy.addremove = false
  10. mwan_policy.dynamic = false
  11. member = mwan_policy:option(DynamicList, "use_member", translate("Member used"))
  12. m5.uci:foreach("mwan3", "member",
  13. function(s)
  14. member:value(s['.name'], s['.name'])
  15. end
  16. )
  17. last_resort = mwan_policy:option(ListValue, "last_resort", translate("Last resort"),
  18. translate("When all policy members are offline use this behavior for matched traffic"))
  19. last_resort.default = "unreachable"
  20. last_resort:value("unreachable", translate("unreachable (reject)"))
  21. last_resort:value("blackhole", translate("blackhole (drop)"))
  22. last_resort:value("default", translate("default (use main routing table)"))
  23. return m5