0
0
mirror of https://github.com/openwrt/luci.git synced 2025-02-11 21:40:56 +00:00
Sergey Ponomarev 22d48305af treewide: replace "var m, s, o" with "let m, s, o"
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2024-12-03 16:25:21 +01:00

73 lines
2.1 KiB
JavaScript

'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) {
let 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();
}
});