diff --git a/apps/dokploy/components/dashboard/application/domains/columns.tsx b/apps/dokploy/components/dashboard/application/domains/columns.tsx index 17a1ff1a0..cd8254aa0 100644 --- a/apps/dokploy/components/dashboard/application/domains/columns.tsx +++ b/apps/dokploy/components/dashboard/application/domains/columns.tsx @@ -6,6 +6,7 @@ import { Loader2, PenBoxIcon, RefreshCw, + Server, Trash2, XCircle, } from "lucide-react"; @@ -36,6 +37,8 @@ interface ColumnsProps { handleDeleteDomain: (domainId: string) => Promise; isDeleting: boolean; serverIp?: string; + canCreateDomain: boolean; + canDeleteDomain: boolean; } export const createColumns = ({ @@ -46,7 +49,27 @@ export const createColumns = ({ handleDeleteDomain, isDeleting, serverIp, + canCreateDomain, + canDeleteDomain, }: ColumnsProps): ColumnDef[] => [ + ...(type === "compose" + ? [ + { + accessorKey: "serviceName", + header: "Service", + cell: ({ row }: { row: { getValue: (key: string) => unknown } }) => { + const serviceName = row.getValue("serviceName") as string | null; + if (!serviceName) return null; + return ( + + + {serviceName} + + ); + }, + } satisfies ColumnDef, + ] + : []), { accessorKey: "host", header: ({ column }) => { @@ -63,19 +86,14 @@ export const createColumns = ({ cell: ({ row }) => { const domain = row.original; return ( - - - + + {domain.host} + + ); }, }, @@ -115,26 +133,24 @@ export const createColumns = ({ return {port}; }, }, + { + accessorKey: "customEntrypoint", + header: "Entrypoint", + cell: ({ row }) => { + const entrypoint = row.getValue("customEntrypoint") as string | null; + if (!entrypoint) return -; + return
{entrypoint}
; + }, + }, { accessorKey: "https", header: "Protocol", cell: ({ row }) => { const https = row.getValue("https") as boolean; return ( - - - - - {https ? "HTTPS" : "HTTP"} - - - -

- {https ? "Secure HTTPS connection" : "Standard HTTP connection"} -

-
-
-
+ + {https ? "HTTPS" : "HTTP"} + ); }, }, @@ -209,6 +225,28 @@ export const createColumns = ({ ); }, }, + { + accessorKey: "createdAt", + header: ({ column }) => { + return ( + + ); + }, + cell: ({ row }) => { + const createdAt = row.getValue("createdAt") as string; + return ( +
+ {new Date(createdAt).toLocaleDateString()} +
+ ); + }, + }, { id: "actions", header: "Actions", @@ -228,32 +266,36 @@ export const createColumns = ({ serverIp={serverIp} /> )} - - + + )} + {canDeleteDomain && ( + { + await handleDeleteDomain(domain.domainId); + }} > - - - - { - await handleDeleteDomain(domain.domainId); - }} - > - - + + + )} ); }, diff --git a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx index 0db95d358..bde48ceaf 100644 --- a/apps/dokploy/components/dashboard/application/domains/show-domains.tsx +++ b/apps/dokploy/components/dashboard/application/domains/show-domains.tsx @@ -104,7 +104,12 @@ export const ShowDomains = ({ id, type }: Props) => { const [validationStates, setValidationStates] = useState( {}, ); - const [viewMode, setViewMode] = useState<"grid" | "table">("grid"); + const [viewMode, setViewMode] = useState<"grid" | "table">(() => { + if (typeof window !== "undefined") { + return (localStorage.getItem("domains-view-mode") as "grid" | "table") ?? "grid"; + } + return "grid"; + }); const [sorting, setSorting] = useState([]); const [columnFilters, setColumnFilters] = useState([]); const [columnVisibility, setColumnVisibility] = useState({}); @@ -193,6 +198,8 @@ export const ShowDomains = ({ id, type }: Props) => { handleDeleteDomain, isDeleting: isRemoving, serverIp: application?.server?.ipAddress?.toString() || ip?.toString(), + canCreateDomain, + canDeleteDomain, }); const table = useReactTable({ @@ -231,9 +238,11 @@ export const ShowDomains = ({ id, type }: Props) => {