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

return baseclass.extend({
	title: _('Processes Plugin Configuration'),
	description: _('The processes plugin collects information like cpu time, page faults and memory usage of selected processes.'),

	addFormOptions(s) {
		let o;

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

		o = s.option(form.DynamicList, 'Processes', _('Monitor processes'));
		o.default = 'uhttpd dropbear dnsmasq';
		o.depends('enable', '1');
	},

	configSummary(section) {
		const processes = L.toArray(section.Processes);

		if (processes.length)
			return N_(processes.length, 'Monitoring one process', 'Monitoring %d processes').format(processes.length);
		else
			return _('Basic process monitoring enabled');
	}
});