From: Stan Grishin Date: Sun, 29 Mar 2020 05:22:37 +0000 (+0000) Subject: luci-app-simple-adblock: better status/error display X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=refs%2Fpull%2F3793%2Fhead;p=oweals%2Fluci.git luci-app-simple-adblock: better status/error display Signed-off-by: Stan Grishin --- diff --git a/applications/luci-app-simple-adblock/Makefile b/applications/luci-app-simple-adblock/Makefile index 8a666d635..ce8ded98a 100644 --- a/applications/luci-app-simple-adblock/Makefile +++ b/applications/luci-app-simple-adblock/Makefile @@ -3,14 +3,14 @@ include $(TOPDIR)/rules.mk -PKG_LICENSE:=GPL-3.0+ +PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Stan Grishin LUCI_TITLE:=Simple Adblock Web UI LUCI_DESCRIPTION:=Provides Web UI for simple-adblock service. LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +simple-adblock LUCI_PKGARCH:=all -PKG_RELEASE:=38 +PKG_RELEASE:=42 include ../../luci.mk diff --git a/applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua b/applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua index acfea5bf3..22c75e4c8 100644 --- a/applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua +++ b/applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua @@ -2,5 +2,23 @@ module("luci.controller.simple-adblock", package.seeall) function index() if nixio.fs.access("/etc/config/simple-adblock") then entry({"admin", "services", "simple-adblock"}, cbi("simple-adblock"), _("Simple AdBlock")) + entry({"admin", "services", "simple-adblock", "action"}, call("simple_adblock_action"), nil).leaf = true end end + +function simple_adblock_action(name) + local packageName = "simple-adblock" + if name == "start" then + luci.sys.init.start(packageName) + elseif name == "action" then + luci.util.exec("/etc/init.d/" .. packageName .. " dl >/dev/null 2>&1") + elseif name == "stop" then + luci.sys.init.stop(packageName) + elseif name == "enable" then + luci.util.exec("uci set " .. packageName .. ".config.enabled=1; uci commit " .. packageName) + elseif name == "disable" then + luci.util.exec("uci set " .. packageName .. ".config.enabled=0; uci commit " .. packageName) + end + luci.http.prepare_content("text/plain") + luci.http.write("0") +end 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 9f392a20c..ce5626f8e 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 @@ -10,6 +10,7 @@ local util = require "luci.util" local sys = require "luci.sys" local jsonc = require "luci.jsonc" local fs = require "nixio.fs" +local nutil = require "nixio.util" local http = require "luci.http" local dispatcher = require "luci.dispatcher" local enabledFlag = uci:get(packageName, "config", "enabled") @@ -48,18 +49,13 @@ elseif targetDNS == "unbound.adb_list" then outputGzip="/etc/" .. packageName .. ".unbound.gz" end -m = Map("simple-adblock", translate("Simple AdBlock Settings")) -m.apply_on_parse = true -m.on_after_apply = function(self) - sys.call("/etc/init.d/simple-adblock restart") -end - local tmpfs if fs.access("/var/run/" .. packageName .. ".json") then tmpfs = jsonc.parse(util.trim(sys.exec("cat /var/run/" .. packageName .. ".json"))) end -local tmpfsVersion, tmpfsStatus, tmpfsMessage, tmpfsError, tmpfsStats = "", "Stopped" +local tmpfsVersion, tmpfsStatus = "", "Stopped" +local tmpfsMessage, tmpfsError, tmpfsStats if tmpfs and tmpfs['data'] then if tmpfs['data']['status'] and tmpfs['data']['status'] ~= "" then tmpfsStatus = tmpfs['data']['status'] @@ -74,43 +70,88 @@ if tmpfs and tmpfs['data'] then tmpfsStats = tmpfs['data']['stats'] end if tmpfs['data']['version'] and tmpfs['data']['version'] ~= "" then - tmpfsVersion = " (" .. packageName .. " " .. tmpfs['data']['version'] .. ")" + tmpfsVersion = packageName .. " " .. tmpfs['data']['version'] + else + tmpfsVersion = packageName end end -h = m:section(NamedSection, "config", "simple-adblock", translate("Service Status") .. tmpfsVersion) +local statusTable = {} +local errorTable = {} +statusTable["statusNoInstall"] = packageName .. translate("is not installed or not found") +statusTable["statusStopped"] = translate("Stopped") +statusTable["statusStarting"] = translate("Starting") +statusTable["statusRestarting"] = translate("Restarting") +statusTable["statusForceReloading"] = translate("Force Reloading") +statusTable["statusDownloading"] = translate("Downloading") +statusTable["statusError"] = translate("Error") +statusTable["statusWarning"] = translate("Warning") +statusTable["statusFail"] = translate("Fail") +statusTable["statusSuccess"] = translate("Success") +errorTable["errorOutputFileCreate"] = translate("failed to create") .. " '" .. outputFile .. "' " .. translate("file") +errorTable["errorFailDNSReload"] = translate("failed to restart/reload DNS resolver") +errorTable["errorSharedMemory"] = translate("failed to access shared memory") +errorTable["errorSorting"] = translate("failed to sort data file") +errorTable["errorOptimization"] = translate("failed to optimize data file") +errorTable["errorWhitelistProcessing"] = translate("failed to process whitelist") +errorTable["errorDataFileFormatting"] = translate("failed to format data file") +errorTable["errorMovingDataFile"] = translate("failed to move temporary data file to") .. " '" .. outputFile .. "'" +errorTable["errorCreatingCompressedCache"] = translate("failed to create compressed cache") +errorTable["errorRemovingTempFiles"] = translate("failed to remove temporary files") +errorTable["errorRestoreCompressedCache"] = translate("failed to unpack compressed cache") +errorTable["errorRestoreCache"] = translate("failed to move") .. " '" .. outputCache .. "' " .. translate("to") .. " '" .. outputFile .. "'" +errorTable["errorOhSnap"] = translate("failed to create blocklist or restart DNS resolver") +errorTable["errorStopping"] = translate("failed to stop") .. " " .. packageName +errorTable["errorDNSReload"] = translate("failed to reload/restart DNS resolver") +errorTable["errorDownloadingList"] = translate("failed to download") +errorTable["errorParsingList"] = translate("failed to parse") + +m = Map("simple-adblock", translate("Simple AdBlock Settings")) +m.apply_on_parse = true +m.on_after_apply = function(self) + sys.call("/etc/init.d/simple-adblock restart") +end + +h = m:section(NamedSection, "config", "simple-adblock", translate("Service Status") .. " [" .. tmpfsVersion .. "]") -if tmpfsStatus and tmpfsStatus:match("ing") then +if tmpfsStatus == "statusStarting" or + tmpfsStatus == "statusRestarting" or + tmpfsStatus == "statusForceReloading" or + tmpfsStatus == "statusDownloading" then ss = h:option(DummyValue, "_dummy", translate("Service Status")) ss.template = "simple-adblock/status" - ss.value = tmpfsStatus .. '...' + ss.value = statusTable[tmpfsStatus] .. '...' if tmpfsMessage then sm = h:option(DummyValue, "_dummy", translate("Task")) sm.template = "simple-adblock/status" sm.value = tmpfsMessage end else - en = h:option(Button, "__toggle") - if enabledFlag ~= "1" or tmpfsStatus:match("Stopped") then - en.title = translate("Service is disabled/stopped") - en.inputtitle = translate("Enable/Start") - en.inputstyle = "apply important" + if tmpfsStatus == "statusStopped" then + ss = h:option(DummyValue, "_dummy", translate("Service Status")) + ss.template = "simple-adblock/status" + ss.value = statusTable[tmpfsStatus] if fs.access(outputCache) then sm = h:option(DummyValue, "_dummy", translate("Info")) sm.template = "simple-adblock/status" - sm.value = "Cache file containing " .. util.trim(sys.exec("wc -l < " .. outputCache)) .. " domains found." + sm.value = translate("Cache file containing") .. " " .. util.trim(sys.exec("wc -l < " .. outputCache)) .. " " .. translate("domains found") .. "." elseif fs.access(outputGzip) then sm = h:option(DummyValue, "_dummy", translate("Info")) sm.template = "simple-adblock/status" - sm.value = "Compressed cache file found." + sm.value = translate("Compressed cache file found") .. "." end else - en.title = translate("Service is enabled/started") - en.inputtitle = translate("Stop/Disable") - en.inputstyle = "reset important" ss = h:option(DummyValue, "_dummy", translate("Service Status")) ss.template = "simple-adblock/status" - ss.value = tmpfsStatus + if tmpfsStatus == "statusSuccess" then +-- ss.value = tmpfsStats + ss.value = tmpfsVersion .. " " .. translate("is blocking") .. + " " .. util.trim(sys.exec("wc -l < " .. outputFile)) .. + " " .. translate("domains") .. " (" .. translate("with") .. + " " .. targetDNS .. ")." + else + ss.value = statusTable[tmpfsStatus] + end if tmpfsMessage then ms = h:option(DummyValue, "_dummy", translate("Message")) ms.template = "simple-adblock/status" @@ -118,42 +159,28 @@ else end if tmpfsError then es = h:option(DummyValue, "_dummy", translate("Collected Errors")) - es.template = "simple-adblock/status" - es.value = tmpfsError - reload = h:option(Button, "__reload") - reload.title = translate("Service started with error") - reload.inputtitle = translate("Reload") - reload.inputstyle = "apply important" - function reload.write() - sys.exec("/etc/init.d/simple-adblock reload") - http.redirect(dispatcher.build_url("admin/services/" .. packageName)) + es.template = "simple-adblock/error" + es.value = "" + local err, e, url + for err in tmpfsError:gmatch("[%p%w]+") do + if err:match("=") then + e,url = err:match("(.+)=(.+)") + es.value = es.value .. translate("Error") .. ": " .. errorTable[e] .. " " .. url .. ".\n" + else + es.value = es.value .. translate("Error") .. ": " .. errorTable[err] .. ".\n" + end end end end - function en.write() - if tmpfsStatus and tmpfsStatus:match("Stopped") then - enabledFlag = "1" - else - enabledFlag = enabledFlag == "1" and "0" or "1" - end - uci:set(packageName, "config", "enabled", enabledFlag) - uci:save(packageName) - uci:commit(packageName) - if enabledFlag == "0" then - luci.sys.init.stop(packageName) - else - luci.sys.init.enable(packageName) - luci.sys.init.start(packageName) - end - luci.http.redirect(luci.dispatcher.build_url("admin/services/" .. packageName)) - end + buttons = h:option(DummyValue, "_dummy") + buttons.template = "simple-adblock/buttons" end s = m:section(NamedSection, "config", "simple-adblock", translate("Configuration")) -- General options s:tab("basic", translate("Basic Configuration")) -o2 = s:taboption("basic", ListValue, "verbosity", translate("Output Verbosity Setting"),translate("Controls system log and console output verbosity.")) +o2 = s:taboption("basic", ListValue, "verbosity", translate("Output Verbosity Setting"), translate("Controls system log and console output verbosity.")) o2:value("0", translate("Suppress output")) o2:value("1", translate("Some output")) o2:value("2", translate("Verbose output")) @@ -166,12 +193,12 @@ o3.default = 1 local sysfs_path = "/sys/class/leds/" local leds = {} -if nixio.fs.access(sysfs_path) then - leds = nixio.util.consume((nixio.fs.dir(sysfs_path))) +if fs.access(sysfs_path) then + leds = nutil.consume((fs.dir(sysfs_path))) end if #leds ~= 0 then o4 = s:taboption("basic", Value, "led", translate("LED to indicate status"), translate("Pick the LED not already used in") - .. [[ ]] + .. [[ ]] .. translate("System LED Configuration") .. [[]] .. ".") o4.rmempty = false o4:value("", translate("none")) diff --git a/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm new file mode 100644 index 000000000..08b725cf7 --- /dev/null +++ b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm @@ -0,0 +1,69 @@ +<%# + Copyright 2019 Stan Grishin +-%> + +<%- + local packageName = "simple-adblock" + local enabledFlag = luci.model.uci.cursor():get(packageName, "config", "enabled") + if nixio.fs.access("/var/run/" .. packageName .. ".json") then + tmpfs = luci.jsonc.parse(luci.util.trim(luci.sys.exec("cat /var/run/" .. packageName .. ".json"))) + end + local tmpfsVersion, tmpfsStatus, tmpfsMessage, tmpfsError, tmpfsStats = "", "Stopped" + if tmpfs and tmpfs['data'] then + if tmpfs['data']['status'] and tmpfs['data']['status'] ~= "" then + tmpfsStatus = tmpfs['data']['status'] + end + if tmpfs['data']['message'] and tmpfs['data']['message'] ~= "" then + tmpfsMessage = tmpfs['data']['message'] + end + if tmpfs['data']['error'] and tmpfs['data']['error'] ~= "" then + tmpfsError = tmpfs['data']['error'] + end + if tmpfs['data']['stats'] and tmpfs['data']['stats'] ~= "" then + tmpfsStats = tmpfs['data']['stats'] + end + if tmpfs['data']['version'] and tmpfs['data']['version'] ~= "" then + tmpfsVersion = " (" .. packageName .. " " .. tmpfs['data']['version'] .. ")" + end + end + if tmpfsStatus == "Stopped" then + btn_start_style = "cbi-button cbi-button-apply important" + btn_action_style = "cbi-button cbi-button-apply important" + btn_stop_style = "cbi-button cbi-button-reset -disabled" + else + btn_start_style = "cbi-button cbi-button-apply -disabled" + btn_action_style = "cbi-button cbi-button-apply important" + btn_stop_style = "cbi-button cbi-button-reset important" + end + if enabledFlag ~= "1" then + btn_start_style = "cbi-button cbi-button-apply -disabled" + btn_action_style = "cbi-button cbi-button-apply -disabled" + btn_enable_style = "cbi-button cbi-button-apply important" + btn_disable_style = "cbi-button cbi-button-reset -disabled" + else + btn_enable_style = "cbi-button cbi-button-apply -disabled" + btn_disable_style = "cbi-button cbi-button-reset important" + end +-%> + +<%+simple-adblock/css%> +<%+simple-adblock/js%> + +
+
+ + + + + + +   +   +   +   + + + + +
+
diff --git a/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/css.htm b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/css.htm new file mode 100644 index 000000000..6fb3d51d3 --- /dev/null +++ b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/css.htm @@ -0,0 +1,9 @@ + diff --git a/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/error.htm b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/error.htm new file mode 100644 index 000000000..4ab2e1129 --- /dev/null +++ b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/error.htm @@ -0,0 +1,13 @@ +<%# +Copyright 2017-2019 Stan Grishin (stangri@melmac.net) +This is free software, licensed under the Apache License, Version 2.0 +-%> + +<%+cbi/valueheader%> + + + +<%+cbi/valuefooter%> diff --git a/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/js.htm b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/js.htm new file mode 100644 index 000000000..51198293f --- /dev/null +++ b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/js.htm @@ -0,0 +1,59 @@ + \ No newline at end of file diff --git a/applications/luci-app-simple-adblock/po/templates/simple-adblock.pot b/applications/luci-app-simple-adblock/po/templates/simple-adblock.pot index 1d35060d5..9f89e6957 100644 --- a/applications/luci-app-simple-adblock/po/templates/simple-adblock.pot +++ b/applications/luci-app-simple-adblock/po/templates/simple-adblock.pot @@ -1,309 +1,452 @@ msgid "" msgstr "Content-Type: text/plain; charset=UTF-8" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:217 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:244 msgid "Add IPv6 entries" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:215 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:242 msgid "Add IPv6 entries to block-list." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:183 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:210 msgid "Advanced Configuration" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:239 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:266 msgid "" "Attempt to create a compressed cache of block-list in the persistent memory." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:154 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:181 msgid "Basic Configuration" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:267 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:294 msgid "Blacklisted Domain URLs" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:257 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:284 msgid "Blacklisted Domains" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:272 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:299 msgid "Blacklisted Hosts URLs" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:120 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:137 +msgid "Cache file containing" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:161 msgid "Collected Errors" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:152 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:141 +msgid "Compressed cache file found" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:179 msgid "Configuration" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:156 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:183 msgid "Controls system log and console output verbosity." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:230 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:257 msgid "Curl download retry" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:201 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:228 msgid "DNS Service" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:203 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:230 msgid "DNSMASQ Additional Hosts" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:204 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:231 msgid "DNSMASQ Config" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:206 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:233 msgid "DNSMASQ IP Set" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:208 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:235 msgid "DNSMASQ Servers File" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:222 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:249 msgid "Delay (in seconds) for on-boot start" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:245 +#: applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm:66 +msgid "Disable" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:272 msgid "Disable Debugging" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:216 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:243 msgid "Do not add IPv6 entries" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:240 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:267 msgid "Do not store compressed cache" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:235 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:262 msgid "Do not use simultaneous processing" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:226 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:253 msgid "Download time-out (in seconds)" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:244 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:246 -msgid "Enable Debugging" +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:86 +msgid "Downloading" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:96 -msgid "Enable/Start" +#: applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm:64 +msgid "Enable" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:244 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:271 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:273 +msgid "Enable Debugging" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:271 msgid "Enables debug output to /tmp/simple-adblock.log." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:162 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:87 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:168 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:170 +msgid "Error" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:89 +msgid "Fail" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm:56 +msgid "Force Re-Download" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:85 +msgid "Force Reloading" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:189 msgid "Force Router DNS" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:164 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:191 msgid "Force Router DNS server to all local devices" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:162 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:189 msgid "Forces Router DNS use on local devices, also known as DNS Hijacking." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:215 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:242 msgid "IPv6 Support" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:230 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:257 msgid "" "If curl is installed and detected, it would retry download this many times " "on timeout/fail." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:257 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:284 msgid "Individual domains to be blacklisted." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:252 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:279 msgid "Individual domains to be whitelisted." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:99 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:103 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:135 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:139 msgid "Info" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:173 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:200 msgid "LED to indicate status" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:234 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:261 msgid "" "Launch all lists downloads and processing simultaneously, reducing service " "start time." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:163 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:190 msgid "Let local devices use their own DNS servers if set" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:115 -msgid "Message" +#: applications/luci-app-simple-adblock/luasrc/view/simple-adblock/js.htm:51 +msgid "Loading" msgstr "" #: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:156 +msgid "Message" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:183 msgid "Output Verbosity Setting" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:185 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:212 msgid "Pick the DNS resolution option to create the adblock list for, see the" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:173 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:200 msgid "Pick the LED not already used in" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:190 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:191 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:192 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:193 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:195 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:198 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:217 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:218 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:219 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:220 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:222 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:225 msgid "Please note that" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:187 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:214 msgid "README" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:125 -msgid "Reload" +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:84 +msgid "Restarting" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:222 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:249 msgid "Run service after set delay on boot." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:81 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:84 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:111 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:115 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:121 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:131 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:144 msgid "Service Status" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:95 -msgid "Service is disabled/stopped" +#: applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua:4 +msgid "Simple AdBlock" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:108 -msgid "Service is enabled/started" +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:109 +msgid "Simple AdBlock Settings" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:124 -msgid "Service started with error" +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:261 +msgid "Simultaneous processing" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/controller/simple-adblock.lua:4 -msgid "Simple AdBlock" +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:185 +msgid "Some output" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:51 -msgid "Simple AdBlock Settings" +#: applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm:54 +msgid "Start" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:234 -msgid "Simultaneous processing" +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:83 +msgid "Starting" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:158 -msgid "Some output" +#: applications/luci-app-simple-adblock/luasrc/view/simple-adblock/buttons.htm:58 +msgid "Stop" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:226 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:253 msgid "Stop the download if it is stalled for set number of seconds." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:109 -msgid "Stop/Disable" +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:82 +msgid "Stopped" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:241 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:268 msgid "Store compressed cache" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:239 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:266 msgid "Store compressed cache file on router" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:157 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:90 +msgid "Success" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:184 msgid "Suppress output" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:175 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:202 msgid "System LED Configuration" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:88 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:125 msgid "Task" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:267 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:294 msgid "URLs to lists of domains to be blacklisted." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:262 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:289 msgid "URLs to lists of domains to be whitelisted." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:272 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:299 msgid "URLs to lists of hosts to be blacklisted." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:211 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:238 msgid "Unbound AdBlock List" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:236 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:263 msgid "Use simultaneous processing" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:159 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:186 msgid "Verbose output" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:250 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:88 +msgid "Warning" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:277 msgid "Whitelist and Blocklist Management" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:262 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:289 msgid "Whitelisted Domain URLs" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:252 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:279 msgid "Whitelisted Domains" msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:187 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:150 +msgid "domains" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:137 +msgid "domains found" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:93 +msgid "failed to access shared memory" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:91 +msgid "failed to create" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:103 +msgid "failed to create blocklist or restart DNS resolver" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:99 +msgid "failed to create compressed cache" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:106 +msgid "failed to download" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:97 +msgid "failed to format data file" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:102 +msgid "failed to move" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:98 +msgid "failed to move temporary data file to" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:95 +msgid "failed to optimize data file" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:107 +msgid "failed to parse" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:96 +msgid "failed to process whitelist" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:105 +msgid "failed to reload/restart DNS resolver" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:100 +msgid "failed to remove temporary files" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:92 +msgid "failed to restart/reload DNS resolver" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:94 +msgid "failed to sort data file" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:104 +msgid "failed to stop" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:101 +msgid "failed to unpack compressed cache" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:91 +msgid "file" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:214 msgid "for details." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:190 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:191 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:192 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:193 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:195 -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:198 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:148 +msgid "is blocking" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:81 +msgid "is not installed or not found" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:217 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:218 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:219 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:220 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:222 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:225 msgid "is not supported on this system." msgstr "" -#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:177 +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:204 msgid "none" msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:102 +msgid "to" +msgstr "" + +#: applications/luci-app-simple-adblock/luasrc/model/cbi/simple-adblock.lua:150 +msgid "with" +msgstr "" diff --git a/applications/luci-app-simple-adblock/root/etc/uci-defaults/40_luci-simple-adblock b/applications/luci-app-simple-adblock/root/etc/uci-defaults/40_luci-simple-adblock index 97bc9fbee..a1ecfcea2 100644 --- a/applications/luci-app-simple-adblock/root/etc/uci-defaults/40_luci-simple-adblock +++ b/applications/luci-app-simple-adblock/root/etc/uci-defaults/40_luci-simple-adblock @@ -1,8 +1,3 @@ #!/bin/sh -uci -q batch <<-EOF >/dev/null - delete ucitrack.@simple-adblock[-1] - commit ucitrack -EOF - -rm -f /tmp/luci-indexcache +rm -rf /var/luci-modulecache/; rm -f /var/luci-indexcache; exit 0