Skip to content

Commit d2e5494

Browse files
Fix clickable model ID in health check table - Add setSelectedModelId prop to make blue model ID buttons clickable - Fix checkbox selection logic to use model names consistently - Add stopPropagation to prevent unwanted sort triggers on checkbox clicks - Now clicking Model ID opens model details, and select all works properly (#11898)
1 parent 87c2be9 commit d2e5494

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,7 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({
12791279
modelData={modelData}
12801280
all_models_on_proxy={all_models_on_proxy}
12811281
getDisplayModelName={getDisplayModelName}
1282+
setSelectedModelId={setSelectedModelId}
12821283
/>
12831284
</TabPanel>
12841285
<TabPanel>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ interface HealthCheckComponentProps {
2424
modelData: any;
2525
all_models_on_proxy: string[];
2626
getDisplayModelName: (model: any) => string;
27+
setSelectedModelId?: (modelId: string) => void;
2728
}
2829

2930
const HealthCheckComponent: React.FC<HealthCheckComponentProps> = ({
3031
accessToken,
3132
modelData,
3233
all_models_on_proxy,
3334
getDisplayModelName,
35+
setSelectedModelId,
3436
}) => {
3537
const [modelHealthStatuses, setModelHealthStatuses] = useState<{[key: string]: HealthStatus}>({});
3638
const [selectedModelsForHealth, setSelectedModelsForHealth] = useState<string[]>([]);
@@ -515,6 +517,7 @@ const HealthCheckComponent: React.FC<HealthCheckComponentProps> = ({
515517
getStatusBadge,
516518
getDisplayModelName,
517519
showErrorModal,
520+
setSelectedModelId,
518521
)}
519522
data={modelData.data.map((model: any) => {
520523
const modelName = model.model_name;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export const healthCheckColumns = (
3838
getStatusBadge: (status: string) => JSX.Element,
3939
getDisplayModelName: (model: any) => string,
4040
showErrorModal?: (modelName: string, cleanedError: string, fullError: string) => void,
41+
setSelectedModelId?: (modelId: string) => void,
4142
): ColumnDef<HealthCheckData>[] => [
4243
{
4344
header: () => (
@@ -46,6 +47,7 @@ export const healthCheckColumns = (
4647
checked={allModelsSelected}
4748
indeterminate={selectedModelsForHealth.length > 0 && !allModelsSelected}
4849
onChange={(e) => handleSelectAll(e.target.checked)}
50+
onClick={(e) => e.stopPropagation()}
4951
/>
5052
<span>Model ID</span>
5153
</div>
@@ -63,10 +65,12 @@ export const healthCheckColumns = (
6365
<Checkbox
6466
checked={isSelected}
6567
onChange={(e) => handleModelSelection(modelName, e.target.checked)}
68+
onClick={(e) => e.stopPropagation()}
6669
/>
6770
<Tooltip title={model.model_info.id}>
6871
<div
6972
className="font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]"
73+
onClick={() => setSelectedModelId && setSelectedModelId(model.model_info.id)}
7074
>
7175
{model.model_info.id}
7276
</div>

0 commit comments

Comments
 (0)