blob: 652f6210ef844e37170f4e256ffc33f0a89b6798 (
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
|
<html>
<head>
<script src="lib/jquery-1.6.2/jquery-1.6.2.min.js"></script>
</head>
<body>
<div id="log">
</div>
<script>
function log(data) {
for (var i in data) {
var sensor_name = data[i][0];
var timestamp = data[i][1];
var value = data[i][2];
var caption = "" + timestamp + ": " + sensor_name + " Value: " + value;
jQuery("div#log").append(
jQuery("<div>").text(caption));
}
}
function reload(time_stop) {
jQuery.getJSON("/stream/" + time_stop, function(resp) {
log(resp.data);
reload(resp.time_stop);
});
}
jQuery.getJSON("/stream", function(resp) {
log(resp.data);
reload(resp.time_stop);
});
</script>
</body>
</html>
|