From 072758df9c0c71e6de52d4ad4e95b0d89b756525 Mon Sep 17 00:00:00 2001 From: Storme-bit Date: Fri, 17 Apr 2026 23:35:31 -0700 Subject: [PATCH] health panel implementation --- .../src/components/SettingsView.jsx | 94 ++++++++++++++++++- 1 file changed, 91 insertions(+), 3 deletions(-) diff --git a/packages/chat-client/src/components/SettingsView.jsx b/packages/chat-client/src/components/SettingsView.jsx index c07a935..20ecd29 100644 --- a/packages/chat-client/src/components/SettingsView.jsx +++ b/packages/chat-client/src/components/SettingsView.jsx @@ -1,5 +1,6 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect, useCallback } from 'react'; import { useSettings } from '../hooks/useSettings'; +import { getServiceHealth } from '../api/orchestration'; export default function SettingsView({ onNavigate }) { const { settings, saveSetting, saving } = useSettings(); @@ -52,8 +53,16 @@ export default function SettingsView({ onNavigate }) { - } /> - v0.1.0} /> + } + /> + v0.1.0} + /> @@ -149,4 +158,83 @@ function SettingsRow({ label, description, action }) { function ComingSoon() { return Coming soon; +} + +function ServiceHealth() { + const [services, setServices] = useState(null); + const [loading, setLoading] = useState(false); + const [lastChecked, setLastChecked] = useState(null); + + const check = useCallback(async () => { + setLoading(true); + try { + setServices(await getServiceHealth()); + setLastChecked(new Date()); + } catch (err) { + console.error('[ServiceHealth]', err.message); + } finally { + setLoading(false); + } + }, []); + + return ( +
+
+ + {lastChecked && ( + + {lastChecked.toLocaleTimeString()} + + )} +
+ + {services && ( +
+ {services.map((svc, i) => ( +
+ {/* Status dot */} +
+ + {/* Label */} + + {svc.label} + + + {/* Detail — show model for inference, nothing extra for others */} + + {svc.key === 'inference' && svc.detail?.model + ? svc.detail.model + : svc.status === 'unreachable' ? 'Unreachable' : ''} + + + {/* Latency */} + + {svc.latency}ms + +
+ ))} +
+ )} +
+ ); } \ No newline at end of file