4 'require tools.widgets as widgets';
6 return baseclass
.extend({
7 title
: _('Wireless iwinfo Plugin Configuration'),
8 description
: _('The iwinfo plugin collects statistics about wireless signal strength, noise and quality.'),
10 addFormOptions: function(s
) {
13 o
= s
.option(form
.Flag
, 'enable', _('Enable this plugin'));
15 o
= s
.option(widgets
.DeviceSelect
, 'Interfaces', _('Monitor interfaces'), _('Leave unselected to automatically determine interfaces to monitor.'));
19 o
.depends('enable', '1');
20 o
.filter = function(section_id
, name
) {
21 var dev
= this.devices
.filter(function(dev
) { return dev
.getName() == name
})[0];
22 return (dev
&& dev
.getType() == 'wifi');
25 o
= s
.option(form
.Flag
, 'IgnoreSelected', _('Monitor all except specified'));
26 o
.depends('enable', '1');
29 configSummary: function(section
) {
30 var ifaces
= L
.toArray(section
.Interfaces
),
31 invert
= section
.IgnoreSelected
== '1';
33 if (ifaces
.length
== 0)
34 return _('Monitoring all interfaces');
36 return N_(ifaces
.length
, 'Monitoring all but one interface', 'Monitoring all but %d interfaces').format(ifaces
.length
);
38 return N_(ifaces
.length
, 'Monitoring one interface', 'Monitoring %d interfaces').format(ifaces
.length
);