feat(backups): add storage management tab
All checks were successful
Deploy to Production / Trigger production update (push) Successful in 8s

New Storages tab in Backups: list cluster storages, add (dir/nfs/cifs/pbs
with type-specific fields), edit content/nodes, delete, and view native PVE
vzdump backup schedules — all over the previously-unused storage CRUD and
proxmox-jobs endpoints.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 18:48:35 +05:00
parent e79f9ea24c
commit dc95d39465
5 changed files with 410 additions and 0 deletions

View File

@@ -16,6 +16,41 @@ export function useBackupStorages(serverId: number) {
});
}
export function useProxmoxBackupJobs(serverId: number) {
return useQuery({
queryKey: backupKeys.proxmoxJobs(serverId),
queryFn: () => apiClient.get<{ jobs: unknown[]; server_name?: string; error?: string }>(`/proxmox/api/backups/proxmox-jobs/${serverId}`),
enabled: serverId > 0,
});
}
export function useCreateStorage(serverId: number) {
const qc = useQueryClient();
return useMutation({
mutationFn: (data: Record<string, unknown>) =>
apiClient.post(`/proxmox/api/backups/storages/${serverId}`, data),
onSuccess: () => qc.invalidateQueries({ queryKey: backupKeys.storages(serverId) }),
});
}
export function useUpdateStorage(serverId: number) {
const qc = useQueryClient();
return useMutation({
mutationFn: ({ storage, ...data }: { storage: string } & Record<string, unknown>) =>
apiClient.put(`/proxmox/api/backups/storages/${serverId}/${storage}`, data),
onSuccess: () => qc.invalidateQueries({ queryKey: backupKeys.storages(serverId) }),
});
}
export function useDeleteStorage(serverId: number) {
const qc = useQueryClient();
return useMutation({
mutationFn: (storage: string) =>
apiClient.delete(`/proxmox/api/backups/storages/${serverId}/${storage}`),
onSuccess: () => qc.invalidateQueries({ queryKey: backupKeys.storages(serverId) }),
});
}
export function useBackupList(serverId: number, node: string, storage: string) {
return useQuery({
queryKey: backupKeys.list(serverId, node, storage),