Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement template processing for the index.html file to solve the UI serving in charms #353

Open
BarcoMasile opened this issue Jul 11, 2024 · 0 comments

Comments

@BarcoMasile
Copy link
Contributor

Description

When the Admin UI is deployed on Juju it will be served behind Traefik, with a specific context path.
For example, if traefik url is https://traefik.com, the Admin Service frontend UI will be served at
https://traefik.com/${model-name}-${app-name}/ui

Right now the frontend application will be built with a base of ./. This allows the charm to work without knowing exactly where the Admin UI is served, but will break in case any other url is used with a trailing slash.
For example /ui/providers/ will make it so the assets are requested at /ui/providers/assets/....

To fix this, the Frontend will need a way to know which context-path/prefix to use when downloading assets, in order to not have a blank page when the react app is downloaded.

@huwshimi suggested we aim at a template processing solution, where the index.html will have one or more variables to handle the needed prefix for assets, and the backend will populate those variable by processing the template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant