ui icon indicating copy to clipboard operation
ui copied to clipboard

Allow ui to be served on a subpath

Open Adam-D-Lewis opened this issue 3 years ago • 2 comments

I'm running prefect-server via the prefect-server helm chart and I would like to host the prefect ui on [mydomain]/prefect-ui. I've set up an ingress on my kubernetes cluster which routes get requests to [mydomain]/prefect-ui to the prefect-ui pod, however the index.html which loads contains absolute paths e.g. https://github.com/PrefectHQ/ui/blob/ca6ff1b6ea6f4f6c1839e9990bc3a35b6d667937/public/index.html#L40-L42

so my browser looks for these resources at e.g. [mydomain]/fonts/fonts.css instead of at [mydomain]/prefect-ui/fonts/fonts.css so the request is no longer routed to the prefect-ui pod and I get a 404 error on those get requests.

I believe changing the abosolute paths to relative paths (remove initial forward slash) would fix the issue, but I am relatively new to routing and am unfamiliar with Vue so I may be off base. Thanks!

Adam-D-Lewis avatar Oct 27 '21 16:10 Adam-D-Lewis

@znicholasbrown - would welcome your thoughts on this one

zhen0 avatar Nov 05 '21 20:11 zhen0

Hi @Adam-D-Lewis - I'd recommend you rebuild your UI using the npm run build command after adding the proper paths to the vue config - the reason being that adding relative paths or swapping from native history mode can break other implementations and it's not something we're able to maintain at the moment.

znicholasbrown avatar Nov 05 '21 20:11 znicholasbrown