summaryrefslogtreecommitdiffstats
path: root/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ipstatistics.js
blob: 144060971e9b9b05b792815fd3c47ec601e2cd30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* Licensed to the public under the Apache License 2.0. */

'use strict';
'require baseclass';

return baseclass.extend({
	title: _('IP-Statistics'),

	rrdargs(graph, host, plugin, plugin_instance, dtype) {

		const 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 ]
	}
});