luci-app-adblock: sync with adblock 3.5.2
* archive sub-categories (shalla & ut_capitole) are now configurable via LuCI CBI template * small bugfixes & enhancements Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
parent
3aae6ce82e
commit
55f251b01f
2 changed files with 27 additions and 27 deletions
|
@ -9,16 +9,6 @@ local dump = util.ubus("network.interface", "dump", {})
|
||||||
local json = require("luci.jsonc")
|
local json = require("luci.jsonc")
|
||||||
local adbinput = uci:get("adblock", "global", "adb_rtfile") or "/tmp/adb_runtime.json"
|
local adbinput = uci:get("adblock", "global", "adb_rtfile") or "/tmp/adb_runtime.json"
|
||||||
|
|
||||||
if not uci:get("adblock", "extra") then
|
|
||||||
m = SimpleForm("", nil, translate("Please update your adblock config file to use this package.<br />")
|
|
||||||
.. translatef("During opkg package installation use the '--force-maintainer' option to overwrite the pre-existing config file or download a fresh default config from "
|
|
||||||
.. "<a href=\"%s\" target=\"_blank\">"
|
|
||||||
.. "here</a>", "https://raw.githubusercontent.com/openwrt/packages/master/net/adblock/files/adblock.conf"))
|
|
||||||
m.submit = false
|
|
||||||
m.reset = false
|
|
||||||
return m
|
|
||||||
end
|
|
||||||
|
|
||||||
m = Map("adblock", translate("Adblock"),
|
m = Map("adblock", translate("Adblock"),
|
||||||
translate("Configuration of the adblock package to block ad/abuse domains by using DNS. ")
|
translate("Configuration of the adblock package to block ad/abuse domains by using DNS. ")
|
||||||
.. translatef("For further information "
|
.. translatef("For further information "
|
||||||
|
@ -175,9 +165,7 @@ end
|
||||||
-- Blocklist table
|
-- Blocklist table
|
||||||
|
|
||||||
bl = m:section(TypedSection, "source", translate("Blocklist Sources"),
|
bl = m:section(TypedSection, "source", translate("Blocklist Sources"),
|
||||||
translate("Available blocklist sources. ")
|
translate("<b>Caution:</b> To prevent OOM exceptions on low memory devices with less than 64 MB free RAM, please only select a few of them!"))
|
||||||
.. translate("List URLs and Shallalist category selections are configurable in the 'Advanced' section.<br />")
|
|
||||||
.. translate("Caution: To prevent OOM exceptions on low memory devices with less than 64 MB free RAM, please do not select more than five blocklist sources!"))
|
|
||||||
bl.template = "adblock/blocklist"
|
bl.template = "adblock/blocklist"
|
||||||
|
|
||||||
name = bl:option(Flag, "enabled", translate("Enabled"))
|
name = bl:option(Flag, "enabled", translate("Enabled"))
|
||||||
|
@ -192,8 +180,13 @@ function ssl.cfgvalue(self, section)
|
||||||
return translate("No")
|
return translate("No")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
des = bl:option(DummyValue, "adb_src_desc", translate("Description"))
|
des = bl:option(DummyValue, "adb_src_desc", translate("Description"))
|
||||||
|
|
||||||
|
cat = bl:option(DynamicList, "adb_src_cat", translate("Categories"))
|
||||||
|
cat.datatype = "uciname"
|
||||||
|
cat.optional = true
|
||||||
|
|
||||||
-- Extra options
|
-- Extra options
|
||||||
|
|
||||||
e = m:section(NamedSection, "extra", "adblock", translate("Extra Options"),
|
e = m:section(NamedSection, "extra", "adblock", translate("Extra Options"),
|
||||||
|
|
|
@ -22,15 +22,27 @@ end
|
||||||
-%>
|
-%>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
<!--
|
table.cbi-section-table th,
|
||||||
|
table.cbi-section-table td,
|
||||||
.cbi-section-table-cell,
|
.cbi-section-table-cell,
|
||||||
.cbi-section-table-row
|
.cbi-section-table-row,
|
||||||
|
.cbi-input-text
|
||||||
{
|
{
|
||||||
text-align:left;
|
text-align:left;
|
||||||
|
vertical-align:top;
|
||||||
margin-right:auto;
|
margin-right:auto;
|
||||||
margin-left:0px;
|
margin-left:0px;
|
||||||
}
|
}
|
||||||
-->
|
.cbi-input-text
|
||||||
|
{
|
||||||
|
outline:none;
|
||||||
|
box-shadow:none;
|
||||||
|
background:transparent;
|
||||||
|
padding-left:2px;
|
||||||
|
line-height:25px;
|
||||||
|
height:25px;
|
||||||
|
width:10em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
|
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
|
||||||
|
@ -39,7 +51,6 @@ end
|
||||||
<%- end %>
|
<%- end %>
|
||||||
<div class="cbi-section-descr"><%=self.description%></div>
|
<div class="cbi-section-descr"><%=self.description%></div>
|
||||||
<div class="cbi-section-node">
|
<div class="cbi-section-node">
|
||||||
<%- local count = 0 -%>
|
|
||||||
<table class="cbi-section-table">
|
<table class="cbi-section-table">
|
||||||
<tr class="cbi-section-table-titles">
|
<tr class="cbi-section-table-titles">
|
||||||
<%- if self.sectionhead then -%>
|
<%- if self.sectionhead then -%>
|
||||||
|
@ -51,7 +62,7 @@ end
|
||||||
<th class="cbi-section-table-cell"<%=width(k)%>>
|
<th class="cbi-section-table-cell"<%=width(k)%>>
|
||||||
<%-=k.title-%>
|
<%-=k.title-%>
|
||||||
</th>
|
</th>
|
||||||
<%- count = count + 1; end; -%>
|
<%- end -%>
|
||||||
</tr>
|
</tr>
|
||||||
<%- local isempty = true
|
<%- local isempty = true
|
||||||
for i, k in ipairs(self:cfgsections()) do
|
for i, k in ipairs(self:cfgsections()) do
|
||||||
|
@ -63,16 +74,12 @@ end
|
||||||
<th><%=k%></th>
|
<th><%=k%></th>
|
||||||
<%-
|
<%-
|
||||||
for k, node in ipairs(self.children) do
|
for k, node in ipairs(self.children) do
|
||||||
if not node.optional then
|
|
||||||
node:render(section, scope or {})
|
node:render(section, scope or {})
|
||||||
end
|
end
|
||||||
end
|
if not scope.cbid:match("adb_src_cat") then
|
||||||
-%>
|
-%>
|
||||||
</tr>
|
<td class="cbi-value-field"> </td>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
<%- if isempty then -%>
|
|
||||||
<tr class="cbi-section-table-row">
|
|
||||||
<td colspan="<%=count%>"><em><br /><%:This section contains no values yet%></em></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in a new issue