URL Websocket K-Psul

This commit is contained in:
Aurélien Delobelle 2016-09-06 17:50:05 +02:00
parent f6fa13fa95
commit 6ba8c9e741

View file

@ -1085,7 +1085,9 @@ $(document).ready(function() {
websocket_msg_default = {'opegroups':[],'opes':[],'checkouts':[],'articles':[]}
var websocket_protocol = window.location.protocol == 'https:' ? 'wss' : 'ws';
socket = new ReconnectingWebSocket(websocket_protocol+"://" + window.location.host + "/ws/k-fet/k-psul/");
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));