From: Ansuel Smith Date: Thu, 12 Mar 2020 15:46:53 +0000 (+0100) Subject: luci-base: fix error 404 on missing relay protocol X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=refs%2Fpull%2F3749%2Fhead;p=project%2Fluci.git 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 --- diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index c79022968c..43ae076a0a 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);