diff options
47 files changed, 526 insertions, 362 deletions
diff --git a/applications/luci-app-adblock/luasrc/controller/adblock.lua b/applications/luci-app-adblock/luasrc/controller/adblock.lua index 10110666c3..fad8834870 100644 --- a/applications/luci-app-adblock/luasrc/controller/adblock.lua +++ b/applications/luci-app-adblock/luasrc/controller/adblock.lua @@ -3,9 +3,14 @@ module("luci.controller.adblock", package.seeall) +local sys = require("luci.sys") local util = require("luci.util") +local http = require("luci.http") local templ = require("luci.template") local i18n = require("luci.i18n") +local json = require("luci.jsonc") +local uci = require("luci.model.uci").cursor() +local fs = require("nixio.fs") function index() if not nixio.fs.access("/etc/config/adblock") then @@ -13,24 +18,58 @@ function index() end entry({"admin", "services", "adblock"}, firstchild(), _("Adblock"), 30).dependent = false entry({"admin", "services", "adblock", "tab_from_cbi"}, cbi("adblock/overview_tab", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true - entry({"admin", "services", "adblock", "logfile"}, call("logread"), _("View Logfile"), 20).leaf = true + entry({"admin", "services", "adblock", "log"}, template("adblock/logread"), _("View Logfile"), 20).leaf = true entry({"admin", "services", "adblock", "advanced"}, firstchild(), _("Advanced"), 100) entry({"admin", "services", "adblock", "advanced", "blacklist"}, form("adblock/blacklist_tab"), _("Edit Blacklist"), 110).leaf = true entry({"admin", "services", "adblock", "advanced", "whitelist"}, form("adblock/whitelist_tab"), _("Edit Whitelist"), 120).leaf = true entry({"admin", "services", "adblock", "advanced", "configuration"}, form("adblock/configuration_tab"), _("Edit Configuration"), 130).leaf = true entry({"admin", "services", "adblock", "advanced", "query"}, template("adblock/query"), _("Query domains"), 140).leaf = true entry({"admin", "services", "adblock", "advanced", "result"}, call("queryData"), nil, 150).leaf = true + entry({"admin", "services", "adblock", "logread"}, call("logread"), nil).leaf = true + entry({"admin", "services", "adblock", "status"}, call("status_update"), nil).leaf = true + entry({"admin", "services", "adblock", "action"}, call("adb_action"), nil).leaf = true +end + +function adb_action(name) + if name == "do_suspend" then + luci.sys.call("/etc/init.d/adblock suspend >/dev/null 2>&1") + elseif name == "do_resume" then + 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") + end + luci.http.prepare_content("text/plain") + luci.http.write("0") +end + +function status_update() + local rt_file + local content + + rt_file = uci:get("adblock", "global", "adb_rtfile") or "/tmp/adb_runtime.json" + + if fs.access(rt_file) then + content = json.parse(fs.readfile(rt_file)) + if content then + http.prepare_content("application/json") + http.write_json(content) + end + end end function logread() - local logfile + local content if nixio.fs.access("/var/log/messages") then - logfile = util.trim(util.exec("grep -F 'adblock-' /var/log/messages")) + content = util.trim(util.exec("grep -F 'adblock-' /var/log/messages")) else - logfile = util.trim(util.exec("logread -e 'adblock-'")) + content = util.trim(util.exec("logread -e 'adblock-'")) + end + + if content == "" then + content = "No adblock related logs yet!" end - templ.render("adblock/logread", {title = i18n.translate("Adblock Logfile"), content = logfile}) + http.write(content) end function queryData(domain) diff --git a/applications/luci-app-adblock/luasrc/model/cbi/adblock/blacklist_tab.lua b/applications/luci-app-adblock/luasrc/model/cbi/adblock/blacklist_tab.lua index 39688dc194..b3b3f8d0eb 100644 --- a/applications/luci-app-adblock/luasrc/model/cbi/adblock/blacklist_tab.lua +++ b/applications/luci-app-adblock/luasrc/model/cbi/adblock/blacklist_tab.lua @@ -1,19 +1,19 @@ -- Copyright 2017-2018 Dirk Brenken (dev@brenken.org) -- This is free software, licensed under the Apache License, Version 2.0 -local fs = require("nixio.fs") -local util = require("luci.util") -local uci = require("luci.model.uci").cursor() -local adbinput = uci:get("adblock", "blacklist", "adb_src") or "/etc/adblock/adblock.blacklist" +local fs = require("nixio.fs") +local util = require("luci.util") +local uci = require("luci.model.uci").cursor() +local input = uci:get("adblock", "blacklist", "adb_src") or "/etc/adblock/adblock.blacklist" -if not fs.access(adbinput) then +if not fs.access(input) then m = SimpleForm("error", nil, translate("Input file not found, please check your configuration.")) m.reset = false m.submit = false return m end -if fs.stat(adbinput).size >= 102400 then +if fs.stat(input).size >= 102400 then m = SimpleForm("error", nil, translate("The file size is too large for online editing in LuCI (≥ 100 KB). ") .. translate("Please edit this file directly in a terminal session.")) @@ -28,7 +28,7 @@ m.submit = translate("Save") m.reset = false s = m:section(SimpleSection, nil, - translatef("This form allows you to modify the content of the adblock blacklist (%s).<br />", adbinput) + translatef("This form allows you to modify the content of the adblock blacklist (%s). ", input) .. translate("Please add only one domain per line. Comments introduced with '#' are allowed - ip addresses, wildcards and regex are not.")) f = s:option(TextValue, "data") @@ -37,11 +37,15 @@ f.rows = 20 f.rmempty = true function f.cfgvalue() - return fs.readfile(adbinput) or "" + return fs.readfile(input) or "" end function f.write(self, section, data) - return fs.writefile(adbinput, "\n" .. util.trim(data:gsub("\r\n", "\n")) .. "\n") + return fs.writefile(input, "\n" .. util.trim(data:gsub("\r\n", "\n")) .. "\n") +end + +function f.remove(self, section, value) + return fs.writefile(input, "") end function s.handle(self, state, data) diff --git a/applications/luci-app-adblock/luasrc/model/cbi/adblock/configuration_tab.lua b/applications/luci-app-adblock/luasrc/model/cbi/adblock/configuration_tab.lua index 78636038bf..1e98f0204b 100644 --- a/applications/luci-app-adblock/luasrc/model/cbi/adblock/configuration_tab.lua +++ b/applications/luci-app-adblock/luasrc/model/cbi/adblock/configuration_tab.lua @@ -1,18 +1,18 @@ -- Copyright 2017-2018 Dirk Brenken (dev@brenken.org) -- This is free software, licensed under the Apache License, Version 2.0 -local fs = require("nixio.fs") -local util = require("luci.util") -local adbinput = "/etc/config/adblock" +local fs = require("nixio.fs") +local util = require("luci.util") +local input = "/etc/config/adblock" -if not fs.access(adbinput) then +if not fs.access(input) then m = SimpleForm("error", nil, translate("Input file not found, please check your configuration.")) m.reset = false m.submit = false return m end -if fs.stat(adbinput).size >= 102400 then +if fs.stat(input).size >= 102400 then m = SimpleForm("error", nil, translate("The file size is too large for online editing in LuCI (≥ 100 KB). ") .. translate("Please edit this file directly in a terminal session.")) @@ -34,11 +34,15 @@ f.rows = 20 f.rmempty = true function f.cfgvalue() - return fs.readfile(adbinput) or "" + return fs.readfile(input) or "" end function f.write(self, section, data) - return fs.writefile(adbinput, "\n" .. util.trim(data:gsub("\r\n", "\n")) .. "\n") + return fs.writefile(input, "\n" .. util.trim(data:gsub("\r\n", "\n")) .. "\n") +end + +function f.remove(self, section, value) + return fs.writefile(input, "") end function s.handle(self, state, data) diff --git a/applications/luci-app-adblock/luasrc/model/cbi/adblock/overview_tab.lua b/applications/luci-app-adblock/luasrc/model/cbi/adblock/overview_tab.lua index da783e3361..3bf7392914 100644 --- a/applications/luci-app-adblock/luasrc/model/cbi/adblock/overview_tab.lua +++ b/applications/luci-app-adblock/luasrc/model/cbi/adblock/overview_tab.lua @@ -1,69 +1,32 @@ -- Copyright 2017-2018 Dirk Brenken (dev@brenken.org) -- This is free software, licensed under the Apache License, Version 2.0 -local fs = require("nixio.fs") -local uci = require("luci.model.uci").cursor() -local sys = require("luci.sys") -local util = require("luci.util") -local dump = util.ubus("network.interface", "dump", {}) -local json = require("luci.jsonc") -local adbinput = uci:get("adblock", "global", "adb_rtfile") or "/tmp/adb_runtime.json" +local fs = require("nixio.fs") +local uci = require("luci.model.uci").cursor() +local sys = require("luci.sys") +local util = require("luci.util") +local dump = util.ubus("network.interface", "dump", {}) m = Map("adblock", translate("Adblock"), translate("Configuration of the adblock package to block ad/abuse domains by using DNS. ") .. translatef("For further information " .. "<a href=\"%s\" target=\"_blank\">" .. "check the online documentation</a>", "https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md")) -m.apply_on_parse = true function m.on_apply(self) luci.sys.call("/etc/init.d/adblock reload >/dev/null 2>&1") - luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adblock")) end -- Main adblock options s = m:section(NamedSection, "global", "adblock") -local parse = json.parse(fs.readfile(adbinput) or "") -if parse then - status = parse.data.adblock_status - version = parse.data.adblock_version - domains = parse.data.overall_domains - fetch = parse.data.fetch_utility - backend = parse.data.dns_backend - rundate = parse.data.last_rundate -end - o1 = s:option(Flag, "adb_enabled", translate("Enable Adblock")) o1.default = o1.disabled o1.rmempty = false -btn = s:option(Button, "", translate("Suspend / Resume Adblock")) -if parse and status == "enabled" then - btn.inputtitle = translate("Suspend") - btn.inputstyle = "reset" - btn.disabled = false - function btn.write() - luci.sys.call("/etc/init.d/adblock suspend >/dev/null 2>&1") - luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adblock")) - end -elseif parse and status == "paused" then - btn.inputtitle = translate("Resume") - btn.inputstyle = "apply" - btn.disabled = false - function btn.write() - luci.sys.call("/etc/init.d/adblock resume >/dev/null 2>&1") - luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adblock")) - end -else - btn.inputtitle = translate("-------") - btn.inputstyle = "button" - btn.disabled = true -end - o2 = s:option(ListValue, "adb_dns", translate("DNS Backend (DNS Directory)"), - translate("List of supported DNS backends with their default list export directory.<br />") + translate("List of supported DNS backends with their default list export directory. ") .. translate("To overwrite the default path use the 'DNS Directory' option in the extra section below.")) o2:value("dnsmasq", "dnsmasq (/tmp)") o2:value("unbound", "unbound (/var/lib/unbound)") @@ -85,7 +48,7 @@ o3.default = "uclient-fetch" o3.rmempty = false o4 = s:option(ListValue, "adb_trigger", translate("Startup Trigger"), - translate("List of available network interfaces. Usually the startup will be triggered by the 'wan' interface.<br />") + translate("List of available network interfaces. Usually the startup will be triggered by the 'wan' interface. ") .. translate("Choose 'none' to disable automatic startups, 'timed' to use a classic timeout (default 30 sec.) or select another trigger interface.")) o4:value("none") o4:value("timed") @@ -101,66 +64,8 @@ o4.rmempty = false -- Runtime information -ds = m:section(NamedSection, "global", "adblock", translate("Runtime Information")) - -dv1 = ds:option(DummyValue, "", translate("Adblock Status")) -dv1.template = "adblock/runtime" -if parse == nil then - dv1.value = translate("n/a") -else - if status == "error" then - dv1.value = translate("error") - elseif status == "disabled" then - dv1.value = translate("disabled") - elseif status == "paused" then - dv1.value = translate("paused") - elseif status == "running" then - dv1.value = translate("running") - else - dv1.value = translate("enabled") - end -end - -dv2 = ds:option(DummyValue, "", translate("Adblock Version")) -dv2.template = "adblock/runtime" -if parse == nil then - dv2.value = translate("n/a") -else - dv2.value = version -end - -dv3 = ds:option(DummyValue, "", translate("Download Utility (SSL Library)"), - translate("For SSL protected blocklist sources you need a suitable SSL library, e.g. 'libustream-ssl' or 'built-in'.")) -dv3.template = "adblock/runtime" -if parse == nil then - dv3.value = translate("n/a") -else - dv3.value = fetch -end - -dv4 = ds:option(DummyValue, "", translate("DNS Backend (DNS Directory)")) -dv4.template = "adblock/runtime" -if parse == nil then - dv4.value = translate("n/a") -else - dv4.value = backend -end - -dv5 = ds:option(DummyValue, "", translate("Overall Domains")) -dv5.template = "adblock/runtime" -if parse == nil then - dv5.value = translate("n/a") -else - dv5.value = domains -end - -dv6 = ds:option(DummyValue, "", translate("Last Run")) -dv6.template = "adblock/runtime" -if parse == nil then - dv6.value = translate("n/a") -else - dv6.value = rundate -end +ds = s:option(DummyValue, "_dummy") +ds.template = "adblock/runtime" -- Blocklist table @@ -197,46 +102,54 @@ e1 = e:option(Flag, "adb_debug", translate("Verbose Debug Logging"), e1.default = e1.disabled e1.rmempty = false -e2 = e:option(Flag, "adb_forcedns", translate("Force Local DNS"), - translate("Redirect all DNS queries from 'lan' zone to the local resolver.")) +e2 = e:option(Flag, "adb_nice", translate("Low Priority Service"), + translate("Set the nice level to 'low priority' and the adblock background processing will take less resources from the system. ") + ..translate("This change requires a manual service stop/re-start to take effect.")) e2.default = e2.disabled +e2.disabled = "0" +e2.enabled = "10" e2.rmempty = false -e3 = e:option(Flag, "adb_forcesrt", translate("Force Overall Sort"), - translate("Enable memory intense overall sort / duplicate removal on low memory devices (< 64 MB free RAM)")) +e3 = e:option(Flag, "adb_forcedns", translate("Force Local DNS"), + translate("Redirect all DNS queries from 'lan' zone to the local resolver, apply to udp and tcp protocol on ports 53, 853 and 5353.")) e3.default = e3.disabled e3.rmempty = false -e4 = e:option(Flag, "adb_backup", translate("Enable Blocklist Backup"), - translate("Create compressed blocklist backups, they will be used in case of download errors or during startup in backup mode.")) +e4 = e:option(Flag, "adb_forcesrt", translate("Force Overall Sort"), + translate("Enable memory intense overall sort / duplicate removal on low memory devices (< 64 MB free RAM)")) e4.default = e4.disabled e4.rmempty = false -e5 = e:option(Value, "adb_backupdir", translate("Backup Directory"), +e5 = e:option(Flag, "adb_backup", translate("Enable Blocklist Backup"), + translate("Create compressed blocklist backups, they will be used in case of download errors or during startup in backup mode.")) +e5.default = e5.disabled +e5.rmempty = false + +e6 = e:option(Value, "adb_backupdir", translate("Backup Directory"), translate("Target directory for adblock backups. Please use only non-volatile disks, e.g. an external usb stick.")) -e5:depends("adb_backup", 1) -e5.datatype = "directory" -e5.default = "/mnt" +e6:depends("adb_backup", 1) +e6.datatype = "directory" +e6.default = "/mnt" e5.rmempty = true -e6 = e:option(Flag, "adb_backup_mode", translate("Backup Mode"), +e7 = e:option(Flag, "adb_backup_mode", translate("Backup Mode"), translate("Do not automatically update blocklists during startup, use blocklist backups instead.")) -e6:depends("adb_backup", 1) -e6.default = e6.disabled -e6.rmempty = true +e7:depends("adb_backup", 1) +e7.default = e7.disabled +e7.rmempty = true -e7 = e:option(Value, "adb_maxqueue", translate("Max. Download Queue"), - translate("Size of the download queue to handle downloads & list processing in parallel (default '4').<br />") +e8 = e:option(Value, "adb_maxqueue", translate("Max. Download Queue"), + translate("Size of the download queue to handle downloads & list processing in parallel (default '4'). ") .. translate("For further performance improvements you can raise this value, e.g. '8' or '16' should be safe.")) -e7.default = 4 -e7.datatype = "range(1,32)" -e7.rmempty = false +e8.default = 4 +e8.datatype = "range(1,32)" +e8.rmempty = false -e8 = e:option(Flag, "adb_jail", translate("'Jail' Blocklist Creation"), - translate("Builds an additional 'Jail' list (/tmp/adb_list.jail) to block access to all domains except those listed in the whitelist file.<br />") +e9 = e:option(Flag, "adb_jail", translate("'Jail' Blocklist Creation"), + translate("Builds an additional 'Jail' list (/tmp/adb_list.jail) to block access to all domains except those listed in the whitelist file. ") .. translate("You can use this restrictive blocklist manually e.g. for guest wifi or kidsafe configurations.")) -e8.default = e8.disabled -e8.rmempty = true +e9.default = e9.disabled +e9.rmempty = true e9 = e:option(Flag, "adb_dnsflush", translate("Flush DNS Cache"), translate("Flush DNS Cache after adblock processing.")) @@ -244,13 +157,13 @@ e9.default = e9.disabled e9.rmempty = true e10 = e:option(Flag, "adb_notify", translate("Email Notification"), - translate("Send notification emails in case of a processing error or if domain count is ≤ 0.<br />") + translate("Send notification emails in case of a processing error or if domain count is ≤ 0. ") .. translate("Please note: this needs additional 'msmtp' package installation and setup.")) e10.default = e10.disabled e10.rmempty = true e11 = e:option(Value, "adb_notifycnt", translate("Email Notification Count"), - translate("Raise the minimum email notification count, to get emails if the overall count is less or equal to the given limit (default 0),<br />") + translate("Raise the minimum email notification count, to get emails if the overall count is less or equal to the given limit (default 0), ") .. translate("e.g. to receive an email notification with every adblock update set this value to 150000.")) e11.default = 0 e11.datatype = "min(0)" diff --git a/applications/luci-app-adblock/luasrc/model/cbi/adblock/whitelist_tab.lua b/applications/luci-app-adblock/luasrc/model/cbi/adblock/whitelist_tab.lua index 01d3911f6e..a78d9af4ac 100644 --- a/applications/luci-app-adblock/luasrc/model/cbi/adblock/whitelist_tab.lua +++ b/applications/luci-app-adblock/luasrc/model/cbi/adblock/whitelist_tab.lua @@ -1,19 +1,19 @@ -- Copyright 2017-2018 Dirk Brenken (dev@brenken.org) -- This is free software, licensed under the Apache License, Version 2.0 -local fs = require("nixio.fs") -local util = require("luci.util") -local uci = require("luci.model.uci").cursor() -local adbinput = uci:get("adblock", "global", "adb_whitelist") or "/etc/adblock/adblock.whitelist" +local fs = require("nixio.fs") +local util = require("luci.util") +local uci = require("luci.model.uci").cursor() +local input = uci:get("adblock", "global", "adb_whitelist") or "/etc/adblock/adblock.whitelist" -if not fs.access(adbinput) then +if not fs.access(input) then m = SimpleForm("error", nil, translate("Input file not found, please check your configuration.")) m.reset = false m.submit = false return m end -if fs.stat(adbinput).size >= 102400 then +if fs.stat(input).size >= 102400 then m = SimpleForm("error", nil, translate("The file size is too large for online editing in LuCI (≥ 100 KB). ") .. translate("Please edit this file directly in a terminal session.")) @@ -28,7 +28,7 @@ m.submit = translate("Save") m.reset = false s = m:section(SimpleSection, nil, - translatef("This form allows you to modify the content of the adblock whitelist (%s).<br />", adbinput) + translatef("This form allows you to modify the content of the adblock whitelist (%s). ", input) .. translate("Please add only one domain per line. Comments introduced with '#' are allowed - ip addresses, wildcards and regex are not.")) f = s:option(TextValue, "data") @@ -37,11 +37,15 @@ f.rows = 20 f.rmempty = true function f.cfgvalue() - return fs.readfile(adbinput) or "" + return fs.readfile(input) or "" end function f.write(self, section, data) - return fs.writefile(adbinput, "\n" .. util.trim(data:gsub("\r\n", "\n")) .. "\n") + return fs.writefile(input, "\n" .. util.trim(data:gsub("\r\n", "\n")) .. "\n") +end + +function f.remove(self, section, value) + return fs.writefile(input, "") end function s.handle(self, state, data) diff --git a/applications/luci-app-adblock/luasrc/view/adblock/blocklist.htm b/applications/luci-app-adblock/luasrc/view/adblock/blocklist.htm index 93713c92b1..f59e518574 100644 --- a/applications/luci-app-adblock/luasrc/view/adblock/blocklist.htm +++ b/applications/luci-app-adblock/luasrc/view/adblock/blocklist.htm @@ -4,35 +4,20 @@ This is free software, licensed under the Apache License, Version 2.0 -%> <%- -local rowcnt = 1 -function rowstyle() - rowcnt = rowcnt + 1 - return (rowcnt % 2) + 1 -end - -function width(o) - if o.width then - if type(o.width) == 'number' then - return ' style="width:%dpx"' % o.width - end - return ' style="width:%s"' % o.width - end - return '' -end +local anonclass = (not self.anonymous or self.sectiontitle) and "named" or "anonymous" -%> <style type="text/css"> .table.cbi-section-table .th, .table.cbi-section-table .td, .cbi-section-table-cell, -.cbi-section-table-row +.cbi-section-table-row, +.tr[data-title]::before { text-align:left; vertical-align:top; - margin-right:auto; margin-left:0px; padding-left:2px; - line-height:20px; } .table.cbi-section-table .th { @@ -42,6 +27,12 @@ end { width:7em; } +.cbi-section-table-row > .cbi-value-field [data-dynlist] > input, +.table.cbi-section-table input +{ + width:7em; +} + .cbi-input-text { text-align:left; @@ -49,36 +40,29 @@ end outline:none; box-shadow:none; background:transparent; - height:20px; - width:10em; + width:7em; } </style> -<%- - local anonclass = (not self.anonymous or self.sectiontitle) and "named" or "anonymous" - local titlename = ifattr(not self.anonymous or self.sectiontitle, "data-title", translate("Name")) --%> - -<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>"> +<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>"> <% if self.title then -%> <legend><%=self.title%></legend> <%- end %> <div class="cbi-section-descr"><%=self.description%></div> <div class="cbi-section-node"> <div class="table cbi-section-table"> - <div class="tr cbi-section-table-titles <%=anonclass%>"<%=titlename%>> + <div class="tr cbi-section-table-titles <%=anonclass%>"> <%- for i, k in pairs(self.children) do -%> - <div class="th cbi-section-table-cell"<%=width(k)%>> + <div class="th cbi-section-table-cell"> <%-=k.title-%> </div> <%- end -%> </div> - <%- local isempty = true + <%- local section, scope, isempty = true for i, k in ipairs(self:cfgsections()) do - local section = k - local sectionname = striptags((type(self.sectiontitle) == "function") and self:sectiontitle(section) or k) + section = k + local sectionname = striptags((type(self.sectiontitle) == "function") and self:sectiontitle(section) or k) local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle), "data-title", sectionname) - isempty = false scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" } -%> @@ -95,4 +79,4 @@ end <%- end -%> </div> </div> -</fieldset> +</div> diff --git a/applications/luci-app-adblock/luasrc/view/adblock/logread.htm b/applications/luci-app-adblock/luasrc/view/adblock/logread.htm index 082ec806f8..b505233490 100644 --- a/applications/luci-app-adblock/luasrc/view/adblock/logread.htm +++ b/applications/luci-app-adblock/luasrc/view/adblock/logread.htm @@ -4,17 +4,47 @@ This is free software, licensed under the Apache License, Version 2.0 -%> <%+header%> - -<div class="cbi-map"> - <fieldset class="cbi-section"> - <div class="cbi-section-descr"><%:This form shows the syslog output, pre-filtered for adblock related messages only.%></div> - <textarea id="logread_id" style="width: 100%; height: 450px; border: 1px solid #cccccc; padding: 5px; font-size: 12px; font-family: monospace; resize: none;" readonly="readonly" wrap="off" rows="<%=content:cmatch("\n")+2%>"><%=content:pcdata()%></textarea> - </fieldset> -</div> +<style type="text/css"> + select[readonly], + textarea[readonly] + { + width: 100%; + height: 450px; + border: 1px solid #cccccc; + padding: 5px; + font-size: 12px; + font-family: monospace; + resize: none; + pointer-events: auto; + cursor: auto; + } +</style> <script type="text/javascript"> - var textarea = document.getElementById('logread_id'); - textarea.scrollTop = textarea.scrollHeight; +//<![CDATA[ + function log_update() + { + XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "adblock", "logread")%>', null, + function(x) + { + if (!x) + { + return; + } + var view = document.getElementById("view_id"); + view.value = x.responseText; + view.scrollTop = view.scrollHeight; + }); + } + window.onload = log_update(); +//]]> </script> +<div class="cbi-map"> + <div class="cbi-section"> + <div class="cbi-section-descr"><%:The syslog output, pre-filtered for adblock related messages only.%></div> + <textarea id="view_id" readonly="readonly" wrap="off" value=""></textarea> + </div> +</div> + <%+footer%> diff --git a/applications/luci-app-adblock/luasrc/view/adblock/query.htm b/applications/luci-app-adblock/luasrc/view/adblock/query.htm index 72dc16b1d8..2cf7e5baaf 100644 --- a/applications/luci-app-adblock/luasrc/view/adblock/query.htm +++ b/applications/luci-app-adblock/luasrc/view/adblock/query.htm @@ -1,5 +1,5 @@ <%# -Copyright 2017 Dirk Brenken (dev@brenken.org) +Copyright 2017-2018 Dirk Brenken (dev@brenken.org) This is free software, licensed under the Apache License, Version 2.0 -%> @@ -12,7 +12,7 @@ This is free software, licensed under the Apache License, Version 2.0 function update_status(data) { var domain = data.value; - var input = document.getElementById('query_input'); + var input = document.getElementById('query_input'); var output = document.getElementById('query_output'); if (input && output) @@ -45,20 +45,20 @@ This is free software, licensed under the Apache License, Version 2.0 <form method="post" action="<%=REQUEST_URI%>"> <div class="cbi-map"> - <fieldset class="cbi-section"> + <div class="cbi-section"> <div class="cbi-section-descr"><%:This form allows you to query active block lists for certain domains, e.g. for whitelisting.%></div> <div style="width:33%; float:left;"> - <input style="margin: 5px 0" type="text" value="google.com" name="input" /> + <input type="text" value="google.com" name="input" /> <input type="button" value="<%:Query%>" class="cbi-button cbi-button-apply" onclick="update_status(this.form.input)" /> </div> <br style="clear:both" /> <br /> - </fieldset> + </div> </div> - <fieldset class="cbi-section" style="display:none"> - <legend id="query_input"><%:Collecting data...%></legend> + <div class="cbi-section" style="display:none"> + <h3 id="query_input"><%:Collecting data...%></h3> <span id="query_output"></span> - </fieldset> + </div> </form> <%+footer%> diff --git a/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm b/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm index c01d9a5c08..7609ba5e66 100644 --- a/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm +++ b/applications/luci-app-adblock/luasrc/view/adblock/runtime.htm @@ -1,10 +1,200 @@ <%# Copyright 2017-2018 Dirk Brenken (dev@brenken.org) This is free software, licensed under the Apache License, Version 2.0 +local sys = require("luci.sys") + -%> +<style type="text/css"> +.runtime +{ + color:#0069d6; + font-weight:bold; + display:inline-block; + width:100%; + padding-top: 0.5rem; +} +</style> + +<script type="text/javascript"> +//<![CDATA[ + function status_update(json) + { + var view = document.getElementById("value_1"); + var btn1 = document.getElementById("btn1"); + var btn2 = document.getElementById("btn2"); + var input = json.data.adblock_status; + + view.innerHTML = input || "-"; + if (input === "enabled") + { + btn1.value = "<%:Suspend%>"; + btn1.name = "do_suspend"; + btn2.value = "<%:Refresh%>"; + btn2.name = "do_refresh"; + btn1.disabled = false; + running(btn1_running, 0); + btn2.disabled = false; + running(btn2_running, 0); + } + else if (input === "paused") + { + btn1.value = "<%:Resume%>"; + btn1.name = "do_resume"; + btn2.value = "<%:Refresh%>"; + btn2.name = "do_refresh"; + btn1.disabled = false; + running(btn1_running, 0); + btn2.disabled = false; + running(btn2_running, 0); + } + else + { + btn1.value = "<%:Suspend%>"; + btn1.name = "do_suspend"; + btn2.value = "<%:Refresh%>"; + btn2.name = "do_refresh"; + btn1.disabled = true; + btn2.disabled = true; + } + view = document.getElementById("value_2"); + input = json.data.adblock_version; + view.innerHTML = input || "-"; + view = document.getElementById("value_3"); + input = json.data.fetch_utility; + view.innerHTML = input || "-"; + view = document.getElementById("value_4"); + input = json.data.dns_backend; + view.innerHTML = input || "-"; + view = document.getElementById("value_5"); + input = json.data.overall_domains; + view.innerHTML = input || "-"; + view = document.getElementById("value_6"); + input = json.data.last_rundate; + view.innerHTML = input || "-"; + } + + function btn_action(action) + { + var btn1 = document.getElementById("btn1"); + var btn1_running = document.getElementById("btn1_running"); + var btn2 = document.getElementById("btn2"); + var btn2_running = document.getElementById("btn2_running"); + + btn1.disabled = true; + btn2.disabled = true; + + if (action.name === "do_refresh") + { + running(btn2_running, 1); + } + else + { + running(btn1_running, 1); + } + + new XHR.get('<%=luci.dispatcher.build_url("admin", "services", "adblock")%>/action/' + action.name, null, + function(x) + { + if (!x) + { + return; + } + }); + } + + function running(element, state) + { + if (state === 1) + { + var running_html = '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" width="16" height="16" style="vertical-align:middle" />'; + element.innerHTML = running_html; + } + else + { + element.innerHTML = ''; + } + } -<%+cbi/valueheader%> + XHR.get('<%=luci.dispatcher.build_url("admin", "services", "adblock", "status")%>', null, + function(x, json_info) + { + if (!x || !json_info) + { + var btn1 = document.getElementById("btn1"); + var btn2 = document.getElementById("btn2"); + btn1.value = "<%:Suspend%>"; + btn1.name = "do_suspend"; + btn2.value = "<%:Refresh%>"; + btn2.name = "do_refresh"; + btn1.disabled = true; + btn2.disabled = false; + return; + } + status_update(json_info) + }); -<input name="runtime" id="runtime" type="text" class="cbi-input-text" style="outline:none;border:none;box-shadow:none;background:transparent;color:#0069d6;font-weight:bold;line-height:30px;height:30px;width:20em;" value="<%=self:cfgvalue(section)%>" disabled="disabled" /> + XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "adblock", "status")%>', null, + function(x, json_info) + { + if (!x || !json_info) + { + return; + } + status_update(json_info) + }); +//]]> +</script> -<%+cbi/valuefooter%> +<h3><%:Runtime Information%></h3> +<div class="cbi-value" id="status_1"> + <label class="cbi-value-title" for="status_1"><%:Adblock Status%></label> + <div class="cbi-value-field"> + <span class="runtime" id="value_1">-</span> + </div> +</div> +<div class="cbi-value" id="status_2"> + <label class="cbi-value-title" for="status_2"><%:Adblock Version%></label> + <div class="cbi-value-field"> + <span class="runtime" id="value_2">-</span> + </div> +</div> +<div class="cbi-value" id="status_3"> + <label class="cbi-value-title" for="status_3"><%:Download Utility (SSL Library)%></label> + <div class="cbi-value-field"> + <span class="runtime" id="value_3">-</span> + </div> +</div> +<div class="cbi-value" id="status_4"> + <label class="cbi-value-title" for="status_4"><%:DNS Backend (DNS Directory)%></label> + <div class="cbi-value-field"> + <span class="runtime" id="value_4">-</span> + </div> +</div> +<div class="cbi-value" id="status_5"> + <label class="cbi-value-title" for="status_5"><%:Overall Domains%></label> + <div class="cbi-value-field"> + <span class="runtime" id="value_5">-</span> + </div> +</div> +<div class="cbi-value" id="status_6"> + <label class="cbi-value-title" for="status_6"><%:Last Run%></label> + <div class="cbi-value-field"> + <span class="runtime" id="value_6">-</span> + </div> +</div> +<hr /> +<div class="cbi-value" id="button_1"> + <label class="cbi-value-title" for="button_1"><%:Suspend / Resume Adblock%></label> + <div class="cbi-value-field"> + <input class="cbi-button cbi-button-reset" id="btn1" type="button" value="" onclick="btn_action(this)" /> + <span id="btn1_running" style="display:inline-block; width:16px; height:16px; margin:0 5px"></span> + </div> +</div> +<p /> +<div class="cbi-value" id="button_2"> + <label class="cbi-value-title" for="button_2"><%:Refresh Blocklist Sources%></label> + <div class="cbi-value-field"> + <input class="cbi-button cbi-button-apply" id="btn2" type="button" value="" onclick="btn_action(this)" /> + <span id="btn2_running" style="display:inline-block; width:16px; height:16px; margin:0 5px"></span> + </div> +</div> diff --git a/collections/luci/Makefile b/collections/luci/Makefile index 3c765c396b..c3174e8b9a 100644 --- a/collections/luci/Makefile +++ b/collections/luci/Makefile @@ -12,7 +12,7 @@ LUCI_BASENAME:=luci LUCI_TITLE:=LuCI interface with Uhttpd as Webserver (default) LUCI_DESCRIPTION:=Standard OpenWrt set including full admin with ppp support and the default Bootstrap theme LUCI_DEPENDS:= \ - +uhttpd +uhttpd-mod-ubus +luci-mod-admin-full +luci-theme-bootstrap \ + +uhttpd +luci-mod-admin-full +luci-theme-bootstrap \ +luci-app-firewall +luci-proto-ppp +libiwinfo-lua +IPV6:luci-proto-ipv6 \ +rpcd-mod-rrdns diff --git a/contrib/package/freifunk-common/files/usr/sbin/ff_olsr_watchdog b/contrib/package/freifunk-common/files/usr/sbin/ff_olsr_watchdog index 069f4c3217..8ac803d309 100755 --- a/contrib/package/freifunk-common/files/usr/sbin/ff_olsr_watchdog +++ b/contrib/package/freifunk-common/files/usr/sbin/ff_olsr_watchdog @@ -23,6 +23,15 @@ if fs.access("/var/run/olsrd.pid") or fs.access("/var/run/olsrd4.pid") then if not wdgtime or ( systime - wdgtime ) > ( intv * 2 ) then os.execute("logger -t 'OLSR watchdog' 'Process died - restarting!'") + local tnls = io.popen("ip tunnel show | cut -d : -f 1") + while true do + tnl = tnls:read("*line") + if tnl == nil then break end + if string.find(tnl, "tnl_") == 1 then + os.execute(string.format("logger -t 'OLSR watchdog' 'Deleting stale tunnel %s'", tnl)) + os.execute(string.format("ip link del %s", tnl)) + end + end os.execute("/etc/init.d/olsrd restart") end end diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 89dfac9e46..fcfc506942 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -627,6 +627,18 @@ function cbi_init() { s.parentNode.classList.add('cbi-tooltip-container'); }); + document.querySelectorAll('.cbi-section-remove > input[name^="cbi.rts"]').forEach(function(i) { + var handler = function(ev) { + var bits = this.name.split(/\./), + section = document.getElementById('cbi-' + bits[2] + '-' + bits[3]); + + section.style.opacity = (ev.type === 'mouseover') ? 0.5 : ''; + }; + + i.addEventListener('mouseover', handler); + i.addEventListener('mouseout', handler); + }); + cbi_d_update(); } @@ -818,9 +830,9 @@ function cbi_dynlist_init(parent, datatype, optional, choices) t.placeholder = holder; } - var b = document.createElement('img'); - b.src = cbi_strings.path.resource + ((i+1) < values.length ? '/cbi/remove.gif' : '/cbi/add.gif'); - b.className = 'cbi-image-button'; + var b = E('div', { + class: 'cbi-button cbi-button-' + ((i+1) < values.length ? 'remove' : 'add') + }, (i+1) < values.length ? '×' : '+'); parent.appendChild(t); parent.appendChild(b); @@ -986,8 +998,7 @@ function cbi_dynlist_init(parent, datatype, optional, choices) input = input.previousSibling; } - if (se.src.indexOf('remove') > -1) - { + if (se.classList.contains('cbi-button-remove')) { input.value = ''; cbi_dynlist_keydown({ @@ -995,8 +1006,7 @@ function cbi_dynlist_init(parent, datatype, optional, choices) keyCode: 8 }); } - else - { + else { cbi_dynlist_keydown({ target: input, keyCode: 13 diff --git a/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm b/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm index dbb0e1120b..ea0568f409 100644 --- a/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm +++ b/modules/luci-base/luasrc/view/cbi/cell_valueheader.htm @@ -1,10 +1,12 @@ <%- local title = luci.util.trim(striptags(self.title)) - local ftype = self.template and self.template:gsub("^.+/", "") + local descr = luci.util.trim(striptags(self.description)) + local ftype = self.typename or (self.template and self.template:gsub("^.+/", "")) -%> <div class="td cbi-value-field<% if self.error and self.error[section] then %> cbi-value-error<% end %>"<%= attr("data-name", self.option) .. ifattr(ftype and #ftype > 0, "data-type", ftype) .. - ifattr(title and #title > 0, "data-title", title) + ifattr(title and #title > 0, "data-title", title) .. + ifattr(descr and #descr > 0, "data-description", descr) %>> <div id="cbi-<%=self.config.."-"..section.."-"..self.option%>" data-index="<%=self.index%>" data-depends="<%=pcdata(self:deplist2json(section))%>"> diff --git a/modules/luci-base/luasrc/view/cbi/ucisection.htm b/modules/luci-base/luasrc/view/cbi/ucisection.htm index 2cb1e75d0e..8fa11d68f8 100644 --- a/modules/luci-base/luasrc/view/cbi/ucisection.htm +++ b/modules/luci-base/luasrc/view/cbi/ucisection.htm @@ -32,25 +32,25 @@ <% if self.optionals[section] and #self.optionals[section] > 0 or self.dynamic then %> <div class="cbi-optionals" data-index="<%=#self.children + 1%>"> - <% + <%- if self.dynamic then local keys, vals, name, opt = { }, { } for name, opt in pairs(self.optionals[section]) do keys[#keys+1] = name vals[#vals+1] = opt.title end - %> + -%> <input type="text" id="cbi.opt.<%=self.config%>.<%=section%>" name="cbi.opt.<%=self.config%>.<%=section%>" data-type="uciname" data-optional="true"<%= ifattr(#keys > 0, "data-choices", luci.util.json_encode({keys, vals})) %> /> - <% else %> + <%- else -%> <select id="cbi.opt.<%=self.config%>.<%=section%>" name="cbi.opt.<%=self.config%>.<%=section%>" data-optionals="true"> <option><%: -- Additional Field -- %></option> <% for key, val in pairs(self.optionals[section]) do -%> <option id="cbi-<%=self.config.."-"..section.."-"..val.option%>" value="<%=val.option%>" data-index="<%=val.index%>" data-depends="<%=pcdata(val:deplist2json(section))%>"><%=striptags(val.title)%></option> <%- end %> </select> - <% end %> + <%- end -%> <input type="submit" class="cbi-button cbi-button-fieldadd" value="<%:Add%>" /> </div> <% end %> diff --git a/modules/luci-base/luasrc/view/cbi/value.htm b/modules/luci-base/luasrc/view/cbi/value.htm index c8c905eb11..942ab72e77 100644 --- a/modules/luci-base/luasrc/view/cbi/value.htm +++ b/modules/luci-base/luasrc/view/cbi/value.htm @@ -1,10 +1,16 @@ <%+cbi/valueheader%> + <%- if self.password then -%> + <input type="password" style="position:absolute; left:-1000px"<%= + attr("name", "password." .. cbid) + %> /> + <%- end -%> <input data-update="change"<%= attr("id", cbid) .. attr("name", cbid) .. attr("type", self.password and "password" or "text") .. attr("class", self.password and "cbi-input-password" or "cbi-input-text") .. attr("value", self:cfgvalue(section) or self.default) .. + ifattr(self.password, "autocomplete", "new-password") .. ifattr(self.size, "size") .. ifattr(self.placeholder, "placeholder") .. ifattr(self.readonly, "readonly") .. @@ -14,5 +20,7 @@ ifattr(self.combobox_manual, "data-manual", self.combobox_manual) .. ifattr(#self.keylist > 0, "data-choices", { self.keylist, self.vallist }) %> /> - <% if self.password then %><img src="<%=resource%>/cbi/reload.gif" style="vertical-align:middle" title="<%:Reveal/hide password%>" onclick="var e = document.getElementById('<%=cbid%>'); e.type = (e.type=='password') ? 'text' : 'password';" /><% end %> + <%- if self.password then -%> + <div class="cbi-button cbi-button-neutral" title="<%:Reveal/hide password%>" onclick="var e = this.previousElementSibling; e.type = (e.type === 'password') ? 'text' : 'password'">∗</div> + <% end %> <%+cbi/valuefooter%> diff --git a/modules/luci-base/po/ca/base.po b/modules/luci-base/po/ca/base.po index 12ccb0a42a..5885894499 100644 --- a/modules/luci-base/po/ca/base.po +++ b/modules/luci-base/po/ca/base.po @@ -274,9 +274,6 @@ msgstr "Alerta" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/cs/base.po b/modules/luci-base/po/cs/base.po index 2d81e890ff..4075c5b06f 100644 --- a/modules/luci-base/po/cs/base.po +++ b/modules/luci-base/po/cs/base.po @@ -272,9 +272,6 @@ msgstr "Upozornění" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/de/base.po b/modules/luci-base/po/de/base.po index 7775e65a83..fd7bb4c388 100644 --- a/modules/luci-base/po/de/base.po +++ b/modules/luci-base/po/de/base.po @@ -271,9 +271,6 @@ msgid "Alert" msgstr "Alarm" msgid "Alias Interface" -msgstr "" - -msgid "Alias interface" msgstr "Alias-Schnittstelle" msgid "Alias of \"%s\"" diff --git a/modules/luci-base/po/el/base.po b/modules/luci-base/po/el/base.po index 86483ca6d9..cb5706930a 100644 --- a/modules/luci-base/po/el/base.po +++ b/modules/luci-base/po/el/base.po @@ -274,9 +274,6 @@ msgstr "Ειδοποίηση" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/en/base.po b/modules/luci-base/po/en/base.po index c5e15b492d..dc5c22a659 100644 --- a/modules/luci-base/po/en/base.po +++ b/modules/luci-base/po/en/base.po @@ -271,9 +271,6 @@ msgstr "Alert" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/es/base.po b/modules/luci-base/po/es/base.po index 2c1459b66d..635dc11603 100644 --- a/modules/luci-base/po/es/base.po +++ b/modules/luci-base/po/es/base.po @@ -275,9 +275,6 @@ msgstr "Alerta" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/fr/base.po b/modules/luci-base/po/fr/base.po index 56944b263e..3805627b6b 100644 --- a/modules/luci-base/po/fr/base.po +++ b/modules/luci-base/po/fr/base.po @@ -277,9 +277,6 @@ msgstr "Alerte" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/he/base.po b/modules/luci-base/po/he/base.po index dee9e73e5f..6a5be78feb 100644 --- a/modules/luci-base/po/he/base.po +++ b/modules/luci-base/po/he/base.po @@ -269,9 +269,6 @@ msgstr "אזעקה" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/hu/base.po b/modules/luci-base/po/hu/base.po index 6dab15caa9..4b66806a83 100644 --- a/modules/luci-base/po/hu/base.po +++ b/modules/luci-base/po/hu/base.po @@ -272,9 +272,6 @@ msgstr "Riasztás" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/it/base.po b/modules/luci-base/po/it/base.po index e7d6d6b242..1fe6d06cb9 100644 --- a/modules/luci-base/po/it/base.po +++ b/modules/luci-base/po/it/base.po @@ -281,9 +281,6 @@ msgstr "Allerta" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/ja/base.po b/modules/luci-base/po/ja/base.po index e1610d09ba..fd60f84da6 100644 --- a/modules/luci-base/po/ja/base.po +++ b/modules/luci-base/po/ja/base.po @@ -275,9 +275,6 @@ msgstr "警告" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/ko/base.po b/modules/luci-base/po/ko/base.po index 647d910100..2d53437dbd 100644 --- a/modules/luci-base/po/ko/base.po +++ b/modules/luci-base/po/ko/base.po @@ -266,9 +266,6 @@ msgstr "" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/ms/base.po b/modules/luci-base/po/ms/base.po index c183f702e5..891db2e41f 100644 --- a/modules/luci-base/po/ms/base.po +++ b/modules/luci-base/po/ms/base.po @@ -261,9 +261,6 @@ msgstr "" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/no/base.po b/modules/luci-base/po/no/base.po index e5470e03e2..d5c65659e8 100644 --- a/modules/luci-base/po/no/base.po +++ b/modules/luci-base/po/no/base.po @@ -270,9 +270,6 @@ msgstr "Varsle" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/pl/base.po b/modules/luci-base/po/pl/base.po index e872c7e204..61aee199b7 100644 --- a/modules/luci-base/po/pl/base.po +++ b/modules/luci-base/po/pl/base.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: LuCI\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-04-20 09:40+0200\n" -"PO-Revision-Date: 2018-07-14 21:35+0200\n" +"PO-Revision-Date: 2018-07-21 18:35+0200\n" "Last-Translator: Rixerx <krystian.kozak20@gmail.com>\n" "Language-Team: Polish\n" "Language: pl\n" @@ -279,16 +279,13 @@ msgid "Alert" msgstr "Alarm" msgid "Alias Interface" -msgstr "" - -msgid "Alias interface" -msgstr "Alias interfejsu" +msgstr "Alias Interfejsu" msgid "Alias of \"%s\"" -msgstr "" +msgstr "Alias \"%s\"" msgid "All Servers" -msgstr "" +msgstr "Wszystkie serwery" msgid "" "Allocate IP addresses sequentially, starting from the lowest available " @@ -303,7 +300,7 @@ msgid "Allow <abbr title=\"Secure Shell\">SSH</abbr> password authentication" msgstr "Pozwól na logowanie <abbr title=\"Secure Shell\">SSH</abbr>" msgid "Allow AP mode to disconnect STAs based on low ACK condition" -msgstr "" +msgstr "Pozwól aby tryb AP rozłączał stacje STA w oparciu o niski stan ACK" msgid "Allow all except listed" msgstr "Pozwól wszystkim oprócz wymienionych" @@ -342,6 +339,8 @@ msgid "" "Always use 40MHz channels even if the secondary channel overlaps. Using this " "option does not comply with IEEE 802.11n-2009!" msgstr "" +"Zawsze używaj kanału 40 MHz, nawet jeśli kanał dodatkowy nachodzi na inny. " +"Używanie tej opcji nie jest zgodne z IEEE 802.11n-2009!" msgid "Annex" msgstr "" @@ -541,7 +540,7 @@ msgid "Band" msgstr "" msgid "Beacon Interval" -msgstr "" +msgstr "Interwał Beaconu" msgid "" "Below is the determined list of files to backup. It consists of changed " @@ -577,7 +576,6 @@ msgstr "Interfejs mostu" msgid "Bridge unit number" msgstr "Numer Mostu (urządzenia)" -# Podejrzewam że chodzi o interfejs? mam rację? msgid "Bring up on boot" msgstr "Podnieś przy stracie" @@ -860,7 +858,7 @@ msgid "DSL line mode" msgstr "" msgid "DTIM Interval" -msgstr "" +msgstr "Interwał DTIM" msgid "DUID" msgstr "DUID" @@ -901,12 +899,11 @@ msgid "Delete this network" msgstr "Usuń tą sieć" msgid "Delivery Traffic Indication Message Interval" -msgstr "" +msgstr "Interwał komunikatu o wskazaniu dostawy ruchu" msgid "Description" msgstr "Opis" -# Ktoś tłumaczył bez zobaczenia tego w gui. Dotyczy zmiany motywu ten opis. msgid "Design" msgstr "Motyw" @@ -963,7 +960,7 @@ msgid "Disabled (default)" msgstr "Wyłączone (domyślnie)" msgid "Disassociate On Low Acknowledgement" -msgstr "" +msgstr "Rozłączaj przy niskim stanie ramek ACK" msgid "Discard upstream RFC1918 responses" msgstr "Odrzuć wychodzące odpowiedzi RFC1918" @@ -990,15 +987,14 @@ msgstr "" msgid "Diversity" msgstr "Wielorakość" -# Nie wiem czy nie zamotałem ja rozumiem;) msgid "" "Dnsmasq is a combined <abbr title=\"Dynamic Host Configuration Protocol" "\">DHCP</abbr>-Server and <abbr title=\"Domain Name System\">DNS</abbr>-" "Forwarder for <abbr title=\"Network Address Translation\">NAT</abbr> " "firewalls" msgstr "" -"Dnsmasq jest to serwer <abbr title=\"Dynamic Host Configuration Protocol" -"\">DHCP</abbr> połączony z serwerem <abbr title=\"Domain Name System\">DNS</" +"Dnsmasq jest kombajnem serwera <abbr title=\"Dynamic Host Configuration Protocol" +"\">DHCP</abbr> połączonym z serwerem <abbr title=\"Domain Name System\">DNS</" "abbr>. Jest to serwer przekazujący (Fowarder) dla firewalli <abbr title=" "\"Network Address Translation\">NAT</abbr>" @@ -1055,7 +1051,6 @@ msgstr "" msgid "Dual-Stack Lite (RFC6333)" msgstr "" -# "n" brakowało... msgid "Dynamic <abbr title=\"Dynamic Host Configuration Protocol\">DHCP</abbr>" msgstr "" "<abbr title=\"Dynamic Host Configuration Protocol\">DHCP</abbr> dynamiczne" @@ -1334,7 +1329,7 @@ msgid "Force" msgstr "Wymuś" msgid "Force 40MHz mode" -msgstr "" +msgstr "Wymuś tryb 40MHz" msgid "Force CCMP (AES)" msgstr "Wymuś CCMP (AES)" @@ -1733,7 +1728,6 @@ msgstr "" msgid "Interface Configuration" msgstr "Konfiguracja Interfejsu" -# Tam jest lista interfejsów.... msgid "Interface Overview" msgstr "Przegląd Interfejsów" @@ -1752,7 +1746,6 @@ msgstr "Interfejsy" msgid "Internal" msgstr "" -# Nadużycie tagu abbr uważam za uzasadnione. msgid "Internal Server Error" msgstr "Wewnętrzny błąd serwera" @@ -2013,7 +2006,7 @@ msgid "Lowest leased address as offset from the network address." msgstr "Najniższy wydzierżawiony adres jako offset dla adresu sieci." msgid "MAC" -msgstr "" +msgstr "MAC" msgid "MAC-Address" msgstr "Adres MAC" @@ -2260,7 +2253,7 @@ msgid "No rules in this chain" msgstr "Brak zasad w tym łańcuchu" msgid "No scan results available yet..." -msgstr "" +msgstr "Brak wyników skanowania..." msgid "No zone assigned" msgstr "Brak przypisanej strefy" @@ -2699,6 +2692,7 @@ msgid "" "Query all available upstream <abbr title=\"Domain Name System\">DNS</abbr> " "servers" msgstr "" +"Zapytaj o wszystkie dostępne serwery <abbr title=\"Domain Name System\">DNS</abbr> " msgid "R0 Key Lifetime" msgstr "" @@ -2995,11 +2989,10 @@ msgid "Scan" msgstr "Skanuj" msgid "Scan request failed" -msgstr "" +msgstr "Próba skanowania nie powiodła się" -# Raczej nie stosuje się kilku dużych liter w tym samym msgid "Scheduled Tasks" -msgstr "Zaplanowane zadania" +msgstr "Zaplanowane Zadania" msgid "Section added" msgstr "Dodano sekcję" @@ -3059,7 +3052,7 @@ msgid "Short GI" msgstr "" msgid "Short Preamble" -msgstr "" +msgstr "Krótki Wstęp" msgid "Show current backup file list" msgstr "Pokaż aktualną listę plików do backupu" @@ -3169,7 +3162,7 @@ msgid "Starting configuration apply…" msgstr "" msgid "Starting wireless scan..." -msgstr "" +msgstr "Rozpoczynanie skanowania..." msgid "Startup" msgstr "Autostart" @@ -3936,7 +3929,7 @@ msgid "" msgstr "" "Tutaj można włączyć lub wyłączyć zainstalowane skrypty. Zmiany zostaną " "zastosowane po ponownym uruchomieniu urządzenia.<br /><strong>Ostrzeżenie: " -"Jeśli wyłączysz podstawowe skrypty typu \"networks\", urządzenie może stać " +"Jeśli wyłączysz podstawowe skrypty typu \"network\", urządzenie może stać " "się nieosiągalne!</strong>" msgid "" @@ -4034,7 +4027,7 @@ msgid "minutes" msgstr "minuty" msgid "mixed WPA/WPA2" -msgstr "" +msgstr "mieszany WPA/WPA2" msgid "no" msgstr "nie" diff --git a/modules/luci-base/po/pt-br/base.po b/modules/luci-base/po/pt-br/base.po index d440b2872d..63a8b2f340 100644 --- a/modules/luci-base/po/pt-br/base.po +++ b/modules/luci-base/po/pt-br/base.po @@ -294,9 +294,6 @@ msgstr "Alerta" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/pt/base.po b/modules/luci-base/po/pt/base.po index 36320d9954..d548b7c8d5 100644 --- a/modules/luci-base/po/pt/base.po +++ b/modules/luci-base/po/pt/base.po @@ -280,9 +280,6 @@ msgstr "Alerta" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/ro/base.po b/modules/luci-base/po/ro/base.po index 109550a90b..a28235bbd7 100644 --- a/modules/luci-base/po/ro/base.po +++ b/modules/luci-base/po/ro/base.po @@ -267,9 +267,6 @@ msgstr "Alerta" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/ru/base.po b/modules/luci-base/po/ru/base.po index 4f40770984..8d542e6018 100644 --- a/modules/luci-base/po/ru/base.po +++ b/modules/luci-base/po/ru/base.po @@ -276,9 +276,6 @@ msgstr "Тревога" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/sk/base.po b/modules/luci-base/po/sk/base.po index 750fe8c809..7cf9f6febb 100644 --- a/modules/luci-base/po/sk/base.po +++ b/modules/luci-base/po/sk/base.po @@ -255,9 +255,6 @@ msgstr "" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/sv/base.po b/modules/luci-base/po/sv/base.po index b88715debc..76b5825906 100644 --- a/modules/luci-base/po/sv/base.po +++ b/modules/luci-base/po/sv/base.po @@ -263,9 +263,6 @@ msgstr "Varning" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/templates/base.pot b/modules/luci-base/po/templates/base.pot index 80feb44efa..2dacedfe79 100644 --- a/modules/luci-base/po/templates/base.pot +++ b/modules/luci-base/po/templates/base.pot @@ -248,9 +248,6 @@ msgstr "" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/tr/base.po b/modules/luci-base/po/tr/base.po index 5710ff3f4f..383c683068 100644 --- a/modules/luci-base/po/tr/base.po +++ b/modules/luci-base/po/tr/base.po @@ -266,9 +266,6 @@ msgstr "Uyarı" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/uk/base.po b/modules/luci-base/po/uk/base.po index e58b2d9d6e..e4cf1ed0a8 100644 --- a/modules/luci-base/po/uk/base.po +++ b/modules/luci-base/po/uk/base.po @@ -291,9 +291,6 @@ msgstr "Тривога" msgid "Alias Interface" msgstr "Інтерфейс псевдоніма" -msgid "Alias interface" -msgstr "Інтерфейс псевдоніма" - msgid "Alias of \"%s\"" msgstr "Псевдонім \"%s\"" diff --git a/modules/luci-base/po/vi/base.po b/modules/luci-base/po/vi/base.po index 315f260d02..6451853bb4 100644 --- a/modules/luci-base/po/vi/base.po +++ b/modules/luci-base/po/vi/base.po @@ -262,9 +262,6 @@ msgstr "" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/zh-cn/base.po b/modules/luci-base/po/zh-cn/base.po index 23a3ee2940..d142390e1a 100644 --- a/modules/luci-base/po/zh-cn/base.po +++ b/modules/luci-base/po/zh-cn/base.po @@ -260,9 +260,6 @@ msgstr "警戒" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-base/po/zh-tw/base.po b/modules/luci-base/po/zh-tw/base.po index c4e29a31cc..579d52656a 100644 --- a/modules/luci-base/po/zh-tw/base.po +++ b/modules/luci-base/po/zh-tw/base.po @@ -265,9 +265,6 @@ msgstr "警示" msgid "Alias Interface" msgstr "" -msgid "Alias interface" -msgstr "" - msgid "Alias of \"%s\"" msgstr "" diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_overview.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_overview.lua index 32bf1965f3..ad20f09187 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_overview.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi_overview.lua @@ -70,7 +70,7 @@ local tpl_radio = tpl.Template(nil, [[ <!-- physical device --> <div class="tr cbi-rowstyle-2"> <div class="td col-2 center middle"> - <span class="ifacebadge"><img src="<%=resource%>/icons/wifi_toggled.png" id="<%=dev:name()%>-iw-upstate" /> <%=dev:name()%></span> + <span class="ifacebadge"><img src="<%=resource%>/icons/wifi_disabled.png" id="<%=dev:name()%>-iw-upstate" /> <%=dev:name()%></span> </div> <div class="td col-7 left middle"> <big><strong><%=hw%></strong></big><br /> @@ -115,8 +115,8 @@ local tpl_radio = tpl.Template(nil, [[ </div> <% end %> <% else %> - <div class="tr cbi-rowstyle-2"> - <div class="td left"> + <div class="tr placeholder"> + <div class="td"> <em><%:No network configured on this device%></em> </div> </div> diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview_status.htm index 2c89d10430..7427154a04 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview_status.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview_status.htm @@ -94,7 +94,7 @@ if (ifc.is_dynamic) desc = '<%:Virtual dynamic interface%>'; else if (ifc.is_alias) - desc = '<%:Alias interface%>'; + desc = '<%:Alias Interface%>'; if (ifc.desc) desc = desc ? '%s (%s)'.format(desc, ifc.desc) : ifc.desc; @@ -110,7 +110,7 @@ if (!ifc.is_dynamic && !ifc.is_alias) { if (ifc.macaddr) - html += String.format('<strong><%:MAC-Address%>:</strong> %s<br />', ifc.macaddr); + html += String.format('<strong><%:MAC%>:</strong> %s<br />', ifc.macaddr); html += String.format( '<strong><%:RX%>:</strong> %.2mB (%d <%:Pkts.%>)<br />' + diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm index 9c5173dae2..34be35dd20 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm @@ -17,7 +17,7 @@ html += String.format('<strong><%:Uptime%>:</strong> %t<br />', ifc.uptime); if (ifc.macaddr) - html += String.format('<strong><%:MAC-Address%>:</strong> %s<br />', ifc.macaddr); + html += String.format('<strong><%:MAC%>:</strong> %s<br />', ifc.macaddr); html += String.format( '<strong><%:RX%></strong>: %.2mB (%d <%:Pkts.%>)<br />' + diff --git a/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css b/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css index a6ff0dc733..a85d95a95f 100644 --- a/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css +++ b/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css @@ -598,12 +598,6 @@ textarea[readonly] { cursor: default; } -select[readonly], -textarea[readonly] { - pointer-events: auto; - cursor: auto; -} - .cbi-optionals, .cbi-section-create { padding: 0 0 10px 10px; @@ -1457,6 +1451,32 @@ footer { opacity: .6; } +input[type="text"] + .cbi-button, +input[type="password"] + .cbi-button, +select + .cbi-button { + border-radius: 0 3px 3px 0; + border-color: #ccc; + margin: 0 0 1px -2px; + padding: 0 6px; + vertical-align: top; + height: 28px; + font-size: 14px; + font-weight: bold; + line-height: 28px; +} + +select + .cbi-button { + border-left-color: transparent; +} + +.cbi-title-ref { + color: #37c; +} + +.cbi-title-ref::after { + content: "➙"; +} + .cbi-tooltip-container { cursor: help; } diff --git a/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css b/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css index dc36ab3f95..4d3333739c 100644 --- a/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css +++ b/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css @@ -429,11 +429,11 @@ p { } .cbi-title-ref { - color: inherit; - text-decoration: none; - padding-right: 18px; - background: url('../resources/cbi/link.gif') no-repeat scroll right center; - background-color: inherit; + color: #37c; +} + +.cbi-title-ref::after { + content: "➙"; } ul.cbi-apply { @@ -850,7 +850,9 @@ div.cbi-optionals { margin-left: 50%; } -.cbi-page-actions > .cbi-button-apply + .cbi-button-save { +.cbi-page-actions > .cbi-button-apply + .cbi-button-save, +.cbi-page-actions > .cbi-button-save + form[method="post"], +.cbi-page-actions > form[method="post"] + form[method="post"] { margin-left: 3px; } @@ -874,7 +876,18 @@ div.cbi-optionals { white-space: nowrap; } -.tr.placeholder .td[data-title]::before { +.td[data-description]::after { + content: attr(data-description); + font-size: 90%; + text-align: left; + display: none; + background: url(/luci-static/resources/cbi/help.gif) left top no-repeat; + padding: .125em 0 .125em 18px; + margin: .125em 0; +} + +.tr.placeholder .td[data-title]::before, +.tr.placeholder .td[data-description]::after { display: none; } @@ -1133,6 +1146,19 @@ ul.cbi-tabmenu li.cbi-tab { opacity: .6; } +input[type="text"] + .cbi-button, +input[type="password"] + .cbi-button, +select + .cbi-button { + border-radius: 0 3px 3px 0; + border: 1px outset #000; + margin: 0 0 1px -2px; + padding: 0 6px; + vertical-align: top; + display: inline-block; + height: 14pt; + font-size: 10pt; + line-height: 12pt; +} .cbi-tooltip-container { cursor: help; @@ -1183,13 +1209,13 @@ ul.cbi-tabmenu li.cbi-tab { } -.left, .left::before { text-align: left !important; } -.right, .right::before { text-align: right !important; } -.center, .center::before { text-align: center !important; } +.left, .left::before, .left::after { text-align: left !important; } +.right, .right::before, .right::after { text-align: right !important; } +.center, .center::before, .center::after { text-align: center !important; } -.top, .top::before { vertical-align: top !important; } -.middle, .middle::before { vertical-align: middle !important; } -.bottom, .bottom::before { vertical-align: bottom !important; } +.top, .top::before, .top::after { vertical-align: top !important; } +.middle, .middle::before, .middle::after { vertical-align: middle !important; } +.bottom, .bottom::before, .bottom::after { vertical-align: bottom !important; } .td.top { align-self: flex-start; vertical-align: top; } .td.middle { align-self: center; vertical-align: middle; } @@ -1602,12 +1628,18 @@ ul.cbi-tabmenu li.cbi-tab { background: #eef; } - .td[data-title]::before { + .td[data-title]::before, + .td[data-description]::after { display: block; } .td[data-title] ~ .td.cbi-section-actions { - align-self: flex-end; + align-self: flex-start; + } + + .td[data-title] ~ .td.cbi-section-actions::before { + display: block; + content: "\a0"; } .hide-sm, |