summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2020-03-12 16:46:53 +0100
committerAnsuel Smith <ansuelsmth@gmail.com>2020-03-12 16:46:53 +0100
commit3d70d3e5d786383b8754200cf065713b191bdead (patch)
tree1295e8459cf9b8c8fc9aae8c2b0c9ba0c55bda7b
parentd8e1aef1505496a04631550363ce83bb0147c0a9 (diff)
luci-base: fix error 404 on missing relay protocol
Currently relay.js is included in any case even if the router doesn't have the needed package to use it. Fix this by checking if the system has this feature. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/network.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js
index c79022968..43ae076a0 100644
--- a/modules/luci-base/htdocs/luci-static/resources/network.js
+++ b/modules/luci-base/htdocs/luci-static/resources/network.js
@@ -106,7 +106,7 @@ function getProtocolHandlers(cache) {
Object.assign(protos, { none: { no_device: false } });
/* Hack: emulate relayd protocol */
- if (!protos.hasOwnProperty('relay'))
+ if (!protos.hasOwnProperty('relay') && L.hasSystemFeature('relayd'))
Object.assign(protos, { relay: { no_device: true } });
Object.assign(_protospecs, protos);