feat(ui): direct-download links for downloadable local repo files #106

Merged
benvin merged 1 commits from benvin/ui-download-links into master 2026-07-25 14:15:26 +10:00
Owner

Why

The local-repo object browser renders every file name as inert text, so there is no way to grab a file from the UI even though local rpm repos already serve their contents as real yum repos. Users have to hand-construct URLs. This adds one-click downloads, built as a modular per-repo-type capability so other types can be switched on later with a single map entry.

Changes

  • Adds a downloadableTypes capability map (ui/src/components/downloads.ts) keyed by package_type; each entry builds the direct-download URL for a file.
  • Enables rpm, pointing at the yum files route /api/v2/remotes/<repo>/files/<path> (path-segment-encoded).
  • Renders file names in the object browser as <a href download> links when the repo's type is downloadable, and as plain text otherwise.
  • Fetches the repo's package_type on the Objects page as the modularity hook and threads it through the tree rows.

Notes

Download links are same-origin unauthenticated GETs (the API serves local repos with no token on reads, matching how yum clients fetch), so a bare href carries no credentials. Adding a future type is one entry in downloadableTypes.

## Why The local-repo object browser renders every file name as inert text, so there is no way to grab a file from the UI even though local rpm repos already serve their contents as real yum repos. Users have to hand-construct URLs. This adds one-click downloads, built as a modular per-repo-type capability so other types can be switched on later with a single map entry. ## Changes - Adds a `downloadableTypes` capability map (`ui/src/components/downloads.ts`) keyed by `package_type`; each entry builds the direct-download URL for a file. - Enables `rpm`, pointing at the yum files route `/api/v2/remotes/<repo>/files/<path>` (path-segment-encoded). - Renders file names in the object browser as `<a href download>` links when the repo's type is downloadable, and as plain text otherwise. - Fetches the repo's `package_type` on the Objects page as the modularity hook and threads it through the tree rows. ## Notes Download links are same-origin unauthenticated GETs (the API serves local repos with no token on reads, matching how yum clients fetch), so a bare `href` carries no credentials. Adding a future type is one entry in `downloadableTypes`.
unkinben added 1 commit 2026-07-25 12:59:47 +10:00
feat(ui): direct-download links for downloadable local repo files
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
0c760bafcd
Make filenames in the local repo object browser direct-download links
for repo types that expose a downloadable file route (rpm now).

- add downloadableTypes capability map keyed by package_type
- render file names as <a href download> when the type is downloadable
- fetch the repo package_type on the Objects page as the modularity hook
- enable rpm via the yum files route /api/v2/remotes/<repo>/files/<path>
benvin merged commit f6b0afc5d6 into master 2026-07-25 14:15:26 +10:00
benvin deleted branch benvin/ui-download-links 2026-07-25 14:15:26 +10:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/artifactapi#106