3da1bcfd820052494009a8570c181285fe1b4d60
[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: _('Sensors'),
8
9         rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
10                 var rv = [];
11                 var types = graph.dataTypes(host, plugin, plugin_instance);
12
13                 if (types.indexOf('temperature') > -1) {
14                         rv.push({
15                                 per_instance: true,
16                                 title: "%H: %pi - %di",
17                                 vlabel: "\xb0C",
18                                 number_format: "%4.1lf\xb0C",
19                                 data: {
20                                         types: [ "temperature" ],
21                                         options: {
22                                                 temperature__value: {
23                                                         color: "ff0000",
24                                                         title: "Temperature"
25                                                 }
26                                         }
27                                 }
28                         });
29                 }
30                 if (types.indexOf('humidity') > -1) {
31                         rv.push({
32                                 per_instance: true,
33                                 title: "%H: %pi - %di",
34                                 vlabel: "%RH",
35                                 number_format: "%4.1lf %%RH",
36                                 data: {
37                                         types: [ "humidity" ],
38                                         options: {
39                                                 humidity__value: {
40                                                         color: "0000ff",
41                                                         title: "Humidity"
42                                                 }
43                                         }
44                                 }
45                         });
46                 }
47
48                 return rv;
49         }
50 });
git clone https://git.99rst.org/PROJECT