summaryrefslogtreecommitdiffstats
path: root/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/nut.js
blob: 2b28571f7321b7062c9dc9e26095ed069767c917 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';
'require baseclass';
'require form';

return baseclass.extend({
	title: _('UPS Plugin Configuration'),
	description: _('The NUT plugin reads information about Uninterruptible Power Supplies.'),

	addFormOptions(s) {
		s.option(form.Flag, 'enable', _('Enable this plugin'));

		s.option(form.Value, 'UPS', _('UPS'), _('UPS name in NUT ups@host format'));
	},

	configSummary(section) {
		const ups = L.toArray(section.UPS);

		if (ups.length)
			return N_(ups.length, 'Monitoring one UPS', 'Monitoring %d UPSes').format(ups.length);
	}
});