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