diff options
5 files changed, 54 insertions, 16 deletions
diff --git a/applications/luci-app-simple-adblock/Makefile b/applications/luci-app-simple-adblock/Makefile index 57a9367e1c..b7d1a79fbc 100644 --- a/applications/luci-app-simple-adblock/Makefile +++ b/applications/luci-app-simple-adblock/Makefile @@ -10,7 +10,7 @@ LUCI_TITLE:=Simple Adblock Web UI LUCI_DESCRIPTION:=Provides Web UI for simple-adblock service. LUCI_DEPENDS:=+luci-mod-admin-full +simple-adblock LUCI_PKGARCH:=all -PKG_RELEASE:=35 +PKG_RELEASE:=37 include ../../luci.mk diff --git a/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua b/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua index 3ec4c4399f..f4153355d6 100644 --- a/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua +++ b/applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua @@ -15,13 +15,18 @@ local dispatcher = require "luci.dispatcher" local enabledFlag = uci:get(packageName, "config", "enabled") local command, outputFile, outputCache, outputGzip local targetDNS = uci:get(packageName, "config", "dns") +local checkDnsmasq = sys.call("which dnsmasq >/dev/null 2>&1") == 0 and true +local checkUnbound = sys.call("which unbound >/dev/null 2>&1") == 0 and true +local checkDnsmasqIpset = sys.call("dnsmasq -v 2>/dev/null | grep -q 'no-ipset' || ! dnsmasq -v 2>/dev/null | grep -q -w 'ipset'") ~= 0 + and sys.call("ipset help hash:net >/dev/null 2>&1") and true if not targetDNS or targetDNS == "" then targetDNS = "dnsmasq.servers" end if targetDNS ~= "dnsmasq.addnhosts" and targetDNS ~= "dnsmasq.conf" and - targetDNS ~= "dnsmasq.servers" and targetDNS ~= "unbound.adb_list" then + targetDNS ~= "dnsmasq.ipset" and targetDNS ~= "dnsmasq.servers" and + targetDNS ~= "unbound.adb_list" then targetDNS = "dnsmasq.servers" end @@ -177,13 +182,34 @@ end s:tab("advanced", translate("Advanced Configuration")) -dns = s:taboption("advanced", ListValue, "dns", translate("DNS Service"), translate("Pick the DNS resolution option to create the adblock list for, see the") .. " " - .. [[<a href="]] .. readmeURL .. [[#dns-resolution-option" target="_blank">]] - .. translate("README") .. [[</a>]] .. " " .. translate("for details.")) -dns:value("dnsmasq.addnhosts", translate("DNSMASQ Additional Hosts")) -dns:value("dnsmasq.conf", translate("DNSMASQ Config")) -dns:value("dnsmasq.servers", translate("DNSMASQ Servers File")) -dns:value("unbound.adb_list", translate("Unbound AdBlock List")) +local dns_descr = translate("Pick the DNS resolution option to create the adblock list for, see the") .. " " + .. [[<a href="]] .. readmeURL .. [[#dns-resolution-option" target="_blank">]] + .. translate("README") .. [[</a>]] .. " " .. translate("for details.") + +if not checkDnsmasq then + dns_descr = dns_descr .. "</br>" .. translate("Please note that") .. " <i>dnsmasq.addnhosts</i> " .. translate("is not supported on this system.") + dns_descr = dns_descr .. "</br>" .. translate("Please note that") .. " <i>dnsmasq.conf</i> " .. translate("is not supported on this system.") + dns_descr = dns_descr .. "</br>" .. translate("Please note that") .. " <i>dnsmasq.ipset</i> " .. translate("is not supported on this system.") + dns_descr = dns_descr .. "</br>" .. translate("Please note that") .. " <i>dnsmasq.servers</i> " .. translate("is not supported on this system.") +elseif not checkDnsmasqIpset then + dns_descr = dns_descr .. "</br>" .. translate("Please note that") .. " <i>dnsmasq.ipset</i> " .. translate("is not supported on this system.") +end +if not checkUnbound then + dns_descr = dns_descr .. "</br>" .. translate("Please note that") .. " <i>unbound.adb_list</i> " .. translate("is not supported on this system.") +end + +dns = s:taboption("advanced", ListValue, "dns", translate("DNS Service"), dns_descr) +if checkDnsmasq then + dns:value("dnsmasq.addnhosts", translate("DNSMASQ Additional Hosts")) + dns:value("dnsmasq.conf", translate("DNSMASQ Config")) + if checkDnsmasqIpset then + dns:value("dnsmasq.ipset", translate("DNSMASQ IP Set")) + end + dns:value("dnsmasq.servers", translate("DNSMASQ Servers File")) +end +if checkUnbound then + dns:value("unbound.adb_list", translate("Unbound AdBlock List")) +end dns.default = "dnsmasq.servers" ipv6 = s:taboption("advanced", ListValue, "ipv6_enabled", translate("IPv6 Support"), translate("Add IPv6 entries to block-list.")) @@ -210,11 +236,6 @@ o8:value("0", translate("Do not use simultaneous processing")) o8:value("1", translate("Use simultaneous processing")) o8.default = 1 -o9 = s:taboption("advanced", ListValue, "allow_non_ascii", translate("Allow Non-ASCII characters in DNSMASQ file"), translate("Only enable if your version of DNSMASQ supports the use of Non-ASCII characters, otherwise DNSMASQ will fail to start.")) -o9:value("0", translate("Do not allow Non-ASCII")) -o9:value("1", translate("Allow Non-ASCII")) -o9.default = "0" - o10 = s:taboption("advanced", ListValue, "compressed_cache", translate("Store compressed cache file on router"), translate("Attempt to create a compressed cache of block-list in the persistent memory.")) o10:value("0", translate("Do not store compressed cache")) o10:value("1", translate("Store compressed cache")) diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua index e8580daac7..c0c873d76c 100644 --- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua +++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua @@ -140,13 +140,18 @@ end local login_section = (m.hidden.ssid or "") .. (m.hidden.bssid or "") login_section = login_section:gsub("[^%w_]", "_") local cmd = uci:get("travelmate", login_section, "command") +local cmd_args_default = uci:get("travelmate", login_section, "command_args") cmd_list = m:field(ListValue, "cmdlist", translate("Auto Login Script"), translate("External script reference which will be called for automated captive portal logins.")) -cmd_list:value("none") +cmd_args = m:field(Value, "cmdargs", translate("Optional Arguments"), + translate("Space separated list of additional optional arguments passed to the Auto Login Script, i.e. username and password")) for _, z in ipairs(scripts) do cmd_list:value(z) + cmd_args:depends("cmdlist", z) end +cmd_list:value("none") cmd_list.default = cmd or "none" +cmd_args.default = cmd_args_default function wssid.write(self, section, value) newsection = uci:section("wireless", "wifi-iface", nil, { @@ -194,6 +199,7 @@ function wssid.write(self, section, value) end if uci:get("travelmate", login_section) then uci:set("travelmate", login_section, "command", cmd_list:formvalue(section)) + uci:set("travelmate", login_section, "command_args", cmd_args:formvalue(section)) uci:save("travelmate") uci:commit("travelmate") end diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua index cd2fa69ae4..ab0b924549 100644 --- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua +++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua @@ -133,13 +133,18 @@ if s ~= nil then local login_section = (s.ssid or "") .. (s.bssid or "") login_section = login_section:gsub("[^%w_]", "_") local cmd = uci:get("travelmate", login_section, "command") + local cmd_args_default = uci:get("travelmate", login_section, "command_args") cmd_list = m:field(ListValue, "cmdlist", translate("Auto Login Script"), translate("External script reference which will be called for automated captive portal logins.")) - cmd_list:value("none") + cmd_args = m:field(Value, "cmdargs", translate("Optional Arguments"), + translate("Space separated list of additional optional arguments passed to the Auto Login Script, i.e. username and password")) for _, z in ipairs(scripts) do cmd_list:value(z) + cmd_args:depends("cmdlist", z) end + cmd_list:value("none") cmd_list.default = cmd or "none" + cmd_args.default = cmd_args_default else m.on_cancel() end @@ -181,6 +186,7 @@ function wssid.write(self, section, value) end if uci:get("travelmate", login_section) then uci:set("travelmate", login_section, "command", cmd_list:formvalue(section)) + uci:set("travelmate", login_section, "command_args", cmd_args:formvalue(section)) uci:save("travelmate") uci:commit("travelmate") end diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js index ac6586af46..18af222d29 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js @@ -261,6 +261,11 @@ return L.view.extend({ o.ucisection = 'ntp'; o.depends('enabled', '1'); + o = s.taboption('timesync', form.Flag, 'use_dhcp', _('Use DHCP advertised servers')); + o.ucisection = 'ntp'; + o.default = o.enabled; + o.depends('enabled', '1'); + o = s.taboption('timesync', form.DynamicList, 'server', _('NTP server candidates')); o.datatype = 'host(0)'; o.ucisection = 'ntp'; |