fix: sync row replicas when start

This commit is contained in:
jialin
2026-05-06 14:43:03 +08:00
committed by jialin
parent 01576212a3
commit d471233f83
3 changed files with 9 additions and 5 deletions
+6 -2
View File
@@ -212,7 +212,7 @@ const Models: React.FC<ModelsProps> = ({
});
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<ModelsProps> = ({
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?.();
}
});
@@ -131,7 +131,7 @@ const ViewLogsModal: React.FC<ViewModalProps> = (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) => {
@@ -12,8 +12,8 @@ const useViewInstanceLogs = () => {
currentData: {
url: string;
status: string;
id?: number | string;
modelId?: number | string;
id?: number;
modelId?: number;
tail?: number;
};
}>({