summaryrefslogtreecommitdiffstats
path: root/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/apcups.js
blob: cba4b9ee6892ac3c74cd12972ca252be3771a37c (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
'use strict';
'require baseclass';
'require form';

return baseclass.extend({
	title: _('APCUPS Plugin Configuration'),
	description: _('The APCUPS plugin collects statistics about the APC UPS.'),

	addFormOptions(s) {
		let o;

		o = s.option(form.Flag, 'enable', _('Enable this plugin'));

		o = s.option(form.Value, 'Host', _('Monitor host'));
		o.default = 'localhost';
		o.datatype = 'host';
		o.depends('enable', '1');

		o = s.option(form.Value, 'Port', _('Port for apcupsd communication'));
		o.default = '3551';
		o.datatype = 'port';
		o.depends('enable', '1');
	},

	configSummary(section) {
		return _('Monitoring APC UPS at host %s, port %d').format(section.Host || 'localhost', section.Port || 3551);
	}
});