summaryrefslogtreecommitdiffstats
path: root/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/cpu.js
blob: 13bd7d991b3ce0b65b074f53a62d0f31dc71daf5 (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
39
40
41
42
'use strict';
'require baseclass';
'require form';

return baseclass.extend({
	title: _('CPU Plugin Configuration'),
	description: _('The cpu plugin collects basic statistics about the processor usage.'),

	addFormOptions(s) {
		let o;

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

		o = s.option(form.Flag, 'ReportByCpu', _('Report by CPU'),
			_('By setting this, CPU is not aggregate of all processors on the system'));
		o.default = '1';
		o.rmempty = false;
		o.depends('enable', '1');

		o = s.option(form.Flag, 'ReportByState', _('Report by state'),
			_('When set to true, reports per-state metric (system, user, idle)'));
		o.default = '1';
		o.rmempty = false;
		o.depends('enable', '1');

		o = s.option(form.Flag, 'ShowIdle', _('Show Idle state'),
			_('Report also the value for the idle metric'));
		o.default = '0';
		o.rmempty = false;
		o.depends({'enable': '1', 'ReportByState': '1'});

		o = s.option(form.Flag, 'ValuesPercentage', _('Report in percent'),
			_('When set to true, we request percentage values'));
		o.default = '1';
		o.rmempty = false;
		o.depends({ 'enable': '1', 'ReportByCpu': '1', 'ReportByState': '1' });
	},

	configSummary(section) {
		return _('CPU monitoring is enabled');
	}
});