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