summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2019-08-26 20:09:58 +0200
committerGitHub <noreply@github.com>2019-08-26 20:09:58 +0200
commitf8e30d5695c612ff70e4c5cf77589d29a92bd514 (patch)
tree29ad1207c58c30212e2f44113394d1b6a02574b7
parentfbdf86f7a1610e89c2aa7d697c7a1f48da47b0b9 (diff)
parentbd405bfed02851780d74f93f8286497e7f2af4d8 (diff)
Merge pull request #3012 from dibdot/adblock
luci-app-adblock: sync with adblock 3.8.3
-rw-r--r--applications/luci-app-adblock/luasrc/controller/adblock.lua14
-rw-r--r--applications/luci-app-adblock/luasrc/view/adblock/runtime.htm8
2 files changed, 15 insertions, 7 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 || "-";
}