diff options
author | Stan Grishin <stangri@melmac.ca> | 2022-10-17 10:21:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 10:21:24 -0700 |
commit | aff9f12440670edadd2a7670926ff237df9df52c (patch) | |
tree | e2f41b775f5c8fb75ac3eb3ec150be499c702295 | |
parent | 3e9d9a9dbb045c24eb93643838f8e8e3b9074e4b (diff) | |
parent | d55913cfa44c81280111d093807c6830b3584d8d (diff) |
Merge pull request #6023 from stangri/master-luci-proto-nebula
luci-proto-nebula: add nebula protocol support
-rw-r--r-- | protocols/luci-proto-nebula/Makefile | 17 | ||||
-rw-r--r-- | protocols/luci-proto-nebula/htdocs/luci-static/resources/protocol/nebula.js | 50 |
2 files changed, 67 insertions, 0 deletions
diff --git a/protocols/luci-proto-nebula/Makefile b/protocols/luci-proto-nebula/Makefile new file mode 100644 index 0000000000..7b29b54b6d --- /dev/null +++ b/protocols/luci-proto-nebula/Makefile @@ -0,0 +1,17 @@ +# Copyright 2021 Stan Grishin (stangri@melmac.ca) +# This is free software, licensed under the GNU General Public License v3. + +include $(TOPDIR)/rules.mk + +PKG_LICENSE:=GPL-3.0-or-later +PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca> +PKG_VERSION:=1.6.1-1 + +LUCI_TITLE:=Support for Nebula +LUCI_DESCRIPTION:=Provides Web UI for Nebula protocol/interface. +LUCI_DEPENDS:=+nebula +nebula-proto +LUCI_PKGARCH:=all + +include ../../luci.mk + +# call BuildPackage - OpenWrt buildroot signature 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']); + }); + } +}); |