feat: disable attach volume to the same vm

Disable select the vm which is already attached to the volume when attaching the volume to a vm in the volume list page

Change-Id: I93d88888aad16422a3a747fcf76d0514a3096077
This commit is contained in:
zhangjingwei 2024-04-01 16:09:10 +08:00
parent 3d3c4cd044
commit 9d6d3d6d2b

View File

@ -48,7 +48,8 @@ export class Attach extends ModalAction {
return 'large';
}
disabledInstance = (ins) => !allowAttachVolumeInstance(ins);
disabledInstance = (ins) =>
!allowAttachVolumeInstance(ins) || this.alreadyAttached(ins);
get defaultValue() {
const { name, id, size, volume_type } = this.item;