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 "../../application/advanced/volumes/add-volumes"; import { DeleteVolume } from "../../application/advanced/volumes/delete-volume"; import { UpdateVolume } from "../../application/advanced/volumes/update-volume"; interface Props { postgresId: string; } export const ShowVolumes = ({ postgresId }: Props) => { const { data, refetch } = api.postgres.one.useQuery( { postgresId, }, { enabled: !!postgresId }, ); return (
Volumes If you want to persist data in this postgres database 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}
)} {mount.type === "bind" && (
Host Path {mount.hostPath}
)}
Mount Path {mount.mountPath}
))}
)}
); };