feat: Volumes and Images pages #6
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/1-volumes-images"
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?
Closes #1, closes #2.
Replaces the Volumes and Images placeholders with real pages in the Containers style: a searchable list split into In Use / Unused, and a detail pane built from
InfoSection/InfoRow.Volumes
Images
<none>with their short id.docker rmidoes without-f), Delete Unused (dangling only, or tick Also delete unused tagged images), Copy Name / Copy ID.How it works
src/docker.rs: a resource watcher (started the first time the window refreshes) lists volumes and images, re-reads on Dockerimage/volumeevents, and every 10 s as a fallback. Actions areasync fns that return a user-facing outcome.df()expects aVolumesDiskUsagekey that current engines don't send (they answerVolumes, orVolumeUsagewhen verbose), so sizes come from a rawGET /system/df?type=volumeover the engine's Unix socket (tokionet, no new crates). Remote (tcp://) engines just show no size. Re-read when volumes change or every 60 s, since it's slow on big hosts.src/window/data.rsshapes both lists to JSON (including which containers use each);bridge.rsaddsvolumes_json,images_json,resources_error,image_inspect_json, the action invokables and aresourceActionFinishedsignal. Success shows a toast; a Docker error shows an alert with Docker's message.VolumesPage,ImagesPage, sharedResourceList/ResourceRow/ResourceDetail/ResourceIcon, a generic confirm/alert dialog and a New Volume dialog inMain.qml. The context-menu items moved fromContainerListintoMenuEntry/MenuDivider/ContextMenuso all lists share them. Image tiles use the same color as their containers' avatars.Also in here
fix: build with Qt 6.8: Qt 6.8'sqmlcachegen(Debian 13) rejectsp.public/p.privateas reserved words, somaindidn't build there. The port fields are nowhostPort/containerPort. Separate commit.Tried
Built with
cargo build(no new warnings;cargo clippyonly shows the 4 existing warnings),cargo test(adds 2 unit tests for the df parsing and byte formatting), and ran the app against a sandboxdocker:dinddaemon with example data (ashopcompose project with postgres/redis/nginx, a few extra volumes and images): listed, searched, opened details, created a volume, deleted a volume and an image, pruned both, hit the in-use refusal, and forced a real Docker refusal (a container grabbed the volume while the confirm was open) to check the error alert.Screenshots (example data)
Volumes —

shop_pgdataselected, used by the compose project'sdbservice:Images —

nginxselected, with its config, env and the container using it:Delete Unused confirm with the option ticked:

A Docker refusal surfacing as an alert (a container started using the volume while the confirm was open):

Icons on my test desktop come from its own theme (not Breeze), so a couple of glyphs differ from what you'll see on Plasma.
Review from Nye: Approve (posted by Upper Wolfjaw, since Nye's token can't comment on this repo)
I built
08c5574on Debian 13 (Qt 6.8.2) and rankrane --showagainst a docker:dind sandbox with a compose project, named and anonymous volumes, and a 3-tag image that includes a registry:port tag. I checked the Volumes and Images lists, sections and sizes, search (it matches tags other than the first), the detail panes, the in-use refusal alert, both prune dialogs (anonymous-only and include named), deleting a multi-tag image (all 3 tags gone), the Used By link back to Containers, and the Containers page with its port badge and localhost:8080 link.cargo testpasses, and all QML compiles with qmlcachegen 6.8. F1 (Qt 6.8 build) is fixed byfcbe8a4.Two notes that don't block it:
remove_imageuntags one tag at a time, so if the last untag fails (say a container appeared after the list refreshed), the earlier tags are already gone. Only a race can cause it, since the UI refuses images in use.