fix: sync row replicas when start
This commit is contained in:
@@ -212,7 +212,7 @@ const Models: React.FC<ModelsProps> = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleStartModel = async (row: ListItem) => {
|
const handleStartModel = async (row: ListItem) => {
|
||||||
await updateModel(getFormattedData(row, { replicas: 1 }));
|
await updateModel(getFormattedData(row, { replicas: row.replicas || 1 }));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleStopModel = async (row: ListItem) => {
|
const handleStopModel = async (row: ListItem) => {
|
||||||
@@ -478,7 +478,11 @@ const Models: React.FC<ModelsProps> = ({
|
|||||||
okText: 'common.button.start',
|
okText: 'common.button.start',
|
||||||
operation: 'common.start.confirm',
|
operation: 'common.start.confirm',
|
||||||
async onOk() {
|
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?.();
|
onStart?.();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ const ViewLogsModal: React.FC<ViewModalProps> = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const showCascader =
|
const showCascader =
|
||||||
countOptions?.some((option) => option.children?.length >= 2) ||
|
countOptions?.some((option) => (option.children?.length ?? 0) >= 2) ||
|
||||||
countOptions?.length > 1;
|
countOptions?.length > 1;
|
||||||
|
|
||||||
const handleOnChecked = (e: any) => {
|
const handleOnChecked = (e: any) => {
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ const useViewInstanceLogs = () => {
|
|||||||
currentData: {
|
currentData: {
|
||||||
url: string;
|
url: string;
|
||||||
status: string;
|
status: string;
|
||||||
id?: number | string;
|
id?: number;
|
||||||
modelId?: number | string;
|
modelId?: number;
|
||||||
tail?: number;
|
tail?: number;
|
||||||
};
|
};
|
||||||
}>({
|
}>({
|
||||||
|
|||||||
Reference in New Issue
Block a user