diff options
author | Stan Grishin <stangri@melmac.ca> | 2024-07-29 14:35:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-29 14:35:00 -0700 |
commit | 52bbc55f6d911dfa57b6d0c6482a212775f5cfda (patch) | |
tree | 1dd73924ef16e312416e20a53e0ba80fa1a88a05 /applications/luci-app-https-dns-proxy/htdocs/luci-static/resources | |
parent | 975b5d3ad668bbb31f342a22de3e6f1b89ef7b1e (diff) | |
parent | 9c836d14734f069421a459a63436d07cc91dd760 (diff) |
Merge pull request #7215 from stangri/master-luci-app-https-dns-proxy
luci-app-https-dns-proxy: bugfix: OpenDNS family filter URL update
Diffstat (limited to 'applications/luci-app-https-dns-proxy/htdocs/luci-static/resources')
3 files changed, 20 insertions, 78 deletions
diff --git a/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js b/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js index 0ae128b923..37675c5b83 100644 --- a/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js +++ b/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/https-dns-proxy/status.js @@ -13,8 +13,16 @@ var pkg = { get Name() { return "https-dns-proxy"; }, + get ReadmeCompat() { + return ""; + }, get URL() { - return "https://docs.openwrt.melmac.net/" + pkg.Name + "/"; + return ( + "https://docs.openwrt.melmac.net/" + + pkg.Name + + "/" + + (pkg.ReadmeCompat ? pkg.ReadmeCompat + "/" : "") + ); }, templateToRegexp: function (template) { return RegExp( @@ -30,6 +38,9 @@ var pkg = { "$" ); }, + templateToResolver: function (template, args) { + return template.replace(/{(\w+)}/g, (_, v) => args[v]); + }, }; var getInitList = rpc.declare({ @@ -428,6 +439,8 @@ RPC.on("setInitAction", function (reply) { return L.Class.extend({ status: status, + pkg: pkg, + getInitStatus: getInitStatus, getPlatformSupport: getPlatformSupport, getProviders: getProviders, getRuntime: getRuntime, diff --git a/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js b/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js index 86cafd1030..5922a35279 100644 --- a/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js +++ b/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js @@ -11,34 +11,7 @@ "require view"; "require https-dns-proxy.status as hdp"; -var pkg = { - get Name() { - return "https-dns-proxy"; - }, - - get URL() { - return "https://docs.openwrt.melmac.net/" + pkg.Name + "/"; - }, - - templateToRegexp: function (template) { - return RegExp( - "^" + - template - .split(/(\{\w+\})/g) - .map((part) => { - let placeholder = part.match(/^\{(\w+)\}$/); - if (placeholder) return `(?<${placeholder[1]}>.*?)`; - else return part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - }) - .join("") + - "$" - ); - }, - - templateToResolver: function (template, args) { - return template.replace(/{(\w+)}/g, (_, v) => args[v]); - }, -}; +var pkg = hdp.pkg; return view.extend({ load: function () { diff --git a/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/status/include/71_https-dns-proxy.js b/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/status/include/71_https-dns-proxy.js index 8723b6e653..401e1546d1 100644 --- a/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/status/include/71_https-dns-proxy.js +++ b/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/status/include/71_https-dns-proxy.js @@ -3,62 +3,18 @@ "require uci"; "require form"; "require baseclass"; +"require https-dns-proxy.status as hdp"; -var pkg = { - get Name() { - return "https-dns-proxy"; - }, - get URL() { - return "https://docs.openwrt.melmac.net/" + pkg.Name + "/"; - }, - templateToRegexp: function (template) { - return RegExp( - "^" + - template - .split(/(\{\w+\})/g) - .map((part) => { - let placeholder = part.match(/^\{(\w+)\}$/); - if (placeholder) return `(?<${placeholder[1]}>.*?)`; - else return part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - }) - .join("") + - "$" - ); - }, -}; - -var getInitStatus = rpc.declare({ - object: "luci." + pkg.Name, - method: "getInitStatus", - params: ["name"], -}); - -var getPlatformSupport = rpc.declare({ - object: "luci." + pkg.Name, - method: "getPlatformSupport", - params: ["name"], -}); - -var getProviders = rpc.declare({ - object: "luci." + pkg.Name, - method: "getProviders", - params: ["name"], -}); - -var getRuntime = rpc.declare({ - object: "luci." + pkg.Name, - method: "getRuntime", - params: ["name"], -}); +var pkg = hdp.pkg; return baseclass.extend({ title: _("HTTPS DNS Proxy Instances"), load: function () { return Promise.all([ - getInitStatus(pkg.Name), - getProviders(pkg.Name), - getRuntime(pkg.Name), + hdp.getInitStatus(pkg.Name), + hdp.getProviders(pkg.Name), + hdp.getRuntime(pkg.Name), ]); }, |