638242f102a9db614fa6ccfba833a6c9f1e70064
[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: _('Wireless'),
8
9         rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
10                 /*
11                  * signal/noise diagram
12                  */
13                 var snr = {
14                         title: "%H: Signal and noise on %pi",
15                         detail: true,
16                         vlabel: "dBm",
17                         number_format: "%5.1lf dBm",
18                         data: {
19                                 types: [ "signal_noise", "signal_power" ],
20                                 options: {
21                                         signal_power: {
22                                                 title  : "Signal",
23                                                 overlay: true,
24                                                 color  : "0000ff"
25                                         },
26                                         signal_noise: {
27                                                 title  : "Noise",
28                                                 overlay: true,
29                                                 color  : "ff0000"
30                                         }
31                                 }
32                         }
33                 };
34
35                 /*
36                  * signal quality diagram
37                  */
38                 var quality = {
39                         title: "%H: Signal quality on %pi",
40                         vlabel: "Quality",
41                         number_format: "%3.0lf",
42                         data: {
43                                 types: [ "signal_quality" ],
44                                 options: {
45                                         signal_quality: {
46                                                 title : "Quality",
47                                                 noarea: true,
48                                                 color : "0000ff"
49                                         }
50                                 }
51                         }
52                 };
53
54                 /*
55                  * phy rate diagram
56                  */
57                 var bitrate = {
58                         title: "%H: Average phy rate on %pi",
59                         detail: true,
60                         vlabel: "MBit/s",
61                         number_format: "%5.1lf%sBit/s",
62                         data: {
63                                 types: [ "bitrate" ],
64                                 options: {
65                                         bitrate: {
66                                                 title: "Rate",
67                                                 color: "00ff00"
68                                         }
69                                 }
70                         }
71                 };
72
73                 /*
74                  * associated stations
75                  */
76                 var stations = {
77                         title: "%H: Associated stations on %pi",
78                         detail: true,
79                         vlabel: "Stations",
80                         y_min: "0",
81                         alt_autoscale_max: true,
82                         number_format: "%3.0lf",
83                         data: {
84                                 types: [ "stations" ],
85                                 options: {
86                                         stations: {
87                                                 title: "Stations",
88                                                 color: "0000ff"
89                                         }
90                                 }
91                         }
92                 };
93
94                 return [ quality, snr, bitrate, stations ];
95         }
96 });
git clone https://git.99rst.org/PROJECT