Skip to content

Commit

Permalink
🐛 [Frontend] Guest viewers (ITISFoundation#6565)
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored Oct 21, 2024
1 parent f9fffc8 commit 3c24a0e
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ qx.Class.define("osparc.viewer.NodeViewer", {
__attachSocketEventHandlers: function() {
this.__listenToNodeUpdated();
this.__listenToNodeProgress();
this.__listenToServiceStatus();
},

__listenToNodeUpdated: function() {
Expand All @@ -127,6 +128,26 @@ qx.Class.define("osparc.viewer.NodeViewer", {
this.getStudy().nodeNodeProgressSequence(data);
}, this);
}
},

__listenToServiceStatus: function() {
const socket = osparc.wrapper.WebSocket.getInstance();

// callback for events
if (!socket.slotExists("serviceStatus")) {
socket.on("serviceStatus", data => {
const nodeId = data["service_uuid"];
const workbench = this.getStudy().getWorkbench();
const node = workbench.getNode(nodeId);
if (node) {
if (node.getIframeHandler()) {
node.getIframeHandler().onNodeState(data);
}
} else if (osparc.data.Permissions.getInstance().isTester()) {
console.log("Ignored ws 'progress' msg", data);
}
}, this);
}
}
}
});

0 comments on commit 3c24a0e

Please sign in to comment.