import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { api } from "@/utils/api"; import { Package } from "lucide-react"; import React from "react"; import { AddVolumes } from "../../application/advanced/volumes/add-volumes"; import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; import { UpdateVolume } from "../../application/advanced/volumes/update-volume"; interface Props { composeId: string; } export const ShowVolumesCompose = ({ composeId }: Props) => { const { data, refetch } = api.compose.one.useQuery( { composeId, }, { enabled: !!composeId }, ); return (
Volumes If you want to persist data in this compose use the following config to setup the volumes
{data && data?.mounts.length > 0 && ( Add Volume )}
{data?.mounts.length === 0 ? (
No volumes/mounts configured Add Volume
) : (
Please remember to click Redeploy after adding, editing, or deleting a mount to apply the changes.
{data?.mounts.map((mount) => (
Mount Type {mount.type.toUpperCase()}
{mount.type === "volume" && (
Volume Name {mount.volumeName}
)} {mount.type === "file" && ( <>
Content {mount.content}
File Path {mount.filePath}
)} {mount.type === "bind" && (
Host Path {mount.hostPath}
)}
Mount Path {mount.mountPath}
))}
)}
); };