import { AlertBlock } from "@/components/shared/alert-block"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { api } from "@/utils/api"; import { Rss } from "lucide-react"; import React from "react"; import { AddPort } from "./add-port"; import { DeletePort } from "./delete-port"; import { UpdatePort } from "./update-port"; interface Props { applicationId: string; } export const ShowPorts = ({ applicationId }: Props) => { const { data } = api.application.one.useQuery( { applicationId, }, { enabled: !!applicationId }, ); return (
Ports the ports allows you to expose your application to the internet
{data && data?.ports.length > 0 && ( Add Port )}
{data?.ports.length === 0 ? (
No ports configured Add Port
) : (
Please remember to click Redeploy after adding, editing, or deleting the ports to apply the changes.
{data?.ports.map((port) => (
Published Port {port.publishedPort}
Target Port {port.targetPort}
Protocol {port.protocol.toUpperCase()}
))}
)}
); };