Merge pull request #4542 from mayli/oc-protocol
[project/luci.git] / applications / luci-app-statistics / htdocs / luci-static / resources / view / statistics / plugins / cpu.js
1 'use strict';
2 'require baseclass';
3 'require form';
4
5 return baseclass.extend({
6 title: _('CPU Plugin Configuration'),
7 description: _('The cpu plugin collects basic statistics about the processor usage.'),
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.Flag, 'ReportByCpu', _('Report by CPU'),
15 _('By setting this, CPU is not aggregate of all processors on the system'));
16 o.default = '1';
17 o.rmempty = false;
18 o.depends('enable', '1');
19
20 o = s.option(form.Flag, 'ReportByState', _('Report by state'),
21 _('When set to true, reports per-state metric (system, user, idle)'));
22 o.default = '1';
23 o.rmempty = false;
24 o.depends('enable', '1');
25
26 o = s.option(form.Flag, 'ShowIdle', _('Show Idle state'),
27 _('Report also the value for the idle metric'));
28 o.default = '0';
29 o.rmempty = false;
30 o.depends({'enable': '1', 'ReportByState': '1'});
31
32 o = s.option(form.Flag, 'ValuesPercentage', _('Report in percent'),
33 _('When set to true, we request percentage values'));
34 o.default = '1';
35 o.rmempty = false;
36 o.depends({ 'enable': '1', 'ReportByCpu': '1', 'ReportByState': '1' });
37 },
38
39 configSummary: function(section) {
40 return _('CPU monitoring is enabled');
41 }
42 });