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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
'use strict';
'require form';
'require network';
'require tools.widgets as widgets';
'require view';
return view.extend({
load: function() {
return Promise.all([
network.getNetworks(),
]);
},
render: function (loaded_promises) {
var m, s, o;
const networks = loaded_promises[0];
m = new form.Map('pppoe', _('Roaring Penguin PPPoE Relay'),
_('PPPoE Relay Configuration'));
s = m.section(form.TypedSection, 'pppoe_relay', _('Relay Configuration'));
s.anonymous = true;
s.addremove = true;
o = s.option(form.Flag, 'enabled', _('Enabled'));
o = s.option(widgets.DeviceSelect, 'server_interface', _('Server Interface'), _('Interface on which to listen. Only PPPoE servers may be connected to this interface.'));
o.multiple = true;
o.optional = true;
o.nocreate = true;
o.rmempty = true;
o.depends({ enabled: '1' });
o = s.option(widgets.DeviceSelect, 'client_interface', _('Client Interface'), _('Interface from which to relay. Only PPPoE clients may be connected to this interface.'));
o.multiple = true;
o.optional = true;
o.nocreate = true;
o.rmempty = true;
o.depends({ enabled: '1' });
o = s.option(widgets.DeviceSelect, 'both_interface', _('Both Interface'), _('Interface upon which to listen and to relay. Both PPPoE clients and servers may be connected to this interface.'));
o.multiple = true;
o.optional = true;
o.nocreate = true;
o.rmempty = true;
o.depends({ enabled: '1' });
o = s.option(form.Flag, 'use_non_uci_config', _('Use Non-UCI Config'), '<code>/etc/default/pppoe-relay</code>');
o.optional = true;
o.rmempty = true;
o.depends({ enabled: '1' });
o = s.option(form.Value, 'maxsessions', _('Maximum Sessions'));
o.datatype = 'range(1,65534)';
o.placeholder = 5000;
o.value('', _('Default: 5000'));
o.optional = true;
o.rmempty = true;
o.depends({ enabled: '1' });
o = s.option(form.Value, 'timeout', _('Timeout'));
o.optional = true;
o.datatype = 'uinteger';
o.placeholder = 600;
o.value('0', _('No timeout'));
o.value('', _('Default: 600'));
o.rmempty = true;
o.depends({ enabled: '1' });
return m.render();
}
});
|