32f0cecdabebea20879ad524beee0c1847095c2b
[project/luci.git] / applications / luci-app-statistics / htdocs / luci-static / resources / view / statistics / plugins / apcups.js
1 'use strict';
2 'require baseclass';
3 'require form';
4
5 return baseclass.extend({
6 title: _('APCUPS Plugin Configuration'),
7 description: _('The APCUPS plugin collects statistics about the APC UPS.'),
8
9 addFormOptions: function(s) {
10 var o;
11
12 o = s.option(form.Flag, 'enable', _('Enable this plugin'));
13
14 o = s.option(form.Value, 'Host', _('Monitor host'));
15 o.default = 'localhost';
16 o.datatype = 'host';
17 o.depends('enable', '1');
18
19 o = s.option(form.Value, 'Port', _('Port for apcupsd communication'));
20 o.default = '3551';
21 o.datatype = 'port';
22 o.depends('enable', '1');
23 },
24
25 configSummary: function(section) {
26 return _('Monitoring APC UPS at host %s, port %d').format(section.Host || 'localhost', section.Port || 3551);
27 }
28 });