f78e2a491c9c93cd2c6a3ff8099b4accf0e73dfc
[openwrt-luci.git] /
1 /* Licensed to the public under the Apache License 2.0. */
2
3 'use strict';
4 'require baseclass';
5
6 return baseclass.extend({
7         title: _('OpenVPN'),
8
9         rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
10                 var inst = plugin_instance.replace(/^openvpn\.(.+)\.status$/, '$1');
11
12                 return [
13                         {
14                                 title: "%%H: OpenVPN \"%s\" - Traffic".format(inst),
15                                 vlabel: "Bytes/s",
16                                 data: {
17                                         instances: {
18                                                 if_octets: [ "traffic", "overhead" ]
19                                         },
20                                         sources: {
21                                                 if_octets: [ "tx", "rx" ]
22                                         },
23                                         options: {
24                                                 if_octets_traffic_tx : { weight: 0, title: "Bytes    (TX)", total: true, color: "00ff00" },
25                                                 if_octets_overhead_tx: { weight: 1, title: "Overhead (TX)", total: true, color: "ff9900" },
26                                                 if_octets_overhead_rx: { weight: 2, title: "Overhead (RX)", total: true, flip: true, color: "ff00ff" },
27                                                 if_octets_traffic_rx : { weight: 3, title: "Bytes    (RX)", total: true, flip: true, color: "0000ff" }
28                                         }
29                                 }
30                         },
31
32                         {
33                                 title: "%%H: OpenVPN \"%s\" - Compression".format(inst),
34                                 vlabel: "Bytes/s",
35                                 data: {
36                                         instances: {
37                                                 compression: [ "data_out", "data_in" ]
38                                         },
39                                         sources: {
40                                                 compression: [ "uncompressed", "compressed" ]
41                                         },
42                                         options: {
43                                                 compression_data_out_uncompressed: { weight: 0, title: "Uncompressed (TX)", total: true, color: "00ff00" },
44                                                 compression_data_out_compressed  : { weight: 1, title: "Compressed   (TX)", total: true, color: "008800" },
45                                                 compression_data_in_compressed   : { weight: 2, title: "Compressed   (RX)", total: true, flip: true, color: "000088" },
46                                                 compression_data_in_uncompressed : { weight: 3, title: "Uncompressed (RX)", total: true, flip: true, color: "0000ff" }
47                                         }
48                                 }
49                         }
50                 ];
51         }
52 });
git clone https://git.99rst.org/PROJECT