fix: update volume backup components for improved functionality

- Refactored HandleVolumeBackups to use consistent naming for mount items.
- Added an AlertBlock to RestoreVolumeBackups to inform users about potential volume name conflicts.
- Updated mount retrieval logic in the mount router to enhance accuracy and efficiency in fetching volume mounts.
This commit is contained in:
Mauricio Siu
2025-07-01 23:48:19 -06:00
parent bddb07898e
commit b272f01a18
3 changed files with 14 additions and 14 deletions

View File

@@ -550,11 +550,8 @@ export const HandleVolumeBackups = ({
</FormControl>
<SelectContent>
{mounts?.map((mount) => (
<SelectItem
key={mount.mountId}
value={mount.volumeName || ""}
>
{mount.volumeName}
<SelectItem key={mount.Name} value={mount.Name || ""}>
{mount.Name}
</SelectItem>
))}
</SelectContent>

View File

@@ -44,6 +44,7 @@ import { toast } from "sonner";
import { z } from "zod";
import { type LogLine, parseLogs } from "../../docker/logs/utils";
import { formatBytes } from "../../database/backups/restore-backup";
import { AlertBlock } from "@/components/shared/alert-block";
interface Props {
id: string;
@@ -169,6 +170,9 @@ export const RestoreVolumeBackups = ({ id, type, serverId }: Props) => {
<DialogDescription>
Select a destination and search for volume backup files
</DialogDescription>
<AlertBlock>
Make sure the volume name is not being used by another container.
</AlertBlock>
</DialogHeader>
<Form {...form}>