treewide: remove rendundant proto handler options
[project/luci.git] / protocols / luci-proto-sstp / htdocs / luci-static / resources / protocol / sstp.js
1 'use strict';
2 'require form';
3 'require network';
4
5 network.registerPatternVirtual(/^sstp-.+$/);
6
7 return network.registerProtocol('sstp', {
8 getI18n: function() {
9 return _('SSTP');
10 },
11
12 getIfname: function() {
13 return this._ubus('l3_device') || 'sstp-%s'.format(this.sid);
14 },
15
16 getOpkgPackage: function() {
17 return 'sstp-client';
18 },
19
20 isFloating: function() {
21 return true;
22 },
23
24 isVirtual: function() {
25 return true;
26 },
27
28 getDevices: function() {
29 return null;
30 },
31
32 containsDevice: function(ifname) {
33 return (network.getIfnameOf(ifname) == this.getIfname());
34 },
35
36 renderFormOptions: function(s) {
37 var dev = this.getL3Device() || this.getDevice(), o;
38
39 // -- general ---------------------------------------------------------------------
40
41 o = s.taboption('general', form.Value, 'server', _('SSTP Server'));
42 o.datatype = 'host';
43
44 o = s.taboption('general', form.Value, 'username', _('PAP/CHAP username'));
45
46 o = s.taboption('general', form.Value, 'password', _('PAP/CHAP password'));
47 o.password = true;
48
49 // -- advanced --------------------------------------------------------------------
50
51 o = s.taboption('advanced', form.Flag, 'ipv6', _('IPv6 support'), _('If checked, adds "+ipv6" to the pppd options'));
52
53 o = s.taboption('advanced', form.ListValue, 'log_level', _('sstpc Log-level'));
54 o.value('0', _('0', 'sstp log level value'));
55 o.value('1', _('1', 'sstp log level value'));
56 o.value('2', _('2', 'sstp log level value'));
57 o.value('3', _('3', 'sstp log level value'));
58 o.value('4', _('4', 'sstp log level value'));
59 o.default = '0';
60
61 o = s.taboption('advanced', form.Value, 'mtu', _('Override MTU'));
62 o.placeholder = dev ? (dev.getMTU() || '1500') : '1500';
63 o.datatype = 'max(9200)';
64
65 o = s.taboption('advanced', form.Value, 'sstp_options', _('Extra sstpc options'), _('e.g: --proxy 10.10.10.10'));
66
67 o = s.taboption('advanced', form.Value, 'pppd_options', _('Extra pppd options'), _('e.g: dump'));
68 }
69 });