Skip to content

Commit 39a7cfc

Browse files
authored
✨ New Product: Sim4Life Engineering, coming soon! (🚨) (#6036)
1 parent 44e0f9f commit 39a7cfc

File tree

10 files changed

+132
-13
lines changed

10 files changed

+132
-13
lines changed

services/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ services:
502502
- traefik.http.services.${SWARM_STACK_NAME}_static_webserver.loadbalancer.healthcheck.interval=2000ms
503503
- traefik.http.services.${SWARM_STACK_NAME}_static_webserver.loadbalancer.healthcheck.timeout=1000ms
504504
- traefik.http.middlewares.${SWARM_STACK_NAME}_static_webserver_retry.retry.attempts=2
505-
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.rule=hostregexp(`{host:.+}`) && (Path(`/osparc`,`/s4l`,`/s4llite`,`/s4lacad`,`/s4ldesktop`,`/s4ldesktopacad`,`/tis`,`/transpiled`,`/resource`) || PathPrefix(`/osparc/`,`/s4l/`,`/s4llite/`,`/s4lacad/`,`/s4ldesktop/`,`/s4ldesktopacad/`,`/tis/`,`/transpiled/`,`/resource/`))
505+
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.rule=hostregexp(`{host:.+}`) && (Path(`/osparc`,`/s4l`,`/s4llite`,`/s4lacad`,`/s4lengine`,`/s4ldesktop`,`/s4ldesktopacad`,`/tis`,`/transpiled`,`/resource`) || PathPrefix(`/osparc/`,`/s4l/`,`/s4llite/`,`/s4lacad/`,`/s4lengine/`,`/s4ldesktop/`,`/s4ldesktopacad/`,`/tis/`,`/transpiled/`,`/resource/`))
506506
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.service=${SWARM_STACK_NAME}_static_webserver
507507
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.entrypoints=http
508508
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.priority=2

services/static-webserver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ Used for static content serving.
66

77
In the future will fully serve all static content. Currently the `webserver` is still serving the following routes:
88

9-
- `/` resolves to one of the three index.html pages inside the 4 products (osparc, tis, s4l, s4llite, s4lacad, s4ldesktop, s4ldesktopacad)
9+
- `/` resolves to one of the three index.html pages inside the 4 products (osparc, tis, s4l, s4llite, s4lacad, s4lengine, s4ldesktop, s4ldesktopacad)
1010
- `/static-frontend-data.json` contains information required by the fronted

services/static-webserver/client/compile.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,22 @@
8484
"addTimestampsToUrls": true,
8585
"bootPath": "source/boot"
8686
},
87+
{
88+
"class": "osparc.Application",
89+
"theme": "osparc.theme.products.s4l.ThemeDark",
90+
"name": "s4lengine",
91+
"title": "Sim4Life Engineering",
92+
"include": [
93+
"iconfont.material.Load",
94+
"iconfont.fontawesome5.Load",
95+
"osparc.theme.products.s4l.ThemeLight"
96+
],
97+
"environment": {
98+
"product.name": "s4lengine"
99+
},
100+
"addTimestampsToUrls": true,
101+
"bootPath": "source/boot"
102+
},
87103
{
88104
"class": "osparc.Application",
89105
"theme": "osparc.theme.products.s4l.ThemeDark",

services/static-webserver/client/scripts/apps_metadata.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
"replace_me_og_description": "Sim4Life for Science - Computational life sciences platform that combines computable human phantoms, powerful physics solvers and advanced tissue models.",
2222
"replace_me_og_image": "https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/full/background-images/S4L/Sim4Life-head-academy.png"
2323
}
24+
}, {
25+
"application": "s4lengine",
26+
"replacements": {
27+
"replace_me_og_title": "Sim4Life Engineering",
28+
"replace_me_og_description": "Sim4Life for Engineers - Computational life sciences platform that combines computable human phantoms, powerful physics solvers and advanced tissue models.",
29+
"replace_me_og_image": "https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/full/background-images/S4L/Sim4Life-head-default.png"
30+
}
2431
}, {
2532
"application": "s4ldesktop",
2633
"replacements": {

services/static-webserver/client/source/class/osparc/Application.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ qx.Class.define("osparc.Application", {
4242
// Call super class
4343
this.base();
4444

45-
this.__preventAutofillBrowserStyles();
46-
4745
// Enable logging in debug variant
4846
if (qx.core.Environment.get("qx.debug")) {
4947
// support native logging capabilities, e.g. Firebug for Firefox
@@ -52,6 +50,17 @@ qx.Class.define("osparc.Application", {
5250

5351
await this.__preloadCalls();
5452

53+
this.__preventAutofillBrowserStyles();
54+
this.__loadCommonCss();
55+
this.__updateTabName();
56+
this.__updateFavicon();
57+
58+
if (qx.core.Environment.get("product.name") === "s4lengine") {
59+
const view = new osparc.auth.BlurredLoginPageS4LEngineering();
60+
this.__loadView(view);
61+
return;
62+
}
63+
5564
const intlTelInput = osparc.wrapper.IntlTelInput.getInstance();
5665
intlTelInput.init();
5766

@@ -83,11 +92,6 @@ qx.Class.define("osparc.Application", {
8392
// Setting up auth manager
8493
osparc.auth.Manager.getInstance().addListener("logout", () => this.__restart(), this);
8594

86-
this.__loadCommonCss();
87-
88-
this.__updateTabName();
89-
this.__updateFavicon();
90-
9195
this.__initRouting();
9296
this.__startupChecks();
9397
},
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/* ************************************************************************
2+
3+
osparc - the simcore frontend
4+
5+
https://osparc.io
6+
7+
Copyright:
8+
2024 IT'IS Foundation, https://itis.swiss
9+
10+
License:
11+
MIT: https://opensource.org/licenses/MIT
12+
13+
Authors:
14+
* Odei Maiz (odeimaiz)
15+
16+
************************************************************************ */
17+
18+
qx.Class.define("osparc.auth.BlurredLoginPageS4LEngineering", {
19+
extend: qx.ui.core.Widget,
20+
21+
construct: function() {
22+
this.base(arguments);
23+
24+
this._setLayout(new qx.ui.layout.Grow());
25+
26+
this.__loadHtml();
27+
},
28+
29+
members: {
30+
__loadHtml: function() {
31+
const htmlEmbed = new qx.ui.embed.Html();
32+
this._add(htmlEmbed);
33+
34+
// Fetch the HTML file
35+
const req = new qx.io.request.Xhr("resource/osparc/S4LEngine_ComingSoon.html");
36+
req.addListener("success", function(e) {
37+
var response = e.getTarget().getResponse();
38+
htmlEmbed.setHtml(response);
39+
});
40+
req.send();
41+
}
42+
}
43+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<head>
2+
<style>
3+
body {
4+
margin: 0;
5+
padding: 0;
6+
overflow-x: hidden;
7+
}
8+
.bg {
9+
position: fixed;
10+
top: 0;
11+
left: 0;
12+
/* Preserve aspet ratio */
13+
min-width: 100%;
14+
min-height: 100%;
15+
}
16+
.container {
17+
position: relative;
18+
text-align: center;
19+
color: white;
20+
}
21+
.centered {
22+
position: absolute;
23+
top: 50%;
24+
left: 50%;
25+
transform: translate(-50%, -50%);
26+
}
27+
</style>
28+
</head>
29+
<body>
30+
<img class="bg" src="https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/full/background-images/S4L_engineering/Login_blurred.png" alt="S4L Engineering" style="width:100%;">
31+
<div class="container"></div>
32+
<div class="centered">
33+
<img src="https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/full/background-images/S4L_engineering/ComingSoon.png" alt="Coming Soon" style="width:100%;">
34+
</div>
35+
</section>
36+
</body>
37+
38+
</html>

services/web/server/src/simcore_service_webserver/statics/_constants.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# these are the apps built right now by static-webserver/client
22

3-
FRONTEND_APPS_AVAILABLE = frozenset({"osparc", "tis", "s4l", "s4llite", "s4lacad", "s4ldesktop", "s4ldesktopacad"})
3+
FRONTEND_APPS_AVAILABLE = frozenset(
4+
{
5+
"osparc",
6+
"tis",
7+
"s4l",
8+
"s4llite",
9+
"s4lacad",
10+
"s4lengine",
11+
"s4ldesktop",
12+
"s4ldesktopacad",
13+
}
14+
)
415
FRONTEND_APP_DEFAULT = "osparc"
516

617
assert FRONTEND_APP_DEFAULT in FRONTEND_APPS_AVAILABLE # nosec

services/web/server/src/simcore_service_webserver/statics/_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
async def create_cached_indexes(app: web.Application) -> None:
5050
"""
51-
Currently the static resources are contain 4 folders: osparc, s4l, s4llite, s4lacad, tis
51+
Currently the static resources contain N folders: osparc, s4l, s4llite, s4lacad, s4lengine, tis
5252
each of them contain and index.html to be served to as the root of the site
5353
for each type of frontend.
5454

services/web/server/src/simcore_service_webserver/statics/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def setup_statics(app: web.Application) -> None:
3030

3131
setup_products(app)
3232

33-
# serves information composed by making 4 http requests (once for each product)
34-
# to the index.html in each of the 4 product directories /osparc, /s4l, /s4llite, /s4lacad, /s4ldesktop, /s4ldesktopacad, and /tis
33+
# serves information composed by making N http requests (once for each product)
34+
# to the index.html in each of the N product directories /osparc, /s4l, /s4llite, /s4lacad, /s4lengine, /s4ldesktop, /s4ldesktopacad, and /tis
3535
app.router.add_get("/", get_cached_frontend_index, name=INDEX_RESOURCE_NAME)
3636

3737
# statics.json is computed here and contains information used

0 commit comments

Comments
 (0)