Skip to content
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 @@ -7,7 +7,7 @@ PKG_NAME:=luci-app-adblock-fast
PKG_LICENSE:=AGPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
PKG_VERSION:=1.2.2
PKG_RELEASE:=10
PKG_RELEASE:=12

LUCI_TITLE:=AdBlock-Fast Web UI
LUCI_URL:=https://github.com/mossdef-org/luci-app-adblock-fast/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var pkg = {
return "adblock-fast";
},
get LuciCompat() {
return 13;
return 14;
},
get ReadmeCompat() {
return "";
Expand Down Expand Up @@ -227,6 +227,13 @@ var _setInitAction = rpc.declare({
expect: { result: false },
});

var _setRpcdToken = rpc.declare({
object: "luci." + pkg.Name,
method: "setRpcdToken",
params: ["name", "token"],
expect: { result: false },
});

var RPC = {
listeners: [],
on: function (event, callback) {
Expand Down Expand Up @@ -260,6 +267,9 @@ var RPC = {
}.bind(this),
);
},
setRpcdToken: function (name, token) {
return _setRpcdToken(name, token);
},
};

// Poll service status until completion (for long-running operations like download)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,27 @@ return view.extend({
o.value("1", _("Enable Debugging"));
o.default = "0";

o = s1.taboption(
"tab_advanced",
form.Value,
"rpcd_token",
_("Remote Access Token"),
_(
"Token for <a href=\"" + pkg.URL + "#chrome-extension\" target=\"_blank\">Google Chrome extension</a> or other remote API access. " +
"Copy this value into the extension settings as the password. " +
"Changing it here will update the API user password on save.",
),
);
o.default = "";
o.rmempty = true;
o.write = function (section_id, formvalue) {
var currentValue = L.uci.get(pkg.Name, section_id, "rpcd_token");
if (formvalue && formvalue !== currentValue) {
RPC.setRpcdToken(pkg.Name, formvalue);
}
return L.uci.set(pkg.Name, section_id, "rpcd_token", formvalue);
};

s2 = m.section(
form.NamedSection,
"config",
Expand Down
Loading
Loading