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; diff --git a/CHANGELOG.md b/CHANGELOG.md index a0018761..65a59195 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ All notable changes to this project will be documented in this file. * Removed propTypes. * Upgraded redux-toolkit and how api slices are generated. * Fixed redux-toolkit cache handling. -* Added Taskfile +* Add Taskfile +* Added (Client) online-check to public. * Updated developer documentation. ### NB! Prior to 3.x the project was split into separate repositories 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..62c0d0b2 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,6 +30,7 @@ admin: controller: App\Controller\Admin\AdminController 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 @@ -48,6 +50,7 @@ client_config: when@dev: templates: + # Sub routes are included to pass route control to the React App. path: /template{subroutes} methods: ['GET'] requirements: diff --git a/public/client/online-check/1pixel.png b/public/client/online-check/1pixel.png new file mode 100644 index 00000000..1914264c Binary files /dev/null and b/public/client/online-check/1pixel.png differ diff --git a/public/client/online-check/index.html b/public/client/online-check/index.html new file mode 100644 index 00000000..55d5a401 --- /dev/null +++ b/public/client/online-check/index.html @@ -0,0 +1,207 @@ + + +
+ + + + + + +Network connection:
+Initialising...
+Retrying in seconds...
+ + +