Volumes page: on-demand volume sizes (0.18.0)

Docker's volume list has no size, so add a "Compute sizes" button that runs
`docker system df` (via client.df()) and shows per-volume size in a new Size
column. The df walk is expensive (seconds), so results are cached ~60s and
loaded on demand instead of on every poll.

- volume_service.volume_sizes(force) with a 60s TTL cache; GET /api/volumes/sizes
  + agent /agent/volumes/sizes + proxy /api/agents/{id}/volumes/sizes.
- Frontend: volumesApi.sizes(force, agentId); Volumes page gained a Size column
  and a Compute sizes button (per host) that triggers the lookup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
menzelj
2026-06-08 13:07:07 +00:00
co-authored by Claude Opus 4.8
parent 8f6e354b3f
commit 56450efd82
9 changed files with 96 additions and 5 deletions
+6 -1
View File
@@ -60,7 +60,7 @@ def _map_docker(exc: DockerError):
raise HTTPException(status_code=code, detail=exc.detail or exc.error)
raise exc # falls through to the global 502 DockerError handler
AGENT_VERSION = "0.17.0"
AGENT_VERSION = "0.18.0"
# --------------------------------------------------------------------------- #
@@ -447,6 +447,11 @@ def list_volumes() -> list[dict]:
return volume_service.list_volumes()
@app.get("/agent/volumes/sizes", dependencies=[Depends(verify_token)])
def volume_sizes(force: bool = Query(False)) -> dict:
return volume_service.volume_sizes(force=force)
@app.delete("/agent/volumes/{name}", dependencies=[Depends(verify_token)])
def delete_volume(name: str, force: bool = Query(False)) -> dict:
vols = {v["name"]: v for v in volume_service.list_volumes()}