Repository navigation
feat: serve UI under a URL path prefix - #754
Merged
Merged
Conversation
Frontend now uses relative URLs only (Vite base "./", API paths resolved against the page), so one build works under any prefix. For proxies that strip the prefix nothing needs configuring; for those forwarding the full path, the new --base-path flag / HD_BASE_PATH mounts routes under it. Chart gets dashboard.basePath. Also serve logo.svg and analytics.js that index.html references from the dist root (were 404 since v2.0), and point Swagger "Try it out" at the page-relative API location. Exclude public/ from eslint, matching the `lint` script scope that lint-staged bypassed. Fixes #529 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #754 +/- ##
==========================================
+ Coverage 21.92% 29.96% +8.03%
==========================================
Files 14 15 +1
Lines 2239 2593 +354
==========================================
+ Hits 491 777 +286
- Misses 1701 1742 +41
- Partials 47 74 +27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #529. Supersedes #606 with a single-image approach.
Changes
base: "./",fetchWithDefaultsresolves API paths against the page, plus the few hard-coded absolute URLs (index.html,analytics.js, post-uninstall redirect). WithHashRouter, the page always sits at<prefix>/, so one build works under any prefix; the frontend never needs to know it.index.html:/helm-dashboard→/helm-dashboard/, otherwise relative URLs would resolve to/.--base-pathflag /HD_BASE_PATHenv: mounts all routes under the prefix. Only needed for proxies that forward the full path; prefix-stripping proxies (ingress-nginxrewrite-target, as in Can't serve from a subpath #529) need no configuration.dashboard.basePathsets the env var and prefixes the liveness/readiness probe paths.logo.svgandanalytics.js, whichindex.htmlreferences from the dist root, were never served (404 since v2.0), so the favicon and browser analytics did not load. They are served now.public/, which thelintscript never covers; excluded it. Prettier reformattedanalytics.jsas a side effect.Testing
Local binary against kind with a sample release, rendered in headless Chrome:
/--base-path /helm-dashboard, accessed with and without the trailing slash/helm-dashboardAll app/API requests return 200 in each setup; the Swagger server resolves to the prefixed URL. New Go test covers prefixed routing. Not tested: real ingress-nginx with the chart deployed in-cluster.
🤖 Generated with Claude Code