diff --git a/src/pages/llmodels/components/table-list.tsx b/src/pages/llmodels/components/table-list.tsx index 2e083492..58c95538 100644 --- a/src/pages/llmodels/components/table-list.tsx +++ b/src/pages/llmodels/components/table-list.tsx @@ -212,7 +212,7 @@ const Models: React.FC = ({ }); const handleStartModel = async (row: ListItem) => { - await updateModel(getFormattedData(row, { replicas: 1 })); + await updateModel(getFormattedData(row, { replicas: row.replicas || 1 })); }; const handleStopModel = async (row: ListItem) => { @@ -478,7 +478,11 @@ const Models: React.FC = ({ okText: 'common.button.start', operation: 'common.start.confirm', async onOk() { - await handleBatchRequest(rowSelection.selectedRows, handleStartModel); + const selectedKeySet = new Set(rowSelection.selectedRowKeys); + const latestRows = dataSource.filter((item) => + selectedKeySet.has(item.id) + ); + await handleBatchRequest(latestRows, handleStartModel); onStart?.(); } }); diff --git a/src/pages/llmodels/components/view-logs-modal.tsx b/src/pages/llmodels/components/view-logs-modal.tsx index 45c3eb15..8d3fe7cd 100644 --- a/src/pages/llmodels/components/view-logs-modal.tsx +++ b/src/pages/llmodels/components/view-logs-modal.tsx @@ -131,7 +131,7 @@ const ViewLogsModal: React.FC = (props) => { }; const showCascader = - countOptions?.some((option) => option.children?.length >= 2) || + countOptions?.some((option) => (option.children?.length ?? 0) >= 2) || countOptions?.length > 1; const handleOnChecked = (e: any) => { diff --git a/src/pages/llmodels/hooks/use-view-instance-logs.ts b/src/pages/llmodels/hooks/use-view-instance-logs.ts index 8f67eb8a..30449a31 100644 --- a/src/pages/llmodels/hooks/use-view-instance-logs.ts +++ b/src/pages/llmodels/hooks/use-view-instance-logs.ts @@ -12,8 +12,8 @@ const useViewInstanceLogs = () => { currentData: { url: string; status: string; - id?: number | string; - modelId?: number | string; + id?: number; + modelId?: number; tail?: number; }; }>({