diff options
author | Adhitya Kamakshidasan | 2016-09-23 19:35:35 +0530 |
---|---|---|
committer | GitHub | 2016-09-23 19:35:35 +0530 |
commit | af66ee1449f7419bc27b8466609de054bf7e2e53 (patch) | |
tree | 66b9d5a7b3c07c16827b394aa5876e84f5bfe4de /testing/SendLog/templates/index.html | |
parent | 3b99df7b9289809bc1c72d8b59e6e5fb8684e243 (diff) | |
parent | b6117690d21003348cc88fd643b5fc9d43c0ee9f (diff) | |
download | xcos-on-web-af66ee1449f7419bc27b8466609de054bf7e2e53.tar.gz xcos-on-web-af66ee1449f7419bc27b8466609de054bf7e2e53.tar.bz2 xcos-on-web-af66ee1449f7419bc27b8466609de054bf7e2e53.zip |
Merge pull request #185 from Hrily/master
SendLog
Diffstat (limited to 'testing/SendLog/templates/index.html')
-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> |