From e9c463ed88c92183f3bcbdc0a3f446ce9e73cf1b Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Fri, 14 Jun 2024 15:40:59 +0200 Subject: [PATCH 1/6] directly switch services iframe --- .../client/source/class/osparc/data/model/Node.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Node.js b/services/static-webserver/client/source/class/osparc/data/model/Node.js index 488c1b54f6f..5303f5193d4 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Node.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Node.js @@ -1245,7 +1245,12 @@ qx.Class.define("osparc.data.model.Node", { } = osparc.utils.Utils.computeServiceUrl(data); this.setDynamicV2(isDynamicV2); if (srvUrl) { - this.__waitForServiceReady(srvUrl); + // this.__waitForServiceReady(srvUrl); + // instead of waiting of waiting for + // - the service to be ready (pings) and + // - request its frontend to make sure it is ready + // we will directly switch its iframe + this.__serviceReadyIn(srvUrl); } break; } From 07ca705895b2a6a0d532c72bf8a4cffe167d99a8 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Fri, 14 Jun 2024 15:42:40 +0200 Subject: [PATCH 2/6] comment --- .../client/source/class/osparc/data/model/Node.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Node.js b/services/static-webserver/client/source/class/osparc/data/model/Node.js index 5303f5193d4..a1438efd41e 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Node.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Node.js @@ -1246,10 +1246,10 @@ qx.Class.define("osparc.data.model.Node", { this.setDynamicV2(isDynamicV2); if (srvUrl) { // this.__waitForServiceReady(srvUrl); - // instead of waiting of waiting for + // instead of waiting for // - the service to be ready (pings) and // - request its frontend to make sure it is ready - // we will directly switch its iframe + // we will skip those two steps and directly switch its iframe this.__serviceReadyIn(srvUrl); } break; From 4500f337ece3f14caa8a6c36d9b1d82db4ea7d05 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Fri, 14 Jun 2024 15:47:46 +0200 Subject: [PATCH 3/6] comments --- .../client/source/class/osparc/data/model/Node.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Node.js b/services/static-webserver/client/source/class/osparc/data/model/Node.js index a1438efd41e..0015bc2f937 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Node.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Node.js @@ -1246,10 +1246,11 @@ qx.Class.define("osparc.data.model.Node", { this.setDynamicV2(isDynamicV2); if (srvUrl) { // this.__waitForServiceReady(srvUrl); - // instead of waiting for - // - the service to be ready (pings) and - // - request its frontend to make sure it is ready - // we will skip those two steps and directly switch its iframe + // instead of + // - waiting for the service to be ready (pings) and ... + // - request its frontend to make sure it is ready and ... + // - wait for the "load" event triggered by the content of the iframe + // we will skip those steps and directly switch its iframe this.__serviceReadyIn(srvUrl); } break; From b475ab6c3c30de96d5e1dd0427e0221b8e621ca6 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 17 Jun 2024 13:49:27 +0200 Subject: [PATCH 4/6] do waitForServiceReady (successful ping) --- .../client/source/class/osparc/data/model/Node.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Node.js b/services/static-webserver/client/source/class/osparc/data/model/Node.js index 0015bc2f937..527496fa3a3 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Node.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Node.js @@ -1245,13 +1245,7 @@ qx.Class.define("osparc.data.model.Node", { } = osparc.utils.Utils.computeServiceUrl(data); this.setDynamicV2(isDynamicV2); if (srvUrl) { - // this.__waitForServiceReady(srvUrl); - // instead of - // - waiting for the service to be ready (pings) and ... - // - request its frontend to make sure it is ready and ... - // - wait for the "load" event triggered by the content of the iframe - // we will skip those steps and directly switch its iframe - this.__serviceReadyIn(srvUrl); + this.__waitForServiceReady(srvUrl); } break; } @@ -1337,9 +1331,16 @@ qx.Class.define("osparc.data.model.Node", { // ping for some time until it is really ready fetch(srvUrl) .then(request => { + /* if (request.status >= 200 || request.status < 300) { this.__waitForServiceWebsite(srvUrl) } + */ + // instead of + // - requesting its frontend to make sure it is ready and ... + // - wait for the "load" event triggered by the content of the iframe + // we will skip those steps and directly switch its iframe + this.__waitForServiceWebsite(srvUrl); }) .catch(err => { this.getStatus().setInteractive("connecting"); From 3b7112be32795355bab80ed74d5a24350be626f0 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 17 Jun 2024 14:05:23 +0200 Subject: [PATCH 5/6] comment --- .../client/source/class/osparc/data/model/Node.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Node.js b/services/static-webserver/client/source/class/osparc/data/model/Node.js index 527496fa3a3..5ca14bffbea 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Node.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Node.js @@ -1329,8 +1329,10 @@ qx.Class.define("osparc.data.model.Node", { __waitForServiceReady: function(srvUrl) { // ping for some time until it is really ready + console.log("__waitForServiceReady"); fetch(srvUrl) .then(request => { + console.log("request", request); /* if (request.status >= 200 || request.status < 300) { this.__waitForServiceWebsite(srvUrl) @@ -1338,9 +1340,9 @@ qx.Class.define("osparc.data.model.Node", { */ // instead of // - requesting its frontend to make sure it is ready and ... - // - wait for the "load" event triggered by the content of the iframe + // - waiting for the "load" event triggered by the content of the iframe // we will skip those steps and directly switch its iframe - this.__waitForServiceWebsite(srvUrl); + this.__serviceReadyIn(srvUrl); }) .catch(err => { this.getStatus().setInteractive("connecting"); From 998d86e90e22afa790f4c0b3956398ca04ccc0c8 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 17 Jun 2024 14:32:52 +0200 Subject: [PATCH 6/6] remove comments --- .../client/source/class/osparc/data/model/Node.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Node.js b/services/static-webserver/client/source/class/osparc/data/model/Node.js index 5ca14bffbea..940d1a27adb 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Node.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Node.js @@ -1329,10 +1329,8 @@ qx.Class.define("osparc.data.model.Node", { __waitForServiceReady: function(srvUrl) { // ping for some time until it is really ready - console.log("__waitForServiceReady"); fetch(srvUrl) .then(request => { - console.log("request", request); /* if (request.status >= 200 || request.status < 300) { this.__waitForServiceWebsite(srvUrl)