feat(ui): direct-download links for downloadable local repo files #106
Reference in New Issue
Block a user
Delete Branch "benvin/ui-download-links"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
downloadableTypescapability map (ui/src/components/downloads.ts) keyed bypackage_type; each entry builds the direct-download URL for a file.rpm, pointing at the yum files route/api/v2/remotes/<repo>/files/<path>(path-segment-encoded).<a href download>links when the repo's type is downloadable, and as plain text otherwise.package_typeon 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
hrefcarries no credentials. Adding a future type is one entry indownloadableTypes.