diff options
author | Hrishi Hiraskar | 2016-08-31 22:41:25 +0530 |
---|---|---|
committer | Hrishi Hiraskar | 2016-08-31 22:41:25 +0530 |
commit | ffda6d1b4730686f4a2be7baf316c05235a99b3e (patch) | |
tree | fec3044033bfe06489938bbf2ce26e49e0432260 /testing/SendLog/templates | |
parent | 3abaab9cf325ae5ed5f7da7bf64b287b8e172202 (diff) | |
download | xcos-on-web-ffda6d1b4730686f4a2be7baf316c05235a99b3e.tar.gz xcos-on-web-ffda6d1b4730686f4a2be7baf316c05235a99b3e.tar.bz2 xcos-on-web-ffda6d1b4730686f4a2be7baf316c05235a99b3e.zip |
Added SendLog python server
Diffstat (limited to 'testing/SendLog/templates')
-rwxr-xr-x | testing/SendLog/templates/index.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/testing/SendLog/templates/index.html b/testing/SendLog/templates/index.html new file mode 100755 index 0000000..5eb7bab --- /dev/null +++ b/testing/SendLog/templates/index.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- +Hrishi Hiraskar +31 August 2016 +--> +<!DOCTYPE HTML> +<html> + <head><title>Send Time</title></head> +<body onload="get_data()"> + + <h3>Data from scilab-log-0.txt</h2> + <span id="foo"></span> + + <script type="text/javascript"> + var eventSource; + + function get_data(){ + eventSource = new EventSource('/SendLog'); + // Start listening to server + eventSource.addEventListener("log", function(event){ + document.getElementById('foo').innerHTML += event.data + "<br/>"; + // Scroll to bottom of page + window.scrollTo(0, document.body.scrollHeight); + }, false); + // Stop listening + eventSource.addEventListener("DONE", function(event){ + eventSource.close(); // Close connection + }, false); + } + + </script> +</body> +</html> |