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) => {
|
||||
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;
|
||||
};
|
||||
}>({
|
||||
|
||||
Reference in New Issue
Block a user