From f1a01f5ba49feb8e078284df420137535dadaee7 Mon Sep 17 00:00:00 2001 From: Paul Payne Date: Mon, 13 Oct 2025 12:23:21 +0000 Subject: [PATCH] Fix cluster service page. --- src/components/ClusterServicesComponent.tsx | 22 ++++++++++++++------- src/services/api/types/service.ts | 3 ++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/components/ClusterServicesComponent.tsx b/src/components/ClusterServicesComponent.tsx index fa9cc6a..4df553e 100644 --- a/src/components/ClusterServicesComponent.tsx +++ b/src/components/ClusterServicesComponent.tsx @@ -24,6 +24,7 @@ export function ClusterServicesComponent() { switch (status) { case 'running': case 'ready': + case 'deployed': return ; case 'error': return ; @@ -36,19 +37,23 @@ export function ClusterServicesComponent() { }; const getStatusBadge = (service: Service) => { - const status = service.status?.status || (service.deployed ? 'deployed' : 'available'); + // Handle both old format (status as string) and new format (status as object) + const status = typeof service.status === 'string' ? service.status : + service.status?.status || (service.deployed ? 'deployed' : 'available'); const variants: Record = { + 'not-deployed': 'secondary', available: 'secondary', deploying: 'default', installing: 'default', running: 'success', ready: 'success', + deployed: 'success', error: 'destructive', - deployed: 'outline', }; const labels: Record = { + 'not-deployed': 'Not Deployed', available: 'Available', deploying: 'Deploying', installing: 'Installing', @@ -59,7 +64,7 @@ export function ClusterServicesComponent() { }; return ( - + {labels[status] || status} ); @@ -210,16 +215,18 @@ export function ClusterServicesComponent() { {service.version} )} - {getStatusIcon(service.status?.status)} + {getStatusIcon(typeof service.status === 'string' ? service.status : service.status?.status)}

{service.description}

- {service.status?.message && ( + {typeof service.status === 'object' && service.status?.message && (

{service.status.message}

)}
{getStatusBadge(service)} - {!service.deployed && ( + {((typeof service.status === 'string' && service.status === 'not-deployed') || + (!service.status || service.status === 'not-deployed') || + (typeof service.status === 'object' && service.status?.status === 'not-deployed')) && ( )} - {service.deployed && ( + {((typeof service.status === 'string' && service.status === 'deployed') || + (typeof service.status === 'object' && service.status?.status === 'deployed')) && (