From 031dbdbe2548afc78b5f31d432882f8286db0b09 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 15 Nov 2021 09:37:49 +0100 Subject: [PATCH 1/3] Demo Mode Improvements --- Environment.js | 3 ++- Platform/UI/EventsServerClient.js | 4 ++++ .../UI/Spaces/Charting-Space/PlottersManager.js | 5 +++++ .../Foundations/UI/Spaces/Cockpit-Space/CockpitSpace.js | 9 +++++++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Environment.js b/Environment.js index 78846c598..2c5b5d48f 100644 --- a/Environment.js +++ b/Environment.js @@ -8,7 +8,8 @@ if (process.env.PACKAGED_PATH) { exports.newEnvironment = function () { let thisObject = { - DEMO_MODE: false, + DEMO_MODE: true, + DEMO_MODE_HOST: "localhost", BASE_PATH: basePath, WEB_SERVER_URL: 'localhost', PLATFORM_WEB_SOCKETS_INTERFACE_PORT: 18041, diff --git a/Platform/UI/EventsServerClient.js b/Platform/UI/EventsServerClient.js index cf6d14e87..c068ebee6 100644 --- a/Platform/UI/EventsServerClient.js +++ b/Platform/UI/EventsServerClient.js @@ -225,6 +225,10 @@ function newEventsServerClient(lanNetworkNode) { port = config.webSocketsPort extwsurl = config.webSocketsExternalURL + if (UI.environment.DEMO_MODE === true) { + host = UI.environment.DEMO_MODE_HOST + } + /* Check if we really have to establish the connection. */ if (config.autoConnect === false) { return } } catch (err) { diff --git a/Projects/Foundations/UI/Spaces/Charting-Space/PlottersManager.js b/Projects/Foundations/UI/Spaces/Charting-Space/PlottersManager.js index 0317e2582..d64e2365c 100644 --- a/Projects/Foundations/UI/Spaces/Charting-Space/PlottersManager.js +++ b/Projects/Foundations/UI/Spaces/Charting-Space/PlottersManager.js @@ -177,6 +177,11 @@ function newPlottersManager() { let scheme = 'http' if (host === undefined) { host = window.location.hostname } if (webPort === undefined) { webPort = window.location.port } + + if (UI.environment.DEMO_MODE === true) { + host = UI.environment.DEMO_MODE_HOST + } + if (extWSURL !== undefined) { host = window.location.hostname webPort = window.location.port diff --git a/Projects/Foundations/UI/Spaces/Cockpit-Space/CockpitSpace.js b/Projects/Foundations/UI/Spaces/Cockpit-Space/CockpitSpace.js index bcabcae62..98a047979 100644 --- a/Projects/Foundations/UI/Spaces/Cockpit-Space/CockpitSpace.js +++ b/Projects/Foundations/UI/Spaces/Cockpit-Space/CockpitSpace.js @@ -138,8 +138,13 @@ function newFoundationsCockpitSpace() { statusCounter-- if (statusCounter < 0) { statusCounter = 0 - statusText = undefined, - statusType = undefined + statusText = undefined + statusType = undefined + + if (UI.environment.DEMO_MODE === true) { + statusText = 'You are running Superalgos in DEMO MODE. That means that you will not be able to run or stop tasks. Remember Tutorials were designed for the full version, when you download the software.' + statusType = STATUS_TYPES.WARNING + } } } From b91018071edcbf630dc0c03cd014f07be22ff268 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 15 Nov 2021 09:40:19 +0100 Subject: [PATCH 2/3] Demo Mode Improvements 2 --- Projects/Foundations/UI/Spaces/Design-Space/Workspace.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Projects/Foundations/UI/Spaces/Design-Space/Workspace.js b/Projects/Foundations/UI/Spaces/Design-Space/Workspace.js index 63c6ad347..8253be306 100644 --- a/Projects/Foundations/UI/Spaces/Design-Space/Workspace.js +++ b/Projects/Foundations/UI/Spaces/Design-Space/Workspace.js @@ -179,6 +179,10 @@ function newWorkspace() { } async function saveWorkspace(callBackFunction) { + if (UI.environment.DEMO_MODE === true) { + return + } + let workspace = UI.projects.foundations.spaces.designSpace.workspace.workspaceNode /* Validation if it is too early to save. */ From ebc139bee69cf82a4b0dbd532c7c723dfb905422 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 15 Nov 2021 09:41:15 +0100 Subject: [PATCH 3/3] Demo Mode Improvements 3 --- Environment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Environment.js b/Environment.js index 2c5b5d48f..26a20db91 100644 --- a/Environment.js +++ b/Environment.js @@ -8,8 +8,8 @@ if (process.env.PACKAGED_PATH) { exports.newEnvironment = function () { let thisObject = { - DEMO_MODE: true, - DEMO_MODE_HOST: "localhost", + DEMO_MODE: false, + DEMO_MODE_HOST: "super-super-uzzdd68dwm9w-22a320db4ede63aa.elb.us-east-2.amazonaws.com", BASE_PATH: basePath, WEB_SERVER_URL: 'localhost', PLATFORM_WEB_SOCKETS_INTERFACE_PORT: 18041,