summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-mwan3/luasrc
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2019-01-16 14:25:38 +0100
committerFlorian Eckert <fe@dev.tdt.de>2019-01-22 14:36:21 +0100
commitf229dea746f9b404ebe61434ef355842a56aaf39 (patch)
treef54a37a7ee03f561f63c3d9a01f1f0908186a7c2 /applications/luci-app-mwan3/luasrc
parenta429bb47e7cee60f77d8d512c5b6e6cef2882769 (diff)
luci-app-mwan3: Offer loaded ipsets as dropdown for ipset selection
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/ruleconfig.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua
index 14f4503658..3643e37ec5 100644
--- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua
+++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua
@@ -3,12 +3,15 @@
-- Licensed to the public under the GNU General Public License v2.
local dsp = require "luci.dispatcher"
+local util = require("luci.util")
local m, mwan_rule, src_ip, src_port, dest_ip, dest_port, proto, sticky
local timeout, ipset, logging, policy
arg[1] = arg[1] or ""
+local ipsets = util.split(util.trim(util.exec("ipset -n -L 2>/dev/null | grep -v mwan3_ | sort")), "\n", nil, true) or {}
+
m = Map("mwan3", translatef("MWAN Rule Configuration - %s", arg[1]))
m.redirect = dsp.build_url("admin", "network", "mwan", "rule")
@@ -52,6 +55,9 @@ timeout.datatype = "range(1, 1000000)"
ipset = mwan_rule:option(Value, "ipset", translate("IPset"),
translate("Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/youtube.com/youtube\")"))
+for _, z in ipairs(ipsets) do
+ ipset:value(z)
+end
logging = mwan_rule:option(Flag, "logging", translate("Logging"),
translate("Enables firewall rule logging (global mwan3 logging must also be enabled)"))