mirror of https://github.com/portainer/portainer
fix(docker/container): use nodeName to build links to networks used by containers (#12004)
parent
20de243299
commit
e2830019d7
@ -1,30 +1,36 @@
|
||||
import { buildExpandColumn } from '@@/datatables/expand-column';
|
||||
import { buildNameColumn } from '@@/datatables/buildNameColumn';
|
||||
import { buildNameColumnFromObject } from '@@/datatables/buildNameColumn';
|
||||
|
||||
import { TableNetwork } from './types';
|
||||
import { columnHelper } from './helper';
|
||||
import { actions } from './actions';
|
||||
import { buildActions } from './actions';
|
||||
|
||||
export const columns = [
|
||||
buildExpandColumn<TableNetwork>(),
|
||||
{
|
||||
...buildNameColumn<TableNetwork>('name', 'docker.networks.network'),
|
||||
header: 'Network',
|
||||
},
|
||||
columnHelper.accessor((item) => item.IPAddress || '-', {
|
||||
header: 'IP Address',
|
||||
id: 'ip',
|
||||
enableSorting: false,
|
||||
}),
|
||||
columnHelper.accessor((item) => item.Gateway || '-', {
|
||||
header: 'Gateway',
|
||||
id: 'gateway',
|
||||
enableSorting: false,
|
||||
}),
|
||||
columnHelper.accessor((item) => item.MacAddress || '-', {
|
||||
header: 'MAC Address',
|
||||
id: 'macAddress',
|
||||
enableSorting: false,
|
||||
}),
|
||||
actions,
|
||||
];
|
||||
export function buildColumns({ nodeName }: { nodeName?: string } = {}) {
|
||||
return [
|
||||
buildExpandColumn<TableNetwork>(),
|
||||
{
|
||||
...buildNameColumnFromObject<TableNetwork>({
|
||||
nameKey: 'name',
|
||||
path: 'docker.networks.network',
|
||||
linkParamsBuilder: () => ({ nodeName }),
|
||||
}),
|
||||
header: 'Network',
|
||||
},
|
||||
columnHelper.accessor((item) => item.IPAddress || '-', {
|
||||
header: 'IP Address',
|
||||
id: 'ip',
|
||||
enableSorting: false,
|
||||
}),
|
||||
columnHelper.accessor((item) => item.Gateway || '-', {
|
||||
header: 'Gateway',
|
||||
id: 'gateway',
|
||||
enableSorting: false,
|
||||
}),
|
||||
columnHelper.accessor((item) => item.MacAddress || '-', {
|
||||
header: 'MAC Address',
|
||||
id: 'macAddress',
|
||||
enableSorting: false,
|
||||
}),
|
||||
buildActions({ nodeName }),
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in new issue