diff options
author | Stan Grishin <stangri@melmac.ca> | 2023-12-06 03:08:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-06 03:08:08 -0700 |
commit | 576fd044b95f13b162da7f4ed2855f78c6efce4b (patch) | |
tree | 18b300437615416384ff3ce027d7e0a993661faf /applications/luci-app-adblock-fast/htdocs/luci-static | |
parent | c0c37903f2276224c246c2a5ba0fb2732ba0e18a (diff) | |
parent | 8db9af146acc0e4d5a0aa026636943d3f28468f2 (diff) |
Merge pull request #6742 from stangri/master-luci-app-adblock-fast
luci-app-adblock-fast: update to 1.1.0-1
Diffstat (limited to 'applications/luci-app-adblock-fast/htdocs/luci-static')
-rw-r--r-- | applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js | 75 |
1 files changed, 52 insertions, 23 deletions
diff --git a/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js b/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js index ab36223983..ae8a4f2a08 100644 --- a/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js +++ b/applications/luci-app-adblock-fast/htdocs/luci-static/resources/view/adblock-fast/overview.js @@ -5,7 +5,6 @@ "use strict"; "require form"; -"require uci"; "require view"; "require adblock-fast.status as adb"; @@ -26,8 +25,9 @@ return view.extend({ return Promise.all([ L.resolveDefault(adb.getFileUrlFilesizes(pkg.Name), {}), L.resolveDefault(adb.getPlatformSupport(pkg.Name), {}), - uci.load(pkg.Name), - uci.load("dhcp"), + L.uci.load(pkg.Name), + L.uci.load("dhcp"), + L.uci.load("smartdns"), ]); }, @@ -95,6 +95,14 @@ return view.extend({ ); } } + if (!reply.platform.smartdns_installed) { + text = + text + + "<br />" + + _("Please note that %s is not supported on this system.").format( + "<i>smartdns.domainset</i>" + ); + } if (!reply.platform.unbound_installed) { text = text + @@ -122,6 +130,9 @@ return view.extend({ } o.value("dnsmasq.servers", _("dnsmasq servers file")); } + if (reply.platform.smartdns_installed) { + o.value("smartdns.domainset", _("smartdns domain set")); + } if (reply.platform.unbound_installed) { o.value("unbound.adb_list", _("unbound adblock list")); } @@ -155,27 +166,12 @@ 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) => { + Object.values(L.uci.sections("dhcp", "dnsmasq")).forEach(function ( + element + ) { var description; var key; - if (element[".name"] === uci.resolveSID("dhcp", element[".name"])) { + if (element[".name"] === L.uci.resolveSID("dhcp", element[".name"])) { key = element[".index"]; description = "dnsmasq[" + element[".index"] + "]"; } else { @@ -193,6 +189,39 @@ return view.extend({ o = s1.taboption( "tab_basic", form.ListValue, + "smartdns_instance", + _("Use AdBlocking on the SmartDNS instance(s)"), + _( + "You can limit the AdBlocking to a specific SmartDNS instance(s) (%smore information%s)." + ).format( + '<a href="' + pkg.URL + "#smartdns_instance" + '" target="_blank">', + "</a>" + ) + ); + o.value("*", _("AdBlock on all instances")); + + 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, _("AdBlock on %s only").format(description)); + }); + o.value("-", _("No AdBlock on SmartDNS")); + o.default = "*"; + o.depends("dns", "smartdns.domainset"); + o.retain = true; + + o = s1.taboption( + "tab_basic", + form.ListValue, "force_dns", _("Force Router DNS"), _("Forces Router DNS use on local devices, also known as DNS Hijacking.") @@ -381,7 +410,7 @@ return view.extend({ o = s3.option(form.DummyValue, "_size", _("Size")); o.modalonly = false; o.cfgvalue = function (section_id) { - let url = uci.get(pkg.Name, section_id, "url"); + let url = L.uci.get(pkg.Name, section_id, "url"); let ret = _("Unknown"); reply.sizes.forEach((element) => { if (element.url === url) { |