chore: tidy code
This commit is contained in:
@@ -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
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user