diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-08-20 15:17:24 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-09-10 15:28:16 +0200 |
commit | 55b1ae6c9b60164afbccfb6d69db9216898c833e (patch) | |
tree | 7cc2cf39286cab48928736e2738172b3dc6a97b0 /modules/luci-base/htdocs/luci-static | |
parent | d905dacf97272903f8d9d962bcee25bc3409ba79 (diff) |
luci-base: network.js: add hacks to enable relay protocol support
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/network.js | 9 |
1 files changed, 8 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 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); }, |