summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics
diff options
context:
space:
mode:
authorNick Hainke <vincent@systemli.org>2020-12-11 22:29:44 +0100
committerHannu Nyman <hannu.nyman@iki.fi>2021-01-09 18:53:01 +0200
commitc7756834b727137dbdee9abfb8bb7642f311d38f (patch)
treeaffc99c91236fc86a9a6590ae3c8dd3f5bea293f /applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics
parenta7dde1a2a59f6bc62df9e8e826cd1ea6707a5197 (diff)
luci-app-statistics: add snmp6 collector
Add IPv6 statistics. Signed-off-by: Nick Hainke <vincent@systemli.org>
Diffstat (limited to 'applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics')
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/snmp6.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/snmp6.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/snmp6.js
new file mode 100644
index 0000000000..91f95376a1
--- /dev/null
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/snmp6.js
@@ -0,0 +1,37 @@
+'use strict';
+'require baseclass';
+'require form';
+'require tools.widgets as widgets';
+
+return baseclass.extend({
+ title: _('SNMP6 Plugin Configuration'),
+ description: _('The snmp6 plugin collects IPv6 statistics for selected interfaces.'),
+
+ addFormOptions: function(s) {
+ var o;
+
+ o = s.option(form.Flag, 'enable', _('Enable this plugin'));
+ o.default = '0';
+
+ o = s.option(widgets.DeviceSelect, 'Interfaces', _('Basic monitoring'));
+ o.multiple = true;
+ o.noaliases = true;
+ o.depends('enable', '1');
+
+ o = s.option(form.Flag, 'IgnoreSelected', _('Monitor all except specified'));
+ o.depends('enable', '1');
+ },
+
+ configSummary: function(section) {
+ var basic = L.toArray(section.Interfaces),
+ count = basic.length,
+ invert = section.IgnoreSelected == '1';
+
+ if (invert && count == 0)
+ return _('Monitoring all interfaces');
+ else if (invert)
+ return N_(count, 'Monitoring all but one interface', 'Monitoring all but %d interfaces').format(count);
+ else if (count)
+ return N_(count, 'Monitoring one interface', 'Monitoring %d interfaces').format(count);
+ }
+});