-
Notifications
You must be signed in to change notification settings - Fork 12
/
demo-combo2.html
49 lines (44 loc) · 1.17 KB
/
demo-combo2.html
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" CONTENT="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="panel-300px.css" />
<script src="openhab-grafana.js"></script>
<script src="openhab-grafana-user-defaults.js"></script>
</head>
<body>
</body>
<script>
var fromToItemFunction = function(value) {
switch (value) {
case "NOW":
return "now";
case "HOUR":
return "now-1h";
case "DAY":
return "now-1d";
default:
case "WEEK":
return "now-1w";
case "MONTH":
return "now-1M";
case "YEAR":
return "now-1y";
}
}
var panelItemFunction = function(value) {
switch (value) {
case "HUMIDITY":
return "1";
default:
case "TEMPERATURE":
return "2";
}
}
addGrafanaPanel("combo2", {
fromItemFunction: fromToItemFunction,
toItemFunction: fromToItemFunction,
panelItemFunction: panelItemFunction
});
</script>
</html>