From 9c5408499a9a4f6d987f9068b7ea32324a06c6d0 Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Thu, 12 Mar 2020 16:46:53 +0100 Subject: [PATCH] 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 (cherry picked from commit 3d70d3e5d786383b8754200cf065713b191bdead) --- modules/luci-base/htdocs/luci-static/resources/network.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index 6dadcb730..5c6d732d6 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -108,7 +108,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); -- 2.25.1