Skip to content

Commit 677ef3c

Browse files
Fix health check UI table design - Remove table-in-table design from HealthCheckComponent - Change wrapper from card styling to simple div with mb-6 spacing - Remove padding around table container for cleaner layout - Add proper icon-based actions in health check table - Use PlayIcon for new checks and RefreshIcon for re-running checks - Add loading animation with dots during health checks - Include proper tooltips for action buttons (#11897)
1 parent d2e5494 commit 677ef3c

File tree

2 files changed

+38
-18
lines changed

2 files changed

+38
-18
lines changed

ui/litellm-dashboard/src/components/model_dashboard/HealthCheckComponent.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@ const HealthCheckComponent: React.FC<HealthCheckComponentProps> = ({
470470
};
471471

472472
return (
473-
<div className="bg-white rounded-lg shadow">
474-
<div className="border-b px-6 py-4">
473+
<div>
474+
<div className="mb-6">
475475
<div className="flex justify-between items-center">
476476
<div>
477477
<Title>Model Health Status</Title>
@@ -505,7 +505,7 @@ const HealthCheckComponent: React.FC<HealthCheckComponentProps> = ({
505505
</div>
506506
</div>
507507

508-
<div className="p-6">
508+
<div>
509509
<ModelDataTable
510510
columns={healthCheckColumns(
511511
modelHealthStatuses,

ui/litellm-dashboard/src/components/model_dashboard/health_check_columns.tsx

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ColumnDef } from "@tanstack/react-table";
22
import { Button, Badge } from "@tremor/react";
33
import { Tooltip, Checkbox } from "antd";
44
import { Text } from "@tremor/react";
5-
import { InformationCircleIcon } from "@heroicons/react/outline";
5+
import { InformationCircleIcon, PlayIcon, RefreshIcon } from "@heroicons/react/outline";
66

77
interface HealthCheckData {
88
model_name: string;
@@ -226,21 +226,41 @@ export const healthCheckColumns = (
226226
const model = row.original;
227227
const modelName = model.model_name;
228228

229+
const hasExistingStatus = model.health_status && model.health_status !== 'none';
230+
const tooltipText = model.health_loading
231+
? 'Checking...'
232+
: hasExistingStatus
233+
? 'Re-run Health Check'
234+
: 'Run Health Check';
235+
229236
return (
230-
<div
231-
className={`text-sm cursor-pointer ${
232-
model.health_loading
233-
? 'text-gray-400 cursor-not-allowed'
234-
: 'text-indigo-600 hover:text-indigo-700 hover:underline'
235-
}`}
236-
onClick={() => {
237-
if (!model.health_loading) {
238-
runIndividualHealthCheck(modelName);
239-
}
240-
}}
241-
>
242-
{model.health_loading ? 'Checking...' : 'Run Check'}
243-
</div>
237+
<Tooltip title={tooltipText} placement="top">
238+
<button
239+
className={`p-2 rounded-md transition-colors ${
240+
model.health_loading
241+
? 'text-gray-400 cursor-not-allowed bg-gray-100'
242+
: 'text-indigo-600 hover:text-indigo-700 hover:bg-indigo-50'
243+
}`}
244+
onClick={() => {
245+
if (!model.health_loading) {
246+
runIndividualHealthCheck(modelName);
247+
}
248+
}}
249+
disabled={model.health_loading}
250+
>
251+
{model.health_loading ? (
252+
<div className="flex space-x-1">
253+
<div className="w-1 h-1 bg-gray-400 rounded-full animate-pulse"></div>
254+
<div className="w-1 h-1 bg-gray-400 rounded-full animate-pulse" style={{animationDelay: '0.2s'}}></div>
255+
<div className="w-1 h-1 bg-gray-400 rounded-full animate-pulse" style={{animationDelay: '0.4s'}}></div>
256+
</div>
257+
) : hasExistingStatus ? (
258+
<RefreshIcon className="h-4 w-4" />
259+
) : (
260+
<PlayIcon className="h-4 w-4" />
261+
)}
262+
</button>
263+
</Tooltip>
244264
);
245265
},
246266
enableSorting: false,

0 commit comments

Comments
 (0)