mirror of https://github.com/portainer/portainer
fix(docker): search published ports EE-4856 (#8939)
parent
6ef53f0598
commit
8fa49d47f4
|
@ -2,8 +2,11 @@ import { isoDateFromTimestamp } from '@/portainer/filters/filters';
|
||||||
|
|
||||||
import { columnHelper } from './helper';
|
import { columnHelper } from './helper';
|
||||||
|
|
||||||
export const created = columnHelper.accessor('Created', {
|
export const created = columnHelper.accessor(
|
||||||
header: 'Created',
|
(row) => isoDateFromTimestamp(row.Created),
|
||||||
id: 'created',
|
{
|
||||||
cell: ({ getValue }) => isoDateFromTimestamp(getValue()),
|
header: 'Created',
|
||||||
});
|
id: 'created',
|
||||||
|
cell: ({ row }) => isoDateFromTimestamp(row.original.Created),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import _ from 'lodash';
|
||||||
import { ExternalLink } from 'lucide-react';
|
import { ExternalLink } from 'lucide-react';
|
||||||
import { CellContext } from '@tanstack/react-table';
|
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';
|
import { Icon } from '@@/Icon';
|
||||||
|
|
||||||
|
@ -10,14 +10,20 @@ import { useRowContext } from '../RowContext';
|
||||||
|
|
||||||
import { columnHelper } from './helper';
|
import { columnHelper } from './helper';
|
||||||
|
|
||||||
export const ports = columnHelper.accessor('Ports', {
|
export const ports = columnHelper.accessor(
|
||||||
header: 'Published Ports',
|
(row) =>
|
||||||
id: 'ports',
|
_.uniqBy(row.Ports, 'public')
|
||||||
cell: PortsCell,
|
.map((port) => `${port.public}:${port.private}`)
|
||||||
});
|
.join(','),
|
||||||
|
{
|
||||||
|
header: 'Published Ports',
|
||||||
|
id: 'ports',
|
||||||
|
cell: Cell,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
function PortsCell({ getValue }: CellContext<DockerContainer, Port[]>) {
|
function Cell({ row }: CellContext<DockerContainer, string>) {
|
||||||
const ports = getValue();
|
const ports = row.original.Ports;
|
||||||
|
|
||||||
const { environment } = useRowContext();
|
const { environment } = useRowContext();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue