From 572826f96a6bfcc480e67ef791bd65577843462e Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:13:26 +0200 Subject: [PATCH 1/5] 4565: Added online check --- CHANGELOG.md | 1 + public/online-check/1pixel.png | Bin 0 -> 95 bytes public/online-check/index.html | 207 +++++++++++++++++++++++++++++++++ 3 files changed, 208 insertions(+) create mode 100644 public/online-check/1pixel.png create mode 100644 public/online-check/index.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c2777af..c7500228 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. * Upgraded redux-toolkit and how api slices are generated. * Fixed redux-toolkit cache handling. * Add Taskfile +* Added online-check to public. ### NB! Prior to 3.x the project was split into separate repositories diff --git a/public/online-check/1pixel.png b/public/online-check/1pixel.png new file mode 100644 index 0000000000000000000000000000000000000000..1914264c08781d1f30ee0b8482bccf44586f2dc1 GIT binary patch literal 95 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga%mF?ju0VQumF+E%TuG2$FoVOh l8)-lem#2$k2*>s01R$Gz9%CSj!PC{xWt~$(697H@6ZHT9 literal 0 HcmV?d00001 diff --git a/public/online-check/index.html b/public/online-check/index.html new file mode 100644 index 00000000..55d5a401 --- /dev/null +++ b/public/online-check/index.html @@ -0,0 +1,207 @@ + + + + + + + + + + OS2Display online check + + + + + + + + + + +

Network connection:

+

Initialising...

+

Retrying in seconds...

+ + + From f1c7b523d1c17ac6e4f2416c19319d9f7f8730b0 Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:29:12 +0200 Subject: [PATCH 2/5] 4565: Moved files to /client/online-check/ --- CHANGELOG.md | 2 +- public/{ => client}/online-check/1pixel.png | Bin public/{ => client}/online-check/index.html | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename public/{ => client}/online-check/1pixel.png (100%) rename public/{ => client}/online-check/index.html (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7500228..46289829 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ All notable changes to this project will be documented in this file. * Upgraded redux-toolkit and how api slices are generated. * Fixed redux-toolkit cache handling. * Add Taskfile -* Added online-check to public. +* Added (Client) online-check to public. ### NB! Prior to 3.x the project was split into separate repositories diff --git a/public/online-check/1pixel.png b/public/client/online-check/1pixel.png similarity index 100% rename from public/online-check/1pixel.png rename to public/client/online-check/1pixel.png diff --git a/public/online-check/index.html b/public/client/online-check/index.html similarity index 100% rename from public/online-check/index.html rename to public/client/online-check/index.html From 419dc7dbfaca3b5dad9595f5878b20f3a7c5ec5e Mon Sep 17 00:00:00 2001 From: turegjorup Date: Mon, 1 Sep 2025 15:15:04 +0200 Subject: [PATCH 3/5] Update nginx config to server client online check --- .docker/templates/default.conf.template | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.docker/templates/default.conf.template b/.docker/templates/default.conf.template index 61c4e648..8f789dca 100644 --- a/.docker/templates/default.conf.template +++ b/.docker/templates/default.conf.template @@ -16,6 +16,11 @@ server { try_files $uri /index.php$is_args$args; } + # Screen client online check should just serve static files + location /client/online-check { + index index.html index.htm; + } + # Protect files and directories from prying eyes. location ~* \.(engine|inc|install|make|module|profile|po|sh|.*sql|.tar|.gz|.bz2|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$ { deny all; From 981da03e1cd3c91df1efd76220bd175a2f82baa2 Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Mon, 1 Sep 2025 15:40:34 +0200 Subject: [PATCH 4/5] 4565: Removed subroutes from the client since it is not used. Added documentation --- README.md | 9 +++++++++ config/routes.yaml | 7 +++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6c3a90a0..bbfd47e5 100644 --- a/README.md +++ b/README.md @@ -504,6 +504,15 @@ classDiagram Feed "0..n" -- "1" FeedSource ``` +## Online check for Client + +If the client does not have internet when starting, it cannot load the assets needed for the Client. +The `public/client/online-check` has been added to handle this. +The folder contains an `index.html`, that checks connectivity before redirecting to `/client`. +If this index.html is cached in the browser the online check page can load without internet. + +To use this, set the starting path of the Client to `/client/online-check`. + ## Error codes in the Client The Client at `/client` can display the following error codes: diff --git a/config/routes.yaml b/config/routes.yaml index 82b9feaa..341f03c6 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -21,6 +21,7 @@ authentication-unbind-screen: controller: App\Controller\Api\AuthScreenUnbindController admin: + # Sub routes are included to pass route control to the React App. path: /admin{subroutes} requirements: # https://symfony.com/doc/current/routing.html#slash-characters-in-route-parameters @@ -29,10 +30,7 @@ admin: controller: App\Controller\Admin\AdminController client: - path: /client{subroutes} - requirements: - # https://symfony.com/doc/current/routing.html#slash-characters-in-route-parameters - subroutes: '.*' + path: /client methods: ['GET'] controller: App\Controller\Client\ClientController @@ -48,6 +46,7 @@ client_config: when@dev: templates: + # Sub routes are included to pass route control to the React App. path: /template{subroutes} methods: ['GET'] requirements: From 8b9ae582e5228b92cdf9784912d6be2f3b219779 Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Mon, 1 Sep 2025 15:42:20 +0200 Subject: [PATCH 5/5] 4565: Readded subroutes to client route --- config/routes.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/routes.yaml b/config/routes.yaml index 341f03c6..62c0d0b2 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -30,7 +30,11 @@ admin: controller: App\Controller\Admin\AdminController client: - path: /client + # Sub routes are included to pass route control to the React App. + path: /client{subroutes} + requirements: + # https://symfony.com/doc/current/routing.html#slash-characters-in-route-parameters + subroutes: '.*' methods: ['GET'] controller: App\Controller\Client\ClientController