diff options
Diffstat (limited to 'ebus/webapp/static')
-rw-r--r-- | ebus/webapp/static/console.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ebus/webapp/static/console.html b/ebus/webapp/static/console.html new file mode 100644 index 0000000..97d6b63 --- /dev/null +++ b/ebus/webapp/static/console.html @@ -0,0 +1,34 @@ +<html> +<head> + <script src="/static/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> |