diff options
author | Stan Grishin <stangri@melmac.ca> | 2022-10-14 12:02:56 +0000 |
---|---|---|
committer | Stan Grishin <stangri@melmac.ca> | 2022-10-14 12:02:56 +0000 |
commit | d55913cfa44c81280111d093807c6830b3584d8d (patch) | |
tree | 1cb9b03ced9f3b420d67e0334fed60fa50fc24a6 /protocols/luci-proto-nebula/htdocs/luci-static | |
parent | 7fb235cb88048e7a5082013e86aba34e6f5bc9d0 (diff) |
luci-proto-nebula: add nebula protocol support
Signed-off-by: Stan Grishin <stangri@melmac.ca>
Diffstat (limited to 'protocols/luci-proto-nebula/htdocs/luci-static')
-rw-r--r-- | protocols/luci-proto-nebula/htdocs/luci-static/resources/protocol/nebula.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/protocols/luci-proto-nebula/htdocs/luci-static/resources/protocol/nebula.js b/protocols/luci-proto-nebula/htdocs/luci-static/resources/protocol/nebula.js new file mode 100644 index 0000000000..409416dd49 --- /dev/null +++ b/protocols/luci-proto-nebula/htdocs/luci-static/resources/protocol/nebula.js @@ -0,0 +1,50 @@ +'use strict'; +'require ui'; +'require uci'; +'require rpc'; +'require form'; +'require network'; + +return network.registerProtocol('nebula', { + getI18n: function () { + return _('Nebula Network'); + }, + + getIfname: function () { + return this._ubus('l3_device') || this.sid; + }, + + getOpkgPackage: function () { + return 'nebula'; + }, + + isFloating: function () { + return true; + }, + + isVirtual: function () { + return true; + }, + + getDevices: function () { + return null; + }, + + containsDevice: function (ifname) { + return (network.getIfnameOf(ifname) == this.getIfname()); + }, + + renderFormOptions: function (s) { + var o; + + o = s.taboption('general', form.Value, 'config_file', _('Config File'), _('Required. Path to the .yml config file for this interface.')); + o.rmempty = false; + + }, + + deleteConfiguration: function () { + uci.sections('network', 'nebula_%s'.format(this.sid), function (s) { + uci.remove('network', s['.name']); + }); + } +}); |