Skip to content

Commit b3e5a28

Browse files
authored
fix: Don't show the go-to-console button until the cloud instance is ready (#1467)
1 parent bbc055b commit b3e5a28

File tree

2 files changed

+39
-26
lines changed

2 files changed

+39
-26
lines changed

www/src/components/overview/clusters/all/AllClustersTableCols.tsx

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,26 @@ const ColActions = columnHelper.accessor((instance) => instance, {
115115
const instance = getValue()
116116

117117
return (
118-
<Flex gap="small">
119-
<Button
120-
secondary
121-
small
122-
startIcon={<ConsoleIcon color={theme.colors['icon-default']} />}
123-
as={Link}
124-
to={sanitizeConsoleUrl(instance.consoleUrl)}
125-
target="_blank"
126-
rel="noopener noreferrer"
127-
onClick={(e) => e.stopPropagation()}
128-
>
129-
Go to Console
130-
</Button>
118+
<Flex
119+
gap="small"
120+
justify="flex-end"
121+
width="100%"
122+
>
123+
{(instance.type === CombinedClusterType.SelfHosted ||
124+
instance.status === ConsoleInstanceStatus.Provisioned) && (
125+
<Button
126+
secondary
127+
small
128+
startIcon={<ConsoleIcon />}
129+
as={Link}
130+
to={sanitizeConsoleUrl(instance.consoleUrl)}
131+
target="_blank"
132+
rel="noopener noreferrer"
133+
onClick={(e) => e.stopPropagation()}
134+
>
135+
Go to Console
136+
</Button>
137+
)}
131138
<IconFrame
132139
clickable
133140
tooltip="View instance details"

www/src/components/overview/clusters/plural-cloud/CloudInstanceTableCols.tsx

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,25 @@ const ColActions = columnHelper.accessor((instance) => instance, {
167167
const instance = getValue()
168168

169169
return (
170-
<Flex gap="small">
171-
<Button
172-
secondary
173-
small
174-
startIcon={<ConsoleIcon color={theme.colors['icon-default']} />}
175-
as={Link}
176-
to={sanitizeConsoleUrl(instance.url)}
177-
target="_blank"
178-
rel="noopener noreferrer"
179-
onClick={(e) => e.stopPropagation()}
180-
>
181-
Go to Console
182-
</Button>
170+
<Flex
171+
gap="small"
172+
justify="flex-end"
173+
width="100%"
174+
>
175+
{instance.status === ConsoleInstanceStatus.Provisioned && (
176+
<Button
177+
secondary
178+
small
179+
startIcon={<ConsoleIcon />}
180+
as={Link}
181+
to={sanitizeConsoleUrl(instance.url)}
182+
target="_blank"
183+
rel="noopener noreferrer"
184+
onClick={(e) => e.stopPropagation()}
185+
>
186+
Go to Console
187+
</Button>
188+
)}
183189
<IconFrame
184190
clickable
185191
tooltip="View instance details"

0 commit comments

Comments
 (0)