1 m = Map("simple-adblock", translate("Simple AdBlock Settings"))
2 s = m:section(NamedSection, "config", "simple-adblock")
5 e = s:option(Flag, "enabled", translate("Start Simple Adblock service"))
7 function e.write(self, section, value)
9 luci.sys.init.stop("simple-adblock")
11 return Flag.write(self, section, value)
14 o2 = s:option(ListValue, "verbosity", translate("Output Verbosity Setting"),translate("Controls system log and console output verbosity"))
15 o2:value("0", translate("Suppress output"))
16 o2:value("1", translate("Some output"))
17 o2:value("2", translate("Verbose output"))
21 o3 = s:option(ListValue, "force_dns", translate("Force Router DNS"), translate("Forces Router DNS use on local devices, also known as DNS Hijacking"))
22 o3:value("0", translate("Let local devices use their own DNS servers if set"))
23 o3:value("1", translate("Force Router DNS server to all local devices"))
27 local sysfs_path = "/sys/class/leds/"
29 if nixio.fs.access(sysfs_path) then
30 leds = nixio.util.consume((nixio.fs.dir(sysfs_path)))
33 o3 = s:option(Value, "led", translate("LED to indicate status"), translate("Pick the LED not already used in")
34 .. [[ <a href="]] .. luci.dispatcher.build_url("admin/system/leds") .. [[">]]
35 .. translate("System LED Configuration") .. [[</a>]])
37 o3:value("", translate("none"))
38 for k, v in ipairs(leds) do
43 s2 = m:section(NamedSection, "config", "simple-adblock")
44 -- Whitelisted Domains
45 d1 = s2:option(DynamicList, "whitelist_domain", translate("Whitelisted Domains"), translate("Individual domains to be whitelisted"))
49 -- Blacklisted Domains
50 d3 = s2:option(DynamicList, "blacklist_domain", translate("Blacklisted Domains"), translate("Individual domains to be blacklisted"))
54 -- Whitelisted Domains URLs
55 d2 = s2:option(DynamicList, "whitelist_domains_url", translate("Whitelisted Domain URLs"), translate("URLs to lists of domains to be whitelisted"))
59 -- Blacklisted Domains URLs
60 d4 = s2:option(DynamicList, "blacklist_domains_url", translate("Blacklisted Domain URLs"), translate("URLs to lists of domains to be blacklisted"))
64 -- Blacklisted Hosts URLs
65 d5 = s2:option(DynamicList, "blacklist_hosts_url", translate("Blacklisted Hosts URLs"), translate("URLs to lists of hosts to be blacklisted"))