Skip to content

Commit 84dd62a

Browse files
authored
Add IP address column and cell to container table
1 parent 4461315 commit 84dd62a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

frontend/src/routes/(app)/containers/container-table.svelte

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@
262262
{ accessorKey: 'image', title: m.common_image(), sortable: !groupByProject, cell: ImageCell },
263263
{ accessorKey: 'imageId', id: 'update', title: m.containers_update_column(), cell: UpdateCell },
264264
{ accessorKey: 'status', title: m.common_status() },
265+
{ accessorKey: 'ipaddress', title: m.containers_ip_address(), cell: IPAddressCell },
265266
{ accessorKey: 'ports', title: m.common_ports(), cell: PortsCell },
266267
{ accessorKey: 'created', title: m.common_created(), sortable: !groupByProject, cell: CreatedCell }
267268
] satisfies ColumnSpec<ContainerSummaryDto>[]);
@@ -318,6 +319,17 @@
318319
});
319320
</script>
320321

322+
{#snippet IPAddressCell({ item }: { item: ContainerSummaryDto })}
323+
{#if item.networkSettings?.networks && Object.keys(item.networkSettings.networks).length > 0}
324+
{@const firstNetwork = Object.values(item.networkSettings.networks)[0] as NetworkConfig}
325+
<span class="font-mono text-sm">
326+
{firstNetwork?.IPAddress ?? firstNetwork?.ipAddress ?? m.common_na()}
327+
</span>
328+
{:else}
329+
<span class="text-sm">{m.common_na()}</span>
330+
{/if}
331+
{/snippet}
332+
321333
{#snippet PortsCell({ item }: { item: ContainerSummaryDto })}
322334
<PortBadge ports={item.ports ?? []} />
323335
{/snippet}

0 commit comments

Comments
 (0)