From e8aed49f681d79c1ad533a94d4764606d4531256 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 21 Oct 2024 14:54:35 +0200 Subject: [PATCH 1/8] minor --- .../source/class/osparc/data/model/NodeProgressSequence.js | 1 + 1 file changed, 1 insertion(+) diff --git a/services/static-webserver/client/source/class/osparc/data/model/NodeProgressSequence.js b/services/static-webserver/client/source/class/osparc/data/model/NodeProgressSequence.js index 27c04a156b9..d15270613b2 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/NodeProgressSequence.js +++ b/services/static-webserver/client/source/class/osparc/data/model/NodeProgressSequence.js @@ -22,6 +22,7 @@ * [CLUSTER_UP_SCALING] * [SIDECARS_PULLING] * [SERVICE_OUTPUTS_PULLING, SERVICE_STATE_PULLING, SERVICE_IMAGES_PULLING] (notice the parallelism here) + * [SERVICE_CONTAINERS_STARTING] * [SERVICE_INPUTS_PULLING] (when this happens, the frontend has already loaded the service and is displaying it to the user) I would still keep it as is, when we decide to make inputs pulling part of the boot sequence this will be helpful. * * This class provides different widgets that render the progress status From 2021dbc263e8cc5074a727aa75c2915ad1814592 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 21 Oct 2024 15:02:25 +0200 Subject: [PATCH 2/8] show service message --- .../client/source/class/osparc/data/model/IframeHandler.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index 1dd46c13b13..65f1df6a54b 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -115,7 +115,7 @@ qx.Class.define("osparc.data.model.IframeHandler", { const nodeStatus = node.getStatus(); const sequenceWidget = nodeStatus.getProgressSequence().getWidgetForLoadingPage(); nodeStatus.bind("interactive", sequenceWidget, "visibility", { - converter: state => ["starting", "pulling", "pending", "connecting"].includes(state) ? "visible" : "excluded" + converter: state => ["starting", "pulling", "connecting"].includes(state) ? "visible" : "excluded" }); loadingPage.addExtraWidget(sequenceWidget); @@ -189,6 +189,8 @@ qx.Class.define("osparc.data.model.IframeHandler", { const nodeId = data["service_uuid"]; const node = this.getNode(); const status = node.getStatus(); + const loadingPage = this.getLoadingPage(); + loadingPage.clearMessages(); switch (serviceState) { case "idle": { status.setInteractive(serviceState); @@ -202,6 +204,7 @@ qx.Class.define("osparc.data.model.IframeHandler", { if (data["service_message"]) { const serviceName = node.getLabel(); const serviceMessage = data["service_message"]; + loadingPage.setMessages([serviceMessage]); const msg = `The service "${serviceName}" is waiting for available ` + `resources. Please inform support and provide the following message ` + `in case this does not resolve in a few minutes: "${nodeId}" ` + From e4cbd0e98640e222e25abbd898c8c027db903568 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 21 Oct 2024 15:05:17 +0200 Subject: [PATCH 3/8] minor --- .../client/source/class/osparc/data/model/IframeHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index 65f1df6a54b..a4db4c2c3d1 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -115,7 +115,7 @@ qx.Class.define("osparc.data.model.IframeHandler", { const nodeStatus = node.getStatus(); const sequenceWidget = nodeStatus.getProgressSequence().getWidgetForLoadingPage(); nodeStatus.bind("interactive", sequenceWidget, "visibility", { - converter: state => ["starting", "pulling", "connecting"].includes(state) ? "visible" : "excluded" + converter: state => ["pulling", "starting", "connecting"].includes(state) ? "visible" : "excluded" }); loadingPage.addExtraWidget(sequenceWidget); From 873273f95842c9b75d979aebd88bc5d2f3ed5adb Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 21 Oct 2024 16:01:57 +0200 Subject: [PATCH 4/8] pending is a valid Progress Sequence State --- .../client/source/class/osparc/data/model/IframeHandler.js | 2 +- .../client/source/class/osparc/data/model/Node.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index a4db4c2c3d1..87778703402 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -115,7 +115,7 @@ qx.Class.define("osparc.data.model.IframeHandler", { const nodeStatus = node.getStatus(); const sequenceWidget = nodeStatus.getProgressSequence().getWidgetForLoadingPage(); nodeStatus.bind("interactive", sequenceWidget, "visibility", { - converter: state => ["pulling", "starting", "connecting"].includes(state) ? "visible" : "excluded" + converter: state => ["pending", "pulling", "starting", "connecting"].includes(state) ? "visible" : "excluded" }); loadingPage.addExtraWidget(sequenceWidget); 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 c04e32ab64e..40cca53e144 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 @@ -1108,6 +1108,10 @@ qx.Class.define("osparc.data.model.Node", { if (nodeStatus.getProgressSequence()) { nodeStatus.getProgressSequence().addProgressMessage(progressType, progressReport); } + if (this.getIframeHandler()) { + const loadingPage = this.getIframeHandler().getLoadingPage(); + loadingPage.clearMessages(); + } }, attachHandlersToStartButton: function(startButton) { From 4d49ab813d88b8e9bbdc1017e1a46815d40ca435 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 21 Oct 2024 16:16:52 +0200 Subject: [PATCH 5/8] add comment --- .../client/source/class/osparc/data/model/Node.js | 1 + 1 file changed, 1 insertion(+) 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 40cca53e144..b52c08dbf25 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 @@ -1108,6 +1108,7 @@ qx.Class.define("osparc.data.model.Node", { if (nodeStatus.getProgressSequence()) { nodeStatus.getProgressSequence().addProgressMessage(progressType, progressReport); } + // there might be some pending ``service_message`` still shown, remove it if (this.getIframeHandler()) { const loadingPage = this.getIframeHandler().getLoadingPage(); loadingPage.clearMessages(); From a0d625d90af14c884ee99ceb83fc489fa66e9571 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 21 Oct 2024 16:21:12 +0200 Subject: [PATCH 6/8] rename variable --- .../source/class/osparc/ui/message/Loading.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js index 550b336820f..b8d6717e2b3 100644 --- a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js +++ b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js @@ -93,7 +93,7 @@ qx.Class.define("osparc.ui.message.Loading", { __mainLayout: null, __thumbnail: null, __header: null, - __messages: null, + __messagesContainer: null, __extraWidgets: null, __maxButton: null, @@ -162,7 +162,7 @@ qx.Class.define("osparc.ui.message.Loading", { row: this.self().GRID_POS.WAITING }); - const messages = this.__messages = new qx.ui.container.Composite(new qx.ui.layout.VBox(10).set({ + const messages = this.__messagesContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox(10).set({ alignX: "center" })); mainLayout.addAt(messages, { @@ -236,24 +236,24 @@ qx.Class.define("osparc.ui.message.Loading", { rich: true, wrap: true }); - this.__messages.add(text); + this.__messagesContainer.add(text); }); - this.__messages.show(); + this.__messagesContainer.show(); } else { - this.__messages.exclude(); + this.__messagesContainer.exclude(); } }, clearMessages: function() { - this.__messages.removeAll(); + this.__messagesContainer.removeAll(); }, addWidgetToMessages: function(widget) { if (widget) { - this.__messages.add(widget); - this.__messages.show(); + this.__messagesContainer.add(widget); + this.__messagesContainer.show(); } else { - this.__messages.exclude(); + this.__messagesContainer.exclude(); } }, From b90bf365a234a60a56591c209ef7ad5ff4edc0a0 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 21 Oct 2024 16:25:19 +0200 Subject: [PATCH 7/8] expose MessageLabels --- .../client/source/class/osparc/ui/message/Loading.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js index b8d6717e2b3..bfd238cd9e2 100644 --- a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js +++ b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js @@ -248,6 +248,10 @@ qx.Class.define("osparc.ui.message.Loading", { this.__messagesContainer.removeAll(); }, + getMessageLabels: function() { + return this.__messagesContainer.getChildren(); + }, + addWidgetToMessages: function(widget) { if (widget) { this.__messagesContainer.add(widget); From 2d3abbca43b5c4c586b754338c6f47e0a5a6ddb2 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Mon, 21 Oct 2024 16:26:39 +0200 Subject: [PATCH 8/8] show pending messages only after 10" --- .../client/source/class/osparc/data/model/IframeHandler.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index 87778703402..9620c80daf1 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -202,9 +202,14 @@ qx.Class.define("osparc.data.model.IframeHandler", { } case "pending": { if (data["service_message"]) { - const serviceName = node.getLabel(); const serviceMessage = data["service_message"]; loadingPage.setMessages([serviceMessage]); + // show pending messages only after 10" + loadingPage.getMessageLabels().forEach(label => label.exclude()); + setTimeout(() => { + loadingPage.getMessageLabels().forEach(label => label.show()); + }, 10000); + const serviceName = node.getLabel(); const msg = `The service "${serviceName}" is waiting for available ` + `resources. Please inform support and provide the following message ` + `in case this does not resolve in a few minutes: "${nodeId}" ` +