diff --git a/app/react/docker/containers/ListView/ContainersDatatable/columns/created.tsx b/app/react/docker/containers/ListView/ContainersDatatable/columns/created.tsx index b226f5404..025243bad 100644 --- a/app/react/docker/containers/ListView/ContainersDatatable/columns/created.tsx +++ b/app/react/docker/containers/ListView/ContainersDatatable/columns/created.tsx @@ -2,8 +2,11 @@ import { isoDateFromTimestamp } from '@/portainer/filters/filters'; import { columnHelper } from './helper'; -export const created = columnHelper.accessor('Created', { - header: 'Created', - id: 'created', - cell: ({ getValue }) => isoDateFromTimestamp(getValue()), -}); +export const created = columnHelper.accessor( + (row) => isoDateFromTimestamp(row.Created), + { + header: 'Created', + id: 'created', + cell: ({ row }) => isoDateFromTimestamp(row.original.Created), + } +); diff --git a/app/react/docker/containers/ListView/ContainersDatatable/columns/ports.tsx b/app/react/docker/containers/ListView/ContainersDatatable/columns/ports.tsx index 71f7b21a3..0b4f280cc 100644 --- a/app/react/docker/containers/ListView/ContainersDatatable/columns/ports.tsx +++ b/app/react/docker/containers/ListView/ContainersDatatable/columns/ports.tsx @@ -2,7 +2,7 @@ import _ from 'lodash'; import { ExternalLink } from 'lucide-react'; import { CellContext } from '@tanstack/react-table'; -import type { DockerContainer, Port } from '@/react/docker/containers/types'; +import type { DockerContainer } from '@/react/docker/containers/types'; import { Icon } from '@@/Icon'; @@ -10,14 +10,20 @@ import { useRowContext } from '../RowContext'; import { columnHelper } from './helper'; -export const ports = columnHelper.accessor('Ports', { - header: 'Published Ports', - id: 'ports', - cell: PortsCell, -}); +export const ports = columnHelper.accessor( + (row) => + _.uniqBy(row.Ports, 'public') + .map((port) => `${port.public}:${port.private}`) + .join(','), + { + header: 'Published Ports', + id: 'ports', + cell: Cell, + } +); -function PortsCell({ getValue }: CellContext) { - const ports = getValue(); +function Cell({ row }: CellContext) { + const ports = row.original.Ports; const { environment } = useRowContext();