4 'require tools.widgets as widgets';
6 return baseclass
.extend({
7 title
: _('Netlink Plugin Configuration'),
8 description
: _('The netlink plugin collects extended information like qdisc-, class- and filter-statistics for selected interfaces.'),
10 addFormOptions: function(s
) {
13 o
= s
.option(form
.Flag
, 'enable', _('Enable this plugin'));
16 o
= s
.option(widgets
.DeviceSelect
, 'Interfaces', _('Basic monitoring'));
19 o
.depends('enable', '1');
21 o
= s
.option(widgets
.DeviceSelect
, 'VerboseInterfaces', _('Verbose monitoring'));
24 o
.depends('enable', '1');
26 o
= s
.option(widgets
.DeviceSelect
, 'QDiscs', _('Qdisc monitoring'));
29 o
.depends('enable', '1');
31 o
= s
.option(widgets
.DeviceSelect
, 'Classes', _('Shaping class monitoring'));
34 o
.depends('enable', '1');
36 o
= s
.option(widgets
.DeviceSelect
, 'Filters', _('Filter class monitoring'));
39 o
.depends('enable', '1');
41 o
= s
.option(form
.Flag
, 'IgnoreSelected', _('Monitor all except specified'));
42 o
.depends('enable', '1');
45 configSummary: function(section
) {
46 var basic
= L
.toArray(section
.Interfaces
),
47 verbose
= L
.toArray(section
.VerboseInterfaces
),
48 count
= basic
.length
+ verbose
.length
,
49 invert
= section
.IgnoreSelected
== '1';
51 if (invert
&& count
== 0)
52 return _('Monitoring all interfaces');
54 return N_(count
, 'Monitoring all but one interface', 'Monitoring all but %d interfaces').format(count
);
56 return N_(count
, 'Monitoring one interface', 'Monitoring %d interfaces').format(count
);