summaryrefslogtreecommitdiffhomepage
path: root/protocols/luci-proto-unet/htdocs/luci-static/resources/protocol/unet.js
blob: ea9d9c50e2ca1b1ec20f0c7be1027e02beb674d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
'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;

	}
});