Skip to content

Commit

Permalink
Merge pull request #1516 from headlamp-k8s/endpoint-address-render-fix
Browse files Browse the repository at this point in the history
frontend: Fixes endpoint address renders
  • Loading branch information
joaquimrocha authored Nov 3, 2023
2 parents c2f8eaa + f0f24f2 commit ca19998
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion frontend/src/components/service/Details.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { InlineIcon } from '@iconify/react';
import { Box } from '@material-ui/core';
import _ from 'lodash';
import React from 'react';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -100,7 +101,13 @@ export default function ServiceDetails() {
},
{
label: t('translation|Addresses'),
getter: endpoint => endpoint.getAddressesText(),
getter: endpoint => (
<Box display="flex" flexDirection="column">
{endpoint.getAddresses().map((address: string) => (
<ValueLabel>{address}</ValueLabel>
))}
</Box>
),
},
]}
reflectInURL="endpoints"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/k8s/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Endpoints extends makeKubeObject<KubeEndpoint>('endpoint') {
}

getAddressesText() {
this.getAddresses().join(', ');
return this.getAddresses().join(', ');
}

getAddresses() {
Expand Down

0 comments on commit ca19998

Please sign in to comment.