From cbaf66bc8f8a04f11ae374ce470acd2a59df2aa5 Mon Sep 17 00:00:00 2001 From: Rich Turner <7072278+richturner@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:11:59 +0100 Subject: [PATCH] Update working-on-ui-and-apps.md --- .../developer-guide/working-on-ui-and-apps.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/developer-guide/working-on-ui-and-apps.md b/docs/developer-guide/working-on-ui-and-apps.md index 71b3c40..0292803 100644 --- a/docs/developer-guide/working-on-ui-and-apps.md +++ b/docs/developer-guide/working-on-ui-and-apps.md @@ -65,6 +65,27 @@ The following standard NPM scripts are used throughout the components and apps f The above script names should be used in `package.json` files and then appropriate `build.gradle` files should be added, see existing components, apps, demos for examples. Typically only the `apps` need to be built by `gradle` tasks as typescript should follow project references and compile any dependent components. +### Running Manager UI against remote instance + +* Add `https://localhost/*` to Valid redirect URIs of openremote client in master realm of remote instance keycloak +* Ensure remote instance manager container has `localhost` listed in `OR_ADDITIONAL_HOSTNAMES` (note this variable is comma separated list of hostnames) +* Run the `dev-proxy.yml` compose profile locally +* Access shell in proxy container: `docker exec -it ash` +* Add the following snippets to the proxy config (Press i for insert mode, when finished press Esc then : then wq): `vi /etc/haproxy/haproxy.cfg` + * Above the `use_backend manager_backend` line +``` + acl webpack path_beg /manager + use_backend webpack_backend if webpack +``` + * Above the `backend manager_backend` line: +``` +backend webpack_backend + server webpack host.docker.internal:9000 +``` + +* Ctrl/Cmd-D to exit the proxy container shell +* Start the webpack dev server in the `ui/app/manager`: `npm run serve -- --env managerUrl=https://demo.openremote.app` + ### Components Components can be developed and tested in isolation (with dependencies on other components and/or public npm modules as required). Some components have no visuals and provide standard OpenRemote functionality e.g. `@openremote/core`, whilst others provide visuals that allow interaction with the Manager backend.