From 1ea334341b3bbda6e351d1d31dd8d014f91f6199 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Sun, 5 Feb 2017 03:04:41 -0200 Subject: [PATCH] ws update for history and transfer pages --- kfet/templates/kfet/history.html | 30 ++++++++++++++++++++++++++++++ kfet/templates/kfet/transfers.html | 22 ++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/kfet/templates/kfet/history.html b/kfet/templates/kfet/history.html index 97a0e413..eacd6e73 100644 --- a/kfet/templates/kfet/history.html +++ b/kfet/templates/kfet/history.html @@ -7,6 +7,7 @@ + @@ -223,6 +224,35 @@ $(document).ready(function() { }); } + // ----- + // Synchronization + // ----- + + + websocket_msg_default = {'opegroups':[],'opes':[]} + + var websocket_protocol = window.location.protocol == 'https:' ? 'wss' : 'ws'; + var location_host = window.location.host; + var location_url = window.location.pathname.startsWith('/gestion/') ? location_host + '/gestion' : location_host; + socket = new ReconnectingWebSocket(websocket_protocol+"://" + location_url + "/ws/k-fet/k-psul/"); + socket.onmessage = function(e) { + data = $.extend({}, websocket_msg_default, JSON.parse(e.data)); + + for (var i=0; i + @@ -162,6 +163,27 @@ $(document).ready(function() { }); } + // ----- + // Synchronization + // ----- + + + websocket_msg_default = {'opes':[]} + + var websocket_protocol = window.location.protocol == 'https:' ? 'wss' : 'ws'; + var location_host = window.location.host; + var location_url = window.location.pathname.startsWith('/gestion/') ? location_host + '/gestion' : location_host; + socket = new ReconnectingWebSocket(websocket_protocol+"://" + location_url + "/ws/k-fet/k-psul/"); + socket.onmessage = function(e) { + data = $.extend({}, websocket_msg_default, JSON.parse(e.data)); + + for (var i=0; i