diff --git a/gateway/src/main/java/org/georchestra/gateway/app/GeorchestraGatewayApplication.java b/gateway/src/main/java/org/georchestra/gateway/app/GeorchestraGatewayApplication.java index e241715f..d49ff0dd 100644 --- a/gateway/src/main/java/org/georchestra/gateway/app/GeorchestraGatewayApplication.java +++ b/gateway/src/main/java/org/georchestra/gateway/app/GeorchestraGatewayApplication.java @@ -151,6 +151,15 @@ public String loginPage(@RequestParam Map allRequestParams, Mode return "login"; } + @GetMapping(path = "/style-config", produces = "application/json") + @ResponseBody + public Mono> styleConfig() { + Map ret = new LinkedHashMap<>(); + ret.put("stylesheet", georchestraStylesheet); + ret.put("logo", logoUrl); + return Mono.just(ret); + } + @EventListener(ApplicationReadyEvent.class) public void onApplicationReady(ApplicationReadyEvent e) { Environment env = e.getApplicationContext().getEnvironment(); diff --git a/gateway/src/main/resources/static/login/error.css b/gateway/src/main/resources/static/login/error.css new file mode 100644 index 00000000..74a44334 --- /dev/null +++ b/gateway/src/main/resources/static/login/error.css @@ -0,0 +1,57 @@ +:root { + --georchestra: #85127e; + --google: #4285F4; +} +html, body{ + padding: 0; + margin: 0; + font-family: Inter, sans-serif, Georgia, Cambria, "Times New Roman", Times, serif; + color: #333; +} +body { + width: 100vw; + height: 100vh; + display: flex; + align-items: center; + justify-content: center; + text-align: center; +} +p { + margin-top: 0; +} +.error-desc { + font-weight: bold; + font-size: 1.25rem; +} +.error-back { + display: block; + text-decoration: none; + color: white; + font-weight: bold; + background: var(--georchestra); + padding: 8px 8px; + margin-top: 20px; + border-radius: 5px; +} +.error-back:hover { + background: color-mix(in srgb,var(--georchestra),#000 25%); +} +#error-img { + max-height: 200px; + max-width: 50vw; +} +.error-code{ + font-size: 15rem; + font-weight: bold; + background-image: linear-gradient(180deg, color-mix(in srgb,var(--georchestra),#fff 40%), color-mix(in srgb,var(--georchestra),#fff 95%)); + background-size: 100%; + -webkit-background-clip: text; + -moz-background-clip: text; + -webkit-text-fill-color: transparent; + -moz-text-fill-color: transparent; +} +.error-hint { + font-size: 1rem; + font-weight: 500; + color: var(--georchestra); +} diff --git a/gateway/src/main/resources/static/login/getConfig.js b/gateway/src/main/resources/static/login/getConfig.js new file mode 100644 index 00000000..da82af3d --- /dev/null +++ b/gateway/src/main/resources/static/login/getConfig.js @@ -0,0 +1,13 @@ +fetch("/style-config").then(res => { + if (res.ok) { + return res.json(); + } + throw new Error("Gateway down") +}).then(json => { + if (json.stylesheet){ + var styleSheet = document.createElement("style") + styleSheet.textContent = json.stylesheet + document.head.appendChild(styleSheet) + } + +}) \ No newline at end of file diff --git a/gateway/src/main/resources/templates/error/403.html b/gateway/src/main/resources/templates/error/403.html index 09a00b88..febdc7a0 100644 --- a/gateway/src/main/resources/templates/error/403.html +++ b/gateway/src/main/resources/templates/error/403.html @@ -1,39 +1,22 @@ - - - - - - + + + + + + Access forbidden - - - -
- geOrchestra -

Sorry, access to this page is forbidden. Return to the homepage.

-
- - \ No newline at end of file + + + + +
+
403
+ +

Forbidden

+

Sorry, access to this page is forbidden.

+ Return to the homepage +
+ + + diff --git a/gateway/src/main/resources/templates/error/404.html b/gateway/src/main/resources/templates/error/404.html index fbd76a6e..7c987195 100644 --- a/gateway/src/main/resources/templates/error/404.html +++ b/gateway/src/main/resources/templates/error/404.html @@ -6,34 +6,16 @@ Page not found - + +
- geOrchestra -

Page not found. Return to the homepage.

+
404
+ +

Page not found

+

Sorry the page you requested doesn't exist.

+ Return to the homepage
\ No newline at end of file diff --git a/gateway/src/main/resources/templates/error/500.html b/gateway/src/main/resources/templates/error/500.html index 68dd4d3a..58f646fd 100644 --- a/gateway/src/main/resources/templates/error/500.html +++ b/gateway/src/main/resources/templates/error/500.html @@ -1,46 +1,24 @@ - - - - - - + + + + + + + Site in maintenance - - - -
- geOrchestra -

+ + + + +

+
500
+

Site in maintenance

+

Due to maintenance, this service is temporarily unavailable. -

-

We're sorry for the inconvenience !

-

Hint: do not close the tab - the requested page will show up in a few seconds.

-
- - +

+

We're sorry for the inconvenience !

+

Hint: do not close the tab - the requested page will show up in a few seconds.

+
+ \ No newline at end of file diff --git a/gateway/src/main/resources/templates/error/501.html b/gateway/src/main/resources/templates/error/501.html index 68dd4d3a..58f646fd 100644 --- a/gateway/src/main/resources/templates/error/501.html +++ b/gateway/src/main/resources/templates/error/501.html @@ -1,46 +1,24 @@ - - - - - - + + + + + + + Site in maintenance - - - -
- geOrchestra -

+ + + + +

+
500
+

Site in maintenance

+

Due to maintenance, this service is temporarily unavailable. -

-

We're sorry for the inconvenience !

-

Hint: do not close the tab - the requested page will show up in a few seconds.

-
- - +

+

We're sorry for the inconvenience !

+

Hint: do not close the tab - the requested page will show up in a few seconds.

+
+ \ No newline at end of file diff --git a/gateway/src/main/resources/templates/error/503.html b/gateway/src/main/resources/templates/error/503.html index 68dd4d3a..58f646fd 100644 --- a/gateway/src/main/resources/templates/error/503.html +++ b/gateway/src/main/resources/templates/error/503.html @@ -1,46 +1,24 @@ - - - - - - + + + + + + + Site in maintenance - - - -
- geOrchestra -

+ + + + +

+
500
+

Site in maintenance

+

Due to maintenance, this service is temporarily unavailable. -

-

We're sorry for the inconvenience !

-

Hint: do not close the tab - the requested page will show up in a few seconds.

-
- - +

+

We're sorry for the inconvenience !

+

Hint: do not close the tab - the requested page will show up in a few seconds.

+
+ \ No newline at end of file