diff --git a/apps/studio/components/interfaces/Home/ServiceStatus.tsx b/apps/studio/components/interfaces/Home/ServiceStatus.tsx index 418ee8e0bab..600ac7b57d1 100644 --- a/apps/studio/components/interfaces/Home/ServiceStatus.tsx +++ b/apps/studio/components/interfaces/Home/ServiceStatus.tsx @@ -19,8 +19,17 @@ const ServiceStatus = () => { const project = useSelectedProject() const [open, setOpen] = useState(false) - const { projectAuthAll: authEnabled, projectEdgeFunctionAll: edgeFunctionsEnabled } = - useIsFeatureEnabled(['project_auth:all', 'project_edge_function:all']) + const { + projectAuthAll: authEnabled, + projectEdgeFunctionAll: edgeFunctionsEnabled, + realtimeAll: realtimeEnabled, + projectStorageAll: storageEnabled, + } = useIsFeatureEnabled([ + 'project_auth:all', + 'project_edge_function:all', + 'realtime:all', + 'project_storage:all', + ]) const isBranch = project?.parentRef !== project?.ref @@ -40,23 +49,65 @@ const ServiceStatus = () => { const storageStatus = status?.find((service) => service.name === 'storage') // [Joshen] Need individual troubleshooting docs for each service eventually for users to self serve - const services = [ + const services: { + name: string + error?: string + docsUrl?: string + isLoading: boolean + isSuccess?: boolean + }[] = [ { name: 'Database', - docsUrls: undefined, + error: undefined, + docsUrl: undefined, isLoading: isLoadingPostgres, isSuccess: isSuccessPostgres, }, - { name: 'PostgREST', docsUrls: undefined, isLoading, isSuccess: restStatus?.healthy }, + { + name: 'PostgREST', + error: restStatus?.error, + docsUrl: undefined, + isLoading, + isSuccess: restStatus?.healthy, + }, ...(authEnabled - ? [{ name: 'Auth', docsUrls: undefined, isLoading, isSuccess: authStatus?.healthy }] + ? [ + { + name: 'Auth', + error: authStatus?.error, + docsUrl: undefined, + isLoading, + isSuccess: authStatus?.healthy, + }, + ] + : []), + ...(realtimeEnabled + ? [ + { + name: 'Realtime', + error: realtimeStatus?.error, + docsUrl: undefined, + isLoading, + isSuccess: realtimeStatus?.healthy, + }, + ] + : []), + ...(storageEnabled + ? [ + { + name: 'Storage', + error: storageStatus?.error, + docsUrl: undefined, + isLoading, + isSuccess: storageStatus?.healthy, + }, + ] : []), - { name: 'Realtime', docsUrls: undefined, isLoading, isSuccess: realtimeStatus?.healthy }, - // { name: 'Storage', docsUrls: undefined, isLoading, isSuccess: storageStatus?.healthy }, ...(edgeFunctionsEnabled ? [ { name: 'Edge Functions', + error: undefined, docsUrl: 'https://supabase.com/docs/guides/functions/troubleshooting', isLoading, isSuccess: edgeFunctionsStatus?.healthy, @@ -69,50 +120,54 @@ const ServiceStatus = () => { const allServicesOperational = services.every((service) => service.isSuccess) return ( - - - - - - {services.map((service) => ( -
+ + + + + + {services.map((service) => ( +
+
+

{service.name}

+

+ {service.isLoading + ? 'Checking status' + : service.isSuccess + ? 'No issues' + : 'Unable to connect'} +

+
+ {service.isLoading ? ( + + ) : service.isSuccess ? ( + + ) : ( + + )}
- {service.isLoading ? ( - - ) : service.isSuccess ? ( - - ) : ( - - )} -
- ))} -
-
+ ))} + + + ) }