summaryrefslogtreecommitdiffstats
path: root/applications/luci-app-nut/htdocs/luci-static/resources/view/nut/nut_cgi.js
blob: 55ec99d0c8e953c030a8c496d56518ddbb82a580 (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
'use strict';
'require form';
'require view';

return view.extend({
	load: function() {

	},

	render: function() {
		let m, s, o;

		m = new form.Map('nut_cgi', _('NUT CGI'),
			_('Network UPS Tools CGI Configuration') + '<br />' +
			'%s'.format('<a href="/nut">%s</a>'.format(_('Go to NUT CGI'))));

		s = m.section(form.TypedSection, 'host', _('Host'));
		s.addremove = true;
		s.anonymous = true;

		o = s.option(form.Value, 'upsname', _('UPS name'), _('As configured by NUT'));
		o.optional = false;

		o = s.option(form.Value, 'hostname', _('Hostname or IP address'));
		o.optional = false;
		o.datatype = 'or(host,ipaddr)';

		o = s.option(form.Value, 'port', _('Port'));
		o.datatype = 'port';
		o.optional = true;
		o.placeholder = 3493;

		o = s.option(form.Value, 'displayname', _('Display name'));
		o.optional = false;

		return m.render();
	}
});