luci-mod-system: add support for switching the ssh service on and off.
[project/luci.git] / modules / luci-mod-system / htdocs / luci-static / resources / view / system / dropbear.js
1 'use strict';
2 'require view';
3 'require form';
4 'require tools.widgets as widgets';
5
6 return view.extend({
7 render: function() {
8 var m, s, o;
9
10 m = new form.Map('dropbear', _('SSH Access'), _('Dropbear offers <abbr title="Secure Shell">SSH</abbr> network shell access and an integrated <abbr title="Secure Copy">SCP</abbr> server'));
11
12 s = m.section(form.TypedSection, 'dropbear', _('Dropbear Instance'));
13 s.anonymous = true;
14 s.addremove = true;
15 s.addbtntitle = _('Add instance');
16
17 o = s.option(form.Flag, 'enable', _('Enable Instance'), _('Enable <abbr title="Secure Shell">SSH</abbr> service instance'));
18 o.default = o.enabled;
19
20 o = s.option(widgets.NetworkSelect, 'Interface', _('Interface'), _('Listen only on the given interface or, if unspecified, on all'));
21 o.nocreate = true;
22
23 o = s.option(form.Value, 'Port', _('Port'));
24 o.datatype = 'port';
25 o.placeholder = 22;
26
27 o = s.option(form.Flag, 'PasswordAuth', _('Password authentication'), _('Allow <abbr title="Secure Shell">SSH</abbr> password authentication'));
28 o.enabled = 'on';
29 o.disabled = 'off';
30 o.default = o.enabled;
31 o.rmempty = false;
32
33 o = s.option(form.Flag, 'RootPasswordAuth', _('Allow root logins with password'), _('Allow the <em>root</em> user to log in with password'));
34 o.enabled = 'on';
35 o.disabled = 'off';
36 o.default = o.enabled;
37
38 o = s.option(form.Flag, 'GatewayPorts', _('Gateway Ports'), _('Allow remote hosts to connect to local SSH forwarded ports'));
39 o.enabled = 'on';
40 o.disabled = 'off';
41 o.default = o.disabled;
42
43 return m.render();
44 }
45 });