From 8e2995264fb929d584b926baa8ab816387adcc8c Mon Sep 17 00:00:00 2001 From: aliang <1098486429@qq.com> Date: Tue, 5 Nov 2024 23:14:56 +0700 Subject: [PATCH] feat(ui): display error message for unreachable model (#3374) * feat(ui): display error message for unreachable model * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .../system/components/worker-card.tsx | 24 +++++++++++++++---- ee/tabby-ui/components/ui/icons.tsx | 11 ++++++++- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/ee/tabby-ui/app/(dashboard)/system/components/worker-card.tsx b/ee/tabby-ui/app/(dashboard)/system/components/worker-card.tsx index d98b148c15ef..9a480148af9c 100644 --- a/ee/tabby-ui/app/(dashboard)/system/components/worker-card.tsx +++ b/ee/tabby-ui/app/(dashboard)/system/components/worker-card.tsx @@ -7,6 +7,12 @@ import { cn } from '@/lib/utils' import { Button } from '@/components/ui/button' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { + HoverCard, + HoverCardContent, + HoverCardTrigger +} from '@/components/ui/hover-card' +import { + IconCircleHelp, IconRotate, IconSpinner, IconSquareActivity @@ -232,7 +238,7 @@ function HealthInfoView({ errorMessage?: string className?: string }) { - const [{ data, fetching, stale }, reexecuteQuery] = useQuery({ + const [{ data, fetching, stale, error }, reexecuteQuery] = useQuery({ query: testModelConnectionQuery, variables: { backend @@ -254,9 +260,19 @@ function HealthInfoView({ {connected ? (

Connected

) : ( -
- Unreachable -
+ + +
+ + Unreachable +
+
+ +
+ {error?.message || 'Failed to connect model'} +
+
+
)}