Skip to content

Commit c1d177e

Browse files
committed
feat: Display domain on cluster card
1 parent 05d6faf commit c1d177e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/features/clusters/components/ClusterCard.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,10 @@ export function ClusterCard({ cluster }: { cluster: Cluster }) {
122122
});
123123
}, [router, cluster.organizationId, cluster.id, cluster.name, terminateCluster, isSelfManaged, queryClient]);
124124

125+
const clusterFQDN = cluster.domains?.[0]?.domain || cluster.fqdn;
125126
const [onCopyFQDNClick, onCopyAPIClick] = useCopyToClipboard(
126-
`${cluster.fqdn}`,
127-
`https://${cluster.fqdn}`,
127+
`${clusterFQDN}`,
128+
`https://${clusterFQDN}`,
128129
);
129130

130131
const menuItems = [
@@ -194,10 +195,10 @@ export function ClusterCard({ cluster }: { cluster: Cluster }) {
194195
<Card className="relative h-full justify-between">
195196
<CardHeader>
196197
<CardDescription className="flex items-center justify-between">
197-
{cluster.fqdn
198+
{clusterFQDN
198199
? (
199200
<>
200-
<span className="truncate max-w-48">{cluster.fqdn}</span>
201+
<span className="truncate max-w-48">{clusterFQDN}</span>
201202
<CopyIcon onClick={onCopyFQDNClick} size={16} className="cursor-pointer" />
202203
<span className="grow"></span>
203204
</>

src/integrations/api/api.patch.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export interface Cluster extends SchemaCluster {
9696
// TODO: Can we return enums from the server to make this easier?
9797
status?: string | 'PROVISIONING' | 'UPDATING' | 'RUNNING' | 'TERMINATED' | 'FAILED';
9898
domainIds?: string[];
99+
domains?: Array<{ domain: string }>;
99100
}
100101

101102
export interface InstanceDatabaseMap {

0 commit comments

Comments
 (0)