diff options
Diffstat (limited to 'applications')
5 files changed, 18 insertions, 78 deletions
diff --git a/applications/luci-app-adblock/luasrc/controller/adblock.lua b/applications/luci-app-adblock/luasrc/controller/adblock.lua index d75296275f..bee1d14396 100644 --- a/applications/luci-app-adblock/luasrc/controller/adblock.lua +++ b/applications/luci-app-adblock/luasrc/controller/adblock.lua @@ -53,12 +53,6 @@ function adb_action(name, ...) luci.sys.call("/etc/init.d/adblock resume >/dev/null 2>&1") elseif name == "do_refresh" then luci.sys.call("/etc/init.d/adblock reload >/dev/null 2>&1") - local pid_file = "/var/run/adblock.pid" - if nixio.fs.access(pid_file) then - repeat - nixio.nanosleep(1) - until nixio.fs.readfile(pid_file) == "" - end elseif name == "do_report" then luci.sys.call("/etc/init.d/adblock report " ..table.concat(report_params, " ").. " >/dev/null 2>&1") local rep_dir = uci:get("adblock", "extra", "adb_repdir") or "/tmp" @@ -90,6 +84,14 @@ function adb_action(name, ...) end end end + if name == "do_suspend" or name == "do_resume" or name == "do_refresh" then + local pid_file = "/var/run/adblock.pid" + if nixio.fs.access(pid_file) then + repeat + nixio.nanosleep(1) + until nixio.fs.readfile(pid_file) == "" + end + end luci.http.prepare_content("text/plain") luci.http.write("0") end diff --git a/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm b/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm index b5cf832913..2cec573346 100644 --- a/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm +++ b/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm @@ -6,6 +6,12 @@ This is free software, licensed under the Apache License, Version 2.0 <%+adblock/adblock_css%> <script type="text/javascript"> //<![CDATA[ + function format(number) + { + var string = number.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1.'); + return string; + } + function status_update(json) { var btn1 = document.getElementById("btn1"); @@ -52,7 +58,7 @@ This is free software, licensed under the Apache License, Version 2.0 document.getElementById("value_4").innerHTML = json.data.dns_backend || "-"; document.getElementById("value_5").innerHTML = json.data.dns_variant || "-"; document.getElementById("value_6").innerHTML = json.data.backup_dir || "-"; - document.getElementById("value_7").innerHTML = json.data.overall_domains || "-"; + document.getElementById("value_7").innerHTML = format(json.data.overall_domains) || "-"; document.getElementById("value_8").innerHTML = json.data.last_rundate || "-"; } diff --git a/applications/luci-app-advanced-reboot/Makefile b/applications/luci-app-advanced-reboot/Makefile index 5381059da7..329acece4f 100644 --- a/applications/luci-app-advanced-reboot/Makefile +++ b/applications/luci-app-advanced-reboot/Makefile @@ -13,7 +13,7 @@ LUCI_DESCRIPTION:=Provides Web UI (found under System/Advanced Reboot) to reboot LUCI_DEPENDS:=+luci-mod-admin-full LUCI_PKGARCH:=all -PKG_RELEASE:=41 +PKG_RELEASE:=42 include ../../luci.mk diff --git a/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua b/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua index e1f6daac18..7332424866 100644 --- a/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua +++ b/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua @@ -88,10 +88,11 @@ end function action_reboot() local uci = require "luci.model.uci".cursor() + local ip = uci:get("network", "lan", "ipaddr") luci.template.render("admin_system/applyreboot", { title = luci.i18n.translate("Rebooting..."), msg = luci.i18n.translate("The system is rebooting now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."), - addr = luci.ip.new(uci:get("network", "lan", "ipaddr")) or "192.168.1.1" + addr = luci.ip.new(type(ip) == "string" and ip or "192.168.1.1") or "192.168.1.1" }) luci.sys.reboot() end diff --git a/applications/luci-app-simple-adblock/luasrc/model/cbi/simpleadblock.lua b/applications/luci-app-simple-adblock/luasrc/model/cbi/simpleadblock.lua deleted file mode 100644 index 22672124fc..0000000000 --- a/applications/luci-app-simple-adblock/luasrc/model/cbi/simpleadblock.lua +++ /dev/null @@ -1,69 +0,0 @@ -m = Map("simple-adblock", translate("Simple AdBlock Settings")) -s = m:section(NamedSection, "config", "simple-adblock") - --- General options -e = s:option(Flag, "enabled", translate("Start Simple Adblock service")) -e.rmempty = false -function e.write(self, section, value) - if value ~= "1" then - luci.sys.init.stop("simple-adblock") - end - return Flag.write(self, section, value) -end - -o2 = s:option(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")) -o2.rmempty = false -o2.default = 2 - -o3 = s:option(ListValue, "force_dns", translate("Force Router DNS"), translate("Forces Router DNS use on local devices, also known as DNS Hijacking")) -o3:value("0", translate("Let local devices use their own DNS servers if set")) -o3:value("1", translate("Force Router DNS server to all local devices")) -o3.rmempty = false -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))) -end -if #leds ~= 0 then - o3 = s:option(Value, "led", translate("LED to indicate status"), translate("Pick the LED not already used in") - .. [[ <a href="]] .. luci.dispatcher.build_url("admin/system/leds") .. [[">]] - .. translate("System LED Configuration") .. [[</a>]]) - o3.rmempty = true - o3:value("", translate("none")) - for k, v in ipairs(leds) do - o3:value(v) - end -end - -s2 = m:section(NamedSection, "config", "simple-adblock") --- Whitelisted Domains -d1 = s2:option(DynamicList, "whitelist_domain", translate("Whitelisted Domains"), translate("Individual domains to be whitelisted")) -d1.addremove = false -d1.optional = false - --- Blacklisted Domains -d3 = s2:option(DynamicList, "blacklist_domain", translate("Blacklisted Domains"), translate("Individual domains to be blacklisted")) -d3.addremove = false -d3.optional = false - --- Whitelisted Domains URLs -d2 = s2:option(DynamicList, "whitelist_domains_url", translate("Whitelisted Domain URLs"), translate("URLs to lists of domains to be whitelisted")) -d2.addremove = false -d2.optional = false - --- Blacklisted Domains URLs -d4 = s2:option(DynamicList, "blacklist_domains_url", translate("Blacklisted Domain URLs"), translate("URLs to lists of domains to be blacklisted")) -d4.addremove = false -d4.optional = false - --- Blacklisted Hosts URLs -d5 = s2:option(DynamicList, "blacklist_hosts_url", translate("Blacklisted Hosts URLs"), translate("URLs to lists of hosts to be blacklisted")) -d5.addremove = false -d5.optional = false - -return m |