mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
Fix undefined error in VM edit as yaml page (#233)
* fix undefined error whenclick save in edit as yaml Signed-off-by: Andy Lee <andy.lee@suse.com> * fix VM isEqual logic and fix undefined error Signed-off-by: Andy Lee <andy.lee@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
@@ -97,11 +97,13 @@ export default {
|
||||
});
|
||||
|
||||
const devices = [
|
||||
...this.otherDevices(this.value.domain.devices.hostDevices || []),
|
||||
...this.otherDevices(this.value?.domain?.devices?.hostDevices || []),
|
||||
...formatted,
|
||||
];
|
||||
|
||||
set(this.value.domain.devices, 'hostDevices', devices);
|
||||
if (devices.length > 0) {
|
||||
set(this.value.domain.devices, 'hostDevices', devices);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -121,7 +123,9 @@ export default {
|
||||
return inUse;
|
||||
}
|
||||
|
||||
vm.hostDevices.forEach((device) => {
|
||||
const hostDevices = vm?.hostDevices || [];
|
||||
|
||||
hostDevices.forEach((device) => {
|
||||
inUse[device.name] = { usedBy: [vm.metadata.name] };
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user