summaryrefslogtreecommitdiff
path: root/ebus/webapp/static/console.html
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2011-12-05 23:15:38 +0100
committerYves Fischer <yvesf-git@xapek.org>2011-12-05 23:15:38 +0100
commitfab1f0878f2e1776f52667c481d3295ca829f593 (patch)
tree1f2cce58ee0b337da22c31d649051674f7f6fedb /ebus/webapp/static/console.html
parenteceb26632fa33ac94cf5f4571ba8b68245d9b0e6 (diff)
downloadebus-alt-fab1f0878f2e1776f52667c481d3295ca829f593.tar.gz
ebus-alt-fab1f0878f2e1776f52667c481d3295ca829f593.zip
console POC
Diffstat (limited to 'ebus/webapp/static/console.html')
-rw-r--r--ebus/webapp/static/console.html34
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>