Skip to content

Commit f0f5052

Browse files
committed
listenToServiceStatus
1 parent e9374d8 commit f0f5052

File tree

1 file changed

+20
-0
lines changed
  • services/static-webserver/client/source/class/osparc/desktop

1 file changed

+20
-0
lines changed

services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
287287
this.__listenToNodeProgress();
288288
this.__listenToNoMoreCreditsEvents();
289289
this.__listenToEvent();
290+
this.__listenToServiceStatus();
290291
},
291292

292293
__listenToLogger: function() {
@@ -414,6 +415,25 @@ qx.Class.define("osparc.desktop.StudyEditor", {
414415
}
415416
},
416417

418+
__listenToServiceStatus: function() {
419+
const socket = osparc.wrapper.WebSocket.getInstance();
420+
421+
// callback for events
422+
if (!socket.slotExists("serviceStatus")) {
423+
socket.on("serviceStatus", data => {
424+
if (this.getStudy().getUuid() !== data["project_id"]) {
425+
return;
426+
}
427+
const nodeId = data["service_uuid"];
428+
const workbench = this.getStudy().getWorkbench();
429+
const node = workbench.getNode(nodeId);
430+
if (node && node.getIframeHandler()) {
431+
node.getIframeHandler().onNodeState(data);
432+
}
433+
}, this);
434+
}
435+
},
436+
417437
__reloadSnapshotsAndIterations: function() {
418438
const isVCDisabled = osparc.utils.DisabledPlugins.isVersionControlDisabled();
419439
if (!isVCDisabled) {

0 commit comments

Comments
 (0)