Skip to content

Commit

Permalink
Merge pull request openwrt#6598 from stangri/master-luci-app-adblock-…
Browse files Browse the repository at this point in the history
…fast

luci-app-adblock-fast: update to 1.0.0-3
  • Loading branch information
stangri authored Sep 28, 2023
2 parents 7676557 + 8d502df commit f51f52b
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 90 deletions.
3 changes: 2 additions & 1 deletion applications/luci-app-adblock-fast/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ include $(TOPDIR)/rules.mk

PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <[email protected]>
PKG_VERSION:=1.0.0-1
PKG_VERSION:=1.0.0-3

LUCI_TITLE:=AdBlock-Fast Web UI
LUCI_DESCRIPTION:=Provides Web UI for adblock-fast service.
LUCI_DEPENDS:=+luci-base +adblock-fast +jsonfilter
LUCI_PKGARCH:=all

include ../../luci.mk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,12 @@ var status = baseclass.extend({
),
errorDownloadingList: _("Failed to download %s"),
errorParsingConfigUpdate: _("Failed to parse Config Update file"),
errorParsingList: _("Failed to parse"),
errorParsingList: _("Failed to parse %s"),
errorNoSSLSupport: _("No HTTPS/SSL support on device"),
errorCreatingDirectory: _(
"Failed to create output/cache/gzip file directory"
),
errorDetectingFileType: _("Failed to detect format %s"),
};
var errorsTitle = E(
"label",
Expand All @@ -287,7 +288,7 @@ var status = baseclass.extend({
errorTable[element.id].format(element.extra || " ") + "<br />";
});
text += _("Errors encountered, please check the %sREADME%s!").format(
"<a href='" + pkg.URL + '" target="_blank">',
'<a href="' + pkg.URL + '" target="_blank">',
"</a><br />"
);
var errorsText = E("div", {}, text);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ return view.extend({
if (reply.platform.unbound_installed) {
o.value("unbound.adb_list", _("unbound adblock list"));
}
o.default = ("dnsmasq.servers", _("dnsmasq servers file"));
o.default = "dnsmasq.servers";

o = s1.taboption(
"tab_basic",
Expand Down Expand Up @@ -154,6 +154,23 @@ return view.extend({
)
);
o.value("*", _("AdBlock on all instances"));

// Object.values(L.uci.sections("dhcp", "dnsmasq")).forEach(function (
// val,
// index
// ) {
// const nameValueMap = new Map(Object.entries(val));
// so.value(
// nameValueMap.get(".name"),
// "%s (Name: %s, Domain: %s, Local: %s)".format(
// nameValueMap.get(".index"),
// nameValueMap.get(".name") || "noname",
// val.domain || "unset",
// val.local || "unset"
// )
// );
// });

var sections = uci.sections("dhcp", "dnsmasq");
sections.forEach((element) => {
var description;
Expand Down Expand Up @@ -182,7 +199,7 @@ return view.extend({
);
o.value("0", _("Let local devices use their own DNS servers if set"));
o.value("1", _("Force Router DNS server to all local devices"));
o.default = ("1", _("Force Router DNS server to all local devices"));
o.default = "1";

o = s1.taboption(
"tab_basic",
Expand All @@ -194,7 +211,7 @@ return view.extend({
o.value("0", _("Suppress output"));
o.value("1", _("Some output"));
o.value("2", _("Verbose output"));
o.default = ("2", _("Verbose output"));
o.default = "2";

if (reply.platform.leds.length) {
o = s1.taboption(
Expand All @@ -211,6 +228,7 @@ return view.extend({
o.value(element);
});
}

o = s1.taboption(
"tab_advanced",
form.ListValue,
Expand All @@ -220,7 +238,7 @@ return view.extend({
);
o.value("0", _("Disable"));
o.value("1", _("Enable"));
o.default = ("0", _("Disable"));
o.default = "0";

o = s1.taboption(
"tab_advanced",
Expand All @@ -233,7 +251,7 @@ return view.extend({
o.value("1", _("Add IPv6 entries"));
o.depends("dns", "dnsmasq.addnhosts");
o.depends("dns", "dnsmasq.nftset");
o.default = ("", _("Do not add IPv6 entries"));
o.default = "";
o.rmempty = true;
o.retain = true;

Expand Down Expand Up @@ -283,7 +301,7 @@ return view.extend({
);
o.value("0", _("Do not use simultaneous processing"));
o.value("1", _("Use simultaneous processing"));
o.default = ("1", _("Use simultaneous processing"));
o.default = "1";

o = s1.taboption(
"tab_advanced",
Expand All @@ -296,7 +314,7 @@ return view.extend({
);
o.value("0", _("Do not store compressed cache"));
o.value("1", _("Store compressed cache"));
o.default = ("0", _("Do not store compressed cache"));
o.default = "0";

o = s1.taboption(
"tab_advanced",
Expand All @@ -322,7 +340,7 @@ return view.extend({
);
o.value("0", _("Disable Debugging"));
o.value("1", _("Enable Debugging"));
o.default = ("0", _("Disable Debugging"));
o.default = "0";

s2 = m.section(
form.NamedSection,
Expand All @@ -332,14 +350,15 @@ return view.extend({
);
o.addremove = true;
o.rmempty = true;

o = s2.option(
form.DynamicList,
"allowed_domain",
_("Allowed Domains"),
_("Individual domains to be allowed.")
);

o.addremove = true;

o = s2.option(
form.DynamicList,
"blocked_domain",
Expand All @@ -358,6 +377,7 @@ return view.extend({
s3.sortable = true;
s3.anonymous = true;
s3.addremove = true;

o = s3.option(form.DummyValue, "_size", "Size");
o.modalonly = false;
o.cfgvalue = function (section_id) {
Expand All @@ -370,13 +390,16 @@ return view.extend({
});
return _("Size: %s").format(ret);
};

o = s3.option(form.Flag, "enabled", _("Enable"));
o.editable = true;
o.default = "1";

o = s3.option(form.ListValue, "action", _("Action"));
o.value("allow", _("Allow"));
o.value("block", _("Block"));
o.default = "block";

o = s3.option(form.Value, "url", _("URL"));
o.optional = false;

Expand Down
Loading

0 comments on commit f51f52b

Please sign in to comment.