fix: edit model worker selector not remove when manul

This commit is contained in:
jialin
2024-09-13 21:16:31 +08:00
parent 2cd676fd3d
commit e22a137a6f
2 changed files with 19 additions and 10 deletions
+13 -9
View File
@@ -247,17 +247,21 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
};
const handleOk = (formdata: FormData) => {
const gpu = _.find(gpuOptions, (item: any) => {
return item.value === formdata.gpu_selector;
});
if (gpu) {
if (formdata.scheduleType === 'manual') {
const gpu = _.find(gpuOptions, (item: any) => {
return item.value === formdata.gpu_selector;
});
onOk({
..._.omit(formdata, ['scheduleType']),
gpu_selector: {
gpu_name: gpu.name,
gpu_index: gpu.index,
worker_name: gpu.worker_name
}
worker_selector: null,
gpu_selector: gpu
? {
gpu_name: gpu.name,
gpu_index: gpu.index,
worker_name: gpu.worker_name
}
: null
});
} else {
onOk({