Changeset - 7bafb8213b4b
[Not reviewed]
default
0 1 0
Drew Perttula - 6 years ago 2019-05-28 06:53:56
drewp@bigasterisk.com
collector web view: try to reestablish socket if connection to server is lost
Ignore-this: f83cd70844344c5e92e887c2068f87fb
1 file changed with 7 insertions and 6 deletions:
0 comments (0 inline, 0 general)
light9/collector/web/index.html
Show inline comments
 
@@ -8,9 +8,11 @@
 
    <link rel="import" href="/lib/iron-ajax/iron-ajax.html">
 
    <link rel="import" href="../rdfdb-synced-graph.html">
 
    <link rel="import" href="../resource-display.html">
 
    <script src="../lib/jquery/dist/jquery.slim.min.js"></script>
 
    <script src="/node_modules/n3/n3-browser.js"></script> 
 
    <script src="/lib/async/dist/async.js"></script>
 
    <script src="/lib/underscore/underscore-min.js"></script>
 
    <script src="../websocket.js"></script>
 

	
 
    <link rel="stylesheet"  href="/style.css">
 
    <style>
 
@@ -130,13 +132,12 @@
 
               ],
 
               ready: function() {
 
                   this.updates = new Updates();
 
                   var sock = new WebSocket(
 
                       window.location.href.replace(/^http/, 'ws') + 'updates');
 
                   sock.onmessage = function(ev) {
 
                       this.updates.onMessage(JSON.parse(ev.data));
 
                   }.bind(this);
 
             reconnectingWebSocket('updates',
 
                                   function(msg) {
 
                                     this.updates.onMessage(msg);
 
                                   }.bind(this));
 
               },
 
               onGraph: function(graph) {
 
           onGraph: function ong(graph) {
 
                   this.graph.runHandler(this.findDevices.bind(this), 'findDevices');
 
               },
 
               findDevices: function() {
0 comments (0 inline, 0 general)