1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-30 10:49:40 +02:00

feat: kubernets service - display external hostname (#486)

This commit is contained in:
Steven Kang 2025-03-12 22:34:00 +13:00 committed by GitHub
parent 28b222fffa
commit 798fa2396a
4 changed files with 45 additions and 5 deletions

View file

@ -0,0 +1,38 @@
import { CellContext } from '@tanstack/react-table';
import { ServiceRowData } from '../types';
import { columnHelper } from './helper';
export const externalHost = columnHelper.accessor(
(row) => {
if (row.Type === 'ExternalName') {
return row.ExternalName || '-';
}
return (
row.IngressStatus?.map((status) => status.Hostname)
.filter(Boolean)
.join(' ,') || '-'
);
},
{
header: 'External Host',
id: 'externalHost',
cell: Cell,
}
);
function Cell({ row }: CellContext<ServiceRowData, string>) {
if (row.original.Type === 'ExternalName') {
return <div>{row.original.ExternalName || '-'}</div>;
}
return (
<div>
{row.original.IngressStatus?.map((status) => status.Hostname)
.filter(Boolean)
.join(' ,') || '-'}
</div>
);
}