luci/protocols/luci-proto-unet/htdocs/luci-static/resources/protocol/unet.js
Hannu Nyman 38ce475bc9 luci-proto-unet: initial support
Initial support for the new unetd VPN daemon.

Currently this just enables seeing the VPN interface
in the LuCI network overview, plus the keys used.
No relevant config change possibilities, yet.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-09-06 23:48:56 +03:00

48 lines
929 B
JavaScript

'use strict';
'require form';
'require network';
'require tools.widgets as widgets';
return network.registerProtocol('unet', {
getI18n: function() {
return _('Unet');
},
getIfname: function() {
return this._ubus('l3_device') || this.sid;
},
getOpkgPackage: function() {
return 'unetd';
},
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.DummyValue, 'device', _('Name of the tunnel device'));
o.optional = false;
o = s.taboption('general', form.DummyValue, 'key', _('Local wireguard key'));
o.optional = false;
o = s.taboption('general', form.DummyValue, 'auth_key', _('Key used to sign network config'));
o.optional = false;
}
});