import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { api } from "@/utils/api"; import { AlertTriangle, Package } from "lucide-react"; import React from "react"; import { AddVolumes } from "./add-volumes"; import { DeleteVolume } from "./delete-volume"; import { UpdateVolume } from "./update-volume"; interface Props { applicationId: string; } export const ShowVolumes = ({ applicationId }: Props) => { const { data, refetch } = api.application.one.useQuery( { applicationId, }, { enabled: !!applicationId }, ); return (
Volumes If you want to persist data in this application 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}
))}
)}
); };