Skip to content

Commit

Permalink
Handle linking to unregistered hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
rtorrero committed Jun 21, 2023
1 parent 5594adb commit 7b77fb3
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions assets/js/components/ClusterDetails/ClusterDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import HostLink from '@components/HostLink';
import ChecksResultOverview from '@components/ClusterDetails/ChecksResultOverview';
import ProviderLabel from '@components/ProviderLabel';
import { getClusterName } from '@components/ClusterLink';
import { EOS_SETTINGS, EOS_CLEAR_ALL, EOS_PLAY_CIRCLE } from 'eos-icons-react';
import { EOS_SETTINGS, EOS_CLEAR_ALL, EOS_PLAY_CIRCLE, EOS_WARNING_OUTLINED } from 'eos-icons-react';

import { getCluster, getClusterHostIDs } from '@state/selectors/cluster';
import {
Expand All @@ -34,9 +34,21 @@ const siteDetailsConfig = {
{
title: 'Hostname',
key: '',
render: (_, hostData) => (
<HostLink hostId={hostData.hostId}>{hostData.name}</HostLink>
),
render: (_, hostData) => {
if (hostData.hostId) {
return (<HostLink hostId={hostData.hostId}>{hostData.name}</HostLink>);
}
return (
<span className="group flex items-center relative">
<EOS_WARNING_OUTLINED
size="base"
className="centered fill-yellow-500"
/>
<span className="ml-1 truncate max-w-[100px]">{hostData.name}</span>
<Tooltip tooltipText="Host currently not registered." width="w-52 -translate-x-1/3"/>
</span>
);
}
},
{ title: 'Role', key: 'hana_status' },
{
Expand Down

0 comments on commit 7b77fb3

Please sign in to comment.