chore: tidy code

This commit is contained in:
jialin
2025-12-04 16:43:33 +08:00
parent f0a3e84e4f
commit 1c699fe307
@@ -250,32 +250,21 @@ const PoolForm: React.FC<AddModalProps> = forwardRef((props, ref) => {
}; };
const handleInstanceTypeChange = (value: string, option: any) => { const handleInstanceTypeChange = (value: string, option: any) => {
setInstanceSpec({ const newInstanceSpec = {
...option.specInfo, ...option.specInfo,
label: option.label, label: option.label,
vendor: option.vendor, vendor: option.vendor,
description: option.description, description: option.description,
count: option.count count: option.count
}); };
setInstanceSpec({ ...newInstanceSpec });
const newImageList = updateImageList({ const newImageList = updateImageList({ ...newInstanceSpec });
...option.specInfo,
label: option.label,
vendor: option.vendor,
description: option.description,
count: option.count
});
form.setFieldsValue({ form.setFieldsValue({
os_image: newImageList[0]?.os_image, os_image: newImageList[0]?.os_image,
image_name: newImageList[0]?.value, image_name: newImageList[0]?.value,
instance_spec: { instance_spec: { ...newInstanceSpec }
...option.specInfo,
label: option.label,
vendor: option.vendor,
description: option.description,
count: option.count
}
}); });
}; };