4 'require tools.widgets as widgets';
6 return baseclass
.extend({
7 title
: _('Interface Plugin Configuration'),
8 description
: _('The interface plugin collects traffic statistics on selected interfaces.'),
10 addFormOptions: function(s
) {
13 o
= s
.option(form
.Flag
, 'enable', _('Enable this plugin'));
15 o
= s
.option(widgets
.DeviceSelect
, 'Interfaces', _('Monitor interfaces'));
19 o
.depends('enable', '1');
21 o
= s
.option(form
.Flag
, 'IgnoreSelected', _('Monitor all except specified'));
22 o
.depends('enable', '1');
25 configSummary: function(section
) {
26 var ifaces
= L
.toArray(section
.Interfaces
),
27 invert
= section
.IgnoreSelected
== '1';
29 if (ifaces
.length
== 0)
30 return _('Monitoring all interfaces');
32 return N_(ifaces
.length
, 'Monitoring all but one interface', 'Monitoring all but %d interfaces').format(ifaces
.length
);
34 return N_(ifaces
.length
, 'Monitoring one interface', 'Monitoring %d interfaces').format(ifaces
.length
);