summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/htdocs/luci-static
diff options
context:
space:
mode:
authorNick Hainke <vincent@systemli.org>2021-01-29 11:03:19 +0100
committerHannu Nyman <hannu.nyman@iki.fi>2021-02-04 16:35:13 +0200
commit6ae138c2fe3dc13005b3ccdb9e19037f7350aab6 (patch)
tree4a07cd6a802d9c6ee34421a2eb9d4d0132c5e18c /applications/luci-app-statistics/htdocs/luci-static
parenta567b3d47ba575053034406a4834c697cc9f7540 (diff)
luci-app-statistics: add ipstatistics plugin
Signed-off-by: Nick Hainke <vincent@systemli.org>
Diffstat (limited to 'applications/luci-app-statistics/htdocs/luci-static')
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ipstatistics.js54
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ipstatistics.js16
2 files changed, 70 insertions, 0 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ipstatistics.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ipstatistics.js
new file mode 100644
index 0000000000..73bd16af11
--- /dev/null
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ipstatistics.js
@@ -0,0 +1,54 @@
+/* Licensed to the public under the Apache License 2.0. */
+
+'use strict';
+'require baseclass';
+
+return baseclass.extend({
+ title: _('IP-Statistics'),
+
+ rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
+
+ var traffic = {
+ title: "%H: IPv4 and IPv6 Comparison",
+ vlabel: "Bytes/s",
+ number_format: "%5.1lf%sB/s",
+ totals_format: "%5.1lf%sB",
+
+ data: {
+ sources: {
+ ip_stats_octets: [ "ip4rx", "ip4tx", "ip6rx", "ip6tx" ]
+ },
+
+ options: {
+ ip_stats_octets__ip4rx: {
+ title: "IPv4 Bytes (RX)",
+ total: true,
+ color: "00ff00"
+ },
+
+ ip_stats_octets__ip4tx: {
+ title: "IPv4 Bytes (TX)",
+ flip : true,
+ total: true,
+ color: "0000ff"
+ },
+
+ ip_stats_octets__ip6rx: {
+ title: "IPv6 Bytes (RX)",
+ total: true,
+ color: "ffff00"
+ },
+
+ ip_stats_octets__ip6tx: {
+ title: "IPv6 Bytes (TX)",
+ flip : true,
+ total: true,
+ color: "ff00ff"
+ }
+ }
+ }
+ };
+
+ return [ traffic ]
+ }
+});
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ipstatistics.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ipstatistics.js
new file mode 100644
index 0000000000..37f98100f1
--- /dev/null
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/ipstatistics.js
@@ -0,0 +1,16 @@
+'use strict';
+'require baseclass';
+'require form';
+'require tools.widgets as widgets';
+
+return baseclass.extend({
+ title: _('IP-Statistics Plugin Configuration'),
+ description: _('The ipstatistics plugin collects IPv4 and IPv6 statistics to compare them.'),
+
+ addFormOptions: function(s) {
+ var o;
+
+ o = s.option(form.Flag, 'enable', _('Enable this plugin'));
+ o.default = '0';
+ }
+});