Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luci-app-adblock-fast: update to 1.1.1-1 #6767

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/luci-app-adblock-fast/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk

PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
PKG_VERSION:=1.1.0-7
PKG_VERSION:=1.1.1-1

LUCI_TITLE:=AdBlock-Fast Web UI
LUCI_DESCRIPTION:=Provides Web UI for adblock-fast service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ var pkg = {
humanFileSize: function (bytes, si = false, dp = 2) {
return `%${si ? 1000 : 1024}.${dp ?? 0}mB`.format(bytes);
},
isObjEmpty: function (obj) {
return Object.keys(obj).length === 0;
},
};

return view.extend({
Expand Down Expand Up @@ -46,6 +49,9 @@ return view.extend({
unbound_installed: false,
leds: [],
},
pkg: (!pkg.isObjEmpty(data[2]) && data[2]) || null,
dhcp: (!pkg.isObjEmpty(data[3]) && data[3]) || null,
smartdns: (!pkg.isObjEmpty(data[4]) && data[4]) || null,
};
var status, m, s1, s2, s3, o;

Expand Down Expand Up @@ -176,127 +182,132 @@ return view.extend({
);
o.depends("dns", "dnsmasq.conf");

o = s1.taboption(
"tab_basic",
form.ListValue,
"dnsmasq_instance_option",
_("Use AdBlocking on the dnsmasq instance(s)"),
_(
"You can limit the AdBlocking to the specific dnsmasq instance(s) (%smore information%s)."
).format(
'<a href="' + pkg.URL + "#dnsmasq_instance" + '" target="_blank">',
"</a>"
)
);
o.value("*", _("AdBlock on all instances"));
o.value("+", _("AdBlock on select instances"));
o.value("-", _("No AdBlock on dnsmasq"));
o.default = "*";
o.depends("dns", "dnsmasq.addnhosts");
o.depends("dns", "dnsmasq.servers");
o.retain = true;
o.cfgvalue = function (section_id) {
let val = this.map.data.get(
this.map.config,
section_id,
"dnsmasq_instance"
if (reply.platform.dnsmasq_installed && reply.dhcp) {
o = s1.taboption(
"tab_basic",
form.ListValue,
"dnsmasq_instance_option",
_("Use AdBlocking on the dnsmasq instance(s)"),
_(
"You can limit the AdBlocking to the specific dnsmasq instance(s) (%smore information%s)."
).format(
'<a href="' + pkg.URL + "#dnsmasq_instance" + '" target="_blank">',
"</a>"
)
);
switch (val) {
case "*":
case "-":
return val;
default:
return "+";
}
};
o.write = function (section_id, formvalue) {
L.uci.set(pkg.Name, section_id, "dnsmasq_instance", formvalue);
};

o = s1.taboption(
"tab_basic",
form.MultiValue,
"dnsmasq_instance",
_("Pick the dnsmasq instance(s) for AdBlocking")
);
Object.values(L.uci.sections("dhcp", "dnsmasq")).forEach(function (
element
) {
var description;
var key;
if (element[".name"] === L.uci.resolveSID("dhcp", element[".name"])) {
key = element[".index"];
description = "dnsmasq[" + element[".index"] + "]";
} else {
key = element[".name"];
description = element[".name"];
}
o.value(key, _("%s").format(description));
});
o.depends("dnsmasq_instance_option", "+");
o.retain = true;
o.value("*", _("AdBlock on all instances"));
o.value("+", _("AdBlock on select instances"));
o.value("-", _("No AdBlock on dnsmasq"));
o.default = "*";
o.depends("dns", "dnsmasq.addnhosts");
o.depends("dns", "dnsmasq.servers");
o.retain = true;
o.cfgvalue = function (section_id) {
let val = this.map.data.get(
this.map.config,
section_id,
"dnsmasq_instance"
);
switch (val) {
case "*":
case "-":
return val;
default:
return "+";
}
};
o.write = function (section_id, formvalue) {
L.uci.set(pkg.Name, section_id, "dnsmasq_instance", formvalue);
};

o = s1.taboption(
"tab_basic",
form.ListValue,
"smartdns_instance_option",
_("Use AdBlocking on the SmartDNS instance(s)"),
_(
"You can limit the AdBlocking to the specific SmartDNS instance(s) (%smore information%s)."
).format(
'<a href="' + pkg.URL + "#smartdns_instance" + '" target="_blank">',
"</a>"
)
);
o.value("*", _("AdBlock on all instances"));
o.value("+", _("AdBlock on select instances"));
o.value("-", _("No AdBlock on SmartDNS"));
o.default = "*";
o.depends("dns", "smartdns.domainset");
o.depends("dns", "smartdns.ipset");
o.depends("dns", "smartdns.nftset");
o.retain = true;
o.cfgvalue = function (section_id) {
let val = this.map.data.get(
this.map.config,
section_id,
"smartdns_instance"
o = s1.taboption(
"tab_basic",
form.MultiValue,
"dnsmasq_instance",
_("Pick the dnsmasq instance(s) for AdBlocking")
);
switch (val) {
case "*":
case "-":
return val;
default:
return "+";
}
};
o.write = function (section_id, formvalue) {
L.uci.set(pkg.Name, section_id, "smartdns_instance", formvalue);
};
Object.values(L.uci.sections("dhcp", "dnsmasq")).forEach(function (
element
) {
var description;
var key;
if (element[".name"] === L.uci.resolveSID("dhcp", element[".name"])) {
key = element[".index"];
description = "dnsmasq[" + element[".index"] + "]";
} else {
key = element[".name"];
description = element[".name"];
}
o.value(key, _("%s").format(description));
});
o.depends("dnsmasq_instance_option", "+");
o.retain = true;
}

o = s1.taboption(
"tab_basic",
form.MultiValue,
"smartdns_instance",
_("Pick the SmartDNS instance(s) for AdBlocking")
);
Object.values(L.uci.sections("smartdns", "smartdns")).forEach(function (
element
) {
var description;
var key;
if (element[".name"] === L.uci.resolveSID("smartdns", element[".name"])) {
key = element[".index"];
description = "smartdns[" + element[".index"] + "]";
} else {
key = element[".name"];
description = element[".name"];
}
o.value(key, _("%s").format(description));
});
o.depends("smartdns_instance_option", "+");
o.retain = true;
if (reply.platform.smartdns_installed && reply.smartdns) {
o = s1.taboption(
"tab_basic",
form.ListValue,
"smartdns_instance_option",
_("Use AdBlocking on the SmartDNS instance(s)"),
_(
"You can limit the AdBlocking to the specific SmartDNS instance(s) (%smore information%s)."
).format(
'<a href="' + pkg.URL + "#smartdns_instance" + '" target="_blank">',
"</a>"
)
);
o.value("*", _("AdBlock on all instances"));
o.value("+", _("AdBlock on select instances"));
o.value("-", _("No AdBlock on SmartDNS"));
o.default = "*";
o.depends("dns", "smartdns.domainset");
o.depends("dns", "smartdns.ipset");
o.depends("dns", "smartdns.nftset");
o.retain = true;
o.cfgvalue = function (section_id) {
let val = this.map.data.get(
this.map.config,
section_id,
"smartdns_instance"
);
switch (val) {
case "*":
case "-":
return val;
default:
return "+";
}
};
o.write = function (section_id, formvalue) {
L.uci.set(pkg.Name, section_id, "smartdns_instance", formvalue);
};

o = s1.taboption(
"tab_basic",
form.MultiValue,
"smartdns_instance",
_("Pick the SmartDNS instance(s) for AdBlocking")
);
Object.values(L.uci.sections("smartdns", "smartdns")).forEach(function (
element
) {
var description;
var key;
if (
element[".name"] === L.uci.resolveSID("smartdns", element[".name"])
) {
key = element[".index"];
description = "smartdns[" + element[".index"] + "]";
} else {
key = element[".name"];
description = element[".name"];
}
o.value(key, _("%s").format(description));
});
o.depends("smartdns_instance_option", "+");
o.retain = true;
}
o = s1.taboption(
"tab_basic",
form.ListValue,
Expand Down
Loading