diff --git a/frontend/src/components/Status.svelte b/frontend/src/components/Status.svelte index 60d0609..b9b080f 100644 --- a/frontend/src/components/Status.svelte +++ b/frontend/src/components/Status.svelte @@ -20,12 +20,12 @@

Services status:

{#if systemStatus} -

Orion

-

Postgres

-

Redis

+

Orion

+

Postgres

+

Redis

{:else}

Checking...

{/if}
- \ No newline at end of file + diff --git a/frontend/src/services/api.ts b/frontend/src/services/api.ts index 64c9582..9d056a4 100644 --- a/frontend/src/services/api.ts +++ b/frontend/src/services/api.ts @@ -21,10 +21,22 @@ export interface DatapointUpdate { description?: string; } +// Define the structure for individual service checks +interface ServiceCheck { + status: boolean; + latency: number; + latency_unit: string; + message: string | null; +} + +// Adjust the SystemStatus interface to match the new response structure export interface SystemStatus { - orion: boolean; - postgres: boolean; - redis: boolean; + overall_status: string; + checks: { + orion: ServiceCheck; + postgres: ServiceCheck; + redis: ServiceCheck; + }; } export const fetchData = async (): Promise => { @@ -102,6 +114,6 @@ export const getSystemStatus = async (): Promise => { if (!response.ok) { throw new Error(`Failed to get system status`); } - const responseData = await response.json(); + const responseData: SystemStatus = await response.json(); return responseData; -} +};