From 55b1ae6c9b60164afbccfb6d69db9216898c833e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 20 Aug 2019 15:17:24 +0200 Subject: [PATCH] luci-base: network.js: add hacks to enable relay protocol support Signed-off-by: Jo-Philipp Wich --- .../luci-base/htdocs/luci-static/resources/network.js | 9 ++++++++- 1 file changed, 8 insertions(+), 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 fb23fba857..05510d828c 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -160,6 +160,10 @@ function getProtocolHandlers(cache) { if (!L.isObject(protos)) throw !1; + /* Hack: emulate relayd protocol */ + if (!protos.hasOwnProperty('relay')) + Object.assign(protos, { relay: { no_device: true } }); + Object.assign(_protospecs, protos); return Promise.all(Object.keys(protos).map(function(p) { @@ -1187,7 +1191,10 @@ Network = L.Class.extend({ return new protoClass(name); }, - instantiateDevice: function(name, network) { + instantiateDevice: function(name, network, extend) { + if (extend != null) + return new (Device.extend(extend))(name, network); + return new Device(name, network); }, -- 2.30.2