summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view')
-rw-r--r--applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/https-dns-proxy/overview.js29
-rw-r--r--applications/luci-app-https-dns-proxy/htdocs/luci-static/resources/view/status/include/71_https-dns-proxy.js54
2 files changed, 6 insertions, 77 deletions
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),
]);
},