Phase 16: volumes page, multi-host (0.17.0)
Adds a dedicated Volumes page (sidebar) with per-host sections (local + each
online agent), matching the Networks/Images layout. Lists volumes with driver,
owning stack, in-use containers and mountpoint; admins can delete (with an
in-use warning + force option) and prune unused, plus an "only unused" filter.
- agent_app.py: /agent/volumes (list/delete with in-use 409 guard/prune)
reusing volume_service.
- routers/agents.py: proxy routes /api/agents/{id}/volumes/* (audit-logged
delete/prune).
- Frontend: volumesApi list/remove/prune take an optional agentId; new
pages/Volumes.tsx (VolumesSection per host) + sidebar entry + /volumes route.
The volume wizard (generate-yaml/host paths) stays local and unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
19cc92dc94
commit
8f6e354b3f
@@ -1,13 +1,17 @@
|
||||
import api from "./client";
|
||||
import type { HostPathResult, VolumeInfo } from "@/types";
|
||||
|
||||
// Base path for the local host or, when agentId is given, a remote agent.
|
||||
const base = (agentId?: number) =>
|
||||
agentId != null ? `/api/agents/${agentId}/volumes` : "/api/volumes";
|
||||
|
||||
export const volumesApi = {
|
||||
list: () => api.get<VolumeInfo[]>("/api/volumes").then((r) => r.data),
|
||||
orphaned: () =>
|
||||
api.get<VolumeInfo[]>("/api/volumes/orphaned").then((r) => r.data),
|
||||
remove: (name: string, force = false) =>
|
||||
api.delete(`/api/volumes/${name}?force=${force}`).then((r) => r.data),
|
||||
prune: () => api.post("/api/volumes/prune").then((r) => r.data),
|
||||
list: (agentId?: number) =>
|
||||
api.get<VolumeInfo[]>(base(agentId)).then((r) => r.data),
|
||||
remove: (name: string, force = false, agentId?: number) =>
|
||||
api.delete(`${base(agentId)}/${name}?force=${force}`).then((r) => r.data),
|
||||
prune: (agentId?: number) =>
|
||||
api.post<{ VolumesDeleted: string[] | null }>(`${base(agentId)}/prune`).then((r) => r.data),
|
||||
generateYaml: (spec: Record<string, unknown>) =>
|
||||
api
|
||||
.post<{ yaml: string }>("/api/volumes/generate-yaml", spec)
|
||||
|
||||
Reference in New Issue
Block a user