diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index 92af193..e07c536 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -239,4 +239,21 @@ export interface SystemConfig { document_metadata_path: string; } +export interface ServiceHealth { + status: 'ok' | 'error' | 'unknown'; + error?: string; +} + +export interface SystemHealth { + milvus: ServiceHealth & { + connected?: boolean; + collection_name?: string; + num_entities?: number; + }; + minio: ServiceHealth & { connected?: boolean }; + bm25: { available: boolean }; + reranker: { enabled: boolean; model?: string | null }; + sessions: { active: number; max: number }; +} + export { API_BASE_URL }; diff --git a/frontend/src/api/status.ts b/frontend/src/api/status.ts index 87fbcd4..d81026a 100644 --- a/frontend/src/api/status.ts +++ b/frontend/src/api/status.ts @@ -1,4 +1,4 @@ -import { fetchAPI, type SystemConfig, type SystemStats } from './index'; +import { fetchAPI, type SystemConfig, type SystemHealth, type SystemStats } from './index'; export async function getSystemStats(): Promise { return fetchAPI('/status/stats'); @@ -8,8 +8,8 @@ export async function getSystemConfig(): Promise { return fetchAPI('/status/config'); } -export async function getMilvusHealth(): Promise<{ connected: boolean; collections: string[] }> { - return fetchAPI('/status/milvus/health'); +export async function getSystemHealth(): Promise { + return fetchAPI('/status/health'); } -export type { SystemConfig, SystemStats }; +export type { SystemConfig, SystemHealth, SystemStats };