27b08cf3935ed642bc6ac5283c1b474b58a0f9e7
[project/luci.git] / applications / luci-app-statistics / htdocs / luci-static / resources / view / statistics / plugins / dns.js
1 'use strict';
2 'require form';
3 'require tools.widgets as widgets';
4
5 return L.Class.extend({
6 title: _('DNS Plugin Configuration'),
7 description: _('The dns plugin collects detailed statistics about dns related traffic on selected interfaces.'),
8
9 addFormOptions: function(s) {
10 var o;
11
12 o = s.option(form.Flag, 'enable', _('Enable this plugin'));
13
14 o = s.option(widgets.DeviceSelect, 'Interfaces', _('Monitor interfaces'),
15 _('When none selected, all interfaces will be monitored.'));
16 o.multiple = true;
17 o.noaliases = true;
18 o.depends('enable', '1');
19
20 o = s.option(form.DynamicList, 'IgnoreSources', _('Ignore source addresses'));
21 o.datatype = 'ipaddr("nomask")';
22 o.default = '127.0.0.1';
23 o.depends('enable', '1');
24 },
25
26 configSummary: function(section) {
27 var ifaces = L.toArray(section.Interfaces);
28
29 if (ifaces.length == 0)
30 return _('Monitoring DNS queries on all interfaces');
31 else
32 return N_(ifaces.length, 'Monitoring DNS queries on one interface', 'Monitoring DNS queries on %d interfaces').format(ifaces.length);
33 }
34 });