bfg-common 1.3.116 → 1.3.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue
CHANGED
|
@@ -456,7 +456,7 @@ const defaultPciDevice: UI_I_PciDevice = {
|
|
|
456
456
|
device_name: 'cdrom',
|
|
457
457
|
}
|
|
458
458
|
const pciDevicesIndex = ref<number[]>([0])
|
|
459
|
-
const pciDevicesType = ref<('new' | 'edit')[]>(['new'])
|
|
459
|
+
const pciDevicesType = ref<('new' | 'edit' | 'removed')[]>(['new'])
|
|
460
460
|
const pciDevices = ref<UI_I_PciDevice[]>([])
|
|
461
461
|
watch(
|
|
462
462
|
() => props.pciDevices,
|
|
@@ -485,8 +485,11 @@ const addPciDevice = (): void => {
|
|
|
485
485
|
const onRemovePciDevice = (index: number): void => {
|
|
486
486
|
const removeIndex = pciDevicesIndex.value.indexOf(index)
|
|
487
487
|
pciDevicesIndex.value = pciDevicesIndex.value.filter((item) => item !== index)
|
|
488
|
-
pciDevicesType.value = pciDevicesType.value.
|
|
489
|
-
(
|
|
488
|
+
pciDevicesType.value = pciDevicesType.value.map(
|
|
489
|
+
(item, key) => {
|
|
490
|
+
if (key !== removeIndex) return 'removed'
|
|
491
|
+
return item
|
|
492
|
+
}
|
|
490
493
|
)
|
|
491
494
|
|
|
492
495
|
pciDevices.value = pciDevices.value.filter((_pciDevice, key: number) => {
|