bfg-common 1.4.398 → 1.4.400
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/CustomizeHardwareNew.vue +203 -189
- package/package.json +1 -1
- package/components/common/vm/actions/common/_customizeHardware/CustomizeHardware.vue +0 -274
- package/components/common/vm/actions/common/_customizeHardware/lib/config/navItems.ts +0 -21
- package/components/common/vm/actions/common/_customizeHardware/lib/models/interfaces.ts +0 -7
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/VirtualHardware.vue +0 -702
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/browseView/BrowseView.vue +0 -203
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/browseView/lib/models/interfaces.ts +0 -8
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/bus/Bus.vue +0 -156
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/bus/lib/config/options.ts +0 -20
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +0 -270
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/config/fileTypes.ts +0 -9
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/config/options.ts +0 -11
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/models/types.ts +0 -1
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +0 -57
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +0 -110
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Cpu.vue +0 -403
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CpuHotPlug.vue +0 -56
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CpuModel.vue +0 -225
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Hv.vue +0 -99
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Iommu.vue +0 -55
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/MaxCpu.vue +0 -106
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Pc.vue +0 -55
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Sa.vue +0 -106
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/lib/config/cpuOptions.ts +0 -21
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/shares/Shares.vue +0 -160
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +0 -28
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/tooltip/Tooltip.vue +0 -59
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/config/binaryOptions.ts +0 -12
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/config/dropdownItems.ts +0 -66
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/models/interfaces.ts +0 -118
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/models/types.ts +0 -4
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/limit/Limit.vue +0 -236
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/limit/lib/config/options.ts +0 -28
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/Memory.vue +0 -329
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/MemoryHotPlug.vue +0 -54
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/lib/config/memoryOptions.ts +0 -35
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/DiskFile.vue +0 -24
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/MaximumSize.vue +0 -27
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +0 -462
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +0 -81
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/cache/lib/config/options.ts +0 -7
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +0 -153
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/limitIops/lib/config/options.ts +0 -28
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/Location.vue +0 -172
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/StorageModalOld.vue +0 -52
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/storageModalNew/StorageModalNew.vue +0 -175
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/storageModalNew/lib/config/table.ts +0 -167
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/mode/Mode.vue +0 -88
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/mode/lib/config/options.ts +0 -18
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +0 -88
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/provisioning/lib/config/options.ts +0 -15
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/sharing/Sharing.vue +0 -86
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/sharing/lib/config/options.ts +0 -12
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/Location.vue +0 -145
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +0 -305
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +0 -87
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/adapterType/lib/config/options.ts +0 -9
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +0 -148
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/macAddress/lib/config/options.ts +0 -11
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +0 -168
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +0 -48
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +0 -49
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/lib/config/options.ts +0 -10
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/lib/config/options.ts +0 -7
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/note/Note.vue +0 -27
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +0 -42
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelection.vue +0 -57
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +0 -82
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newUsbController/lib/config/options.ts +0 -6
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/other/InputDevices.vue +0 -21
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/other/Other.vue +0 -32
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/reservation/Reservation.vue +0 -237
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/reservation/lib/config/options.ts +0 -33
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/Graphics.vue +0 -50
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/TotalVideoMemory.vue +0 -121
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/VideoCard.vue +0 -182
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/lib/config/options.ts +0 -11
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/model/Model.vue +0 -59
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/model/lib/config/options.ts +0 -10
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +0 -83
- package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/numberDisplays/lib/config/options.ts +0 -14
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/Vmoptions.vue +0 -181
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/BootOptions.vue +0 -114
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/Menu.vue +0 -50
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/Secure.vue +0 -50
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/delay/Delay.vue +0 -54
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/delay/lib/config/config.ts +0 -14
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +0 -84
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/firmware/lib/config/config.ts +0 -11
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/order/Order.vue +0 -201
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/order/lib/models/interfaces.ts +0 -9
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +0 -192
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/lib/models/interfaces.ts +0 -34
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/CopyPaste.vue +0 -52
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/FileTransfer.vue +0 -52
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/FolderSharing.vue +0 -51
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/PlaybackCompression.vue +0 -52
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/PowerControl.vue +0 -50
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +0 -254
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/ImgCompression.vue +0 -85
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/lib/config/config.ts +0 -14
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/JpegCompression.vue +0 -85
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/lib/config/config.ts +0 -12
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +0 -56
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/keymap/lib/config/config.ts +0 -6
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/MouseMode.vue +0 -57
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/lib/config/config.ts +0 -11
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +0 -142
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/lib/models/interfaces.ts +0 -5
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/lib/utils.ts +0 -12
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/SharePolicy.vue +0 -56
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/lib/config/config.ts +0 -11
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +0 -85
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/lib/config/config.ts +0 -12
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/type/Type.vue +0 -85
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/type/lib/config/config.ts +0 -7
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +0 -57
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/lib/config/config.ts +0 -14
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/ZlibCompression.vue +0 -85
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/lib/config/config.ts +0 -12
- package/components/common/vm/actions/common/_customizeHardware/vmoptions/tools/Tools.vue +0 -72
package/components/common/vm/actions/common/_customizeHardware/virtualHardware/VirtualHardware.vue
DELETED
|
@@ -1,702 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="virtual-hardware">
|
|
3
|
-
<div class="clr-row clr-justify-content-end">
|
|
4
|
-
<atoms-dropdown-tree
|
|
5
|
-
:title="localization.common.addNewDevice"
|
|
6
|
-
:items="dropdownItems"
|
|
7
|
-
test-id="add-device-dropdown"
|
|
8
|
-
@select="onAddDevice"
|
|
9
|
-
/>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div class="clr-component">
|
|
13
|
-
<div class="stack-view">
|
|
14
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-cpu
|
|
15
|
-
:max-cpus="props.maxCpus"
|
|
16
|
-
:cpu-models="props.cpuModels"
|
|
17
|
-
:cpu="props.cpu"
|
|
18
|
-
:is-edit="props.isEdit"
|
|
19
|
-
:state="props.state"
|
|
20
|
-
:error-validation-fields="props.errorValidationFields"
|
|
21
|
-
:vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
|
|
22
|
-
@send-data="onSendDataCpuMethod"
|
|
23
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
24
|
-
@invalid="cpuInvalid = $event"
|
|
25
|
-
/>
|
|
26
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-memory
|
|
27
|
-
:max-memory="props.maxMemory"
|
|
28
|
-
:is-edit="props.isEdit"
|
|
29
|
-
:memory="props.memory"
|
|
30
|
-
:state="props.state"
|
|
31
|
-
:error-validation-fields="props.errorValidationFields"
|
|
32
|
-
@send-data="onSendDataMemoryMethod"
|
|
33
|
-
@invalid="memoryInvalid = $event"
|
|
34
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
35
|
-
/>
|
|
36
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk
|
|
37
|
-
v-for="(item, key) in hardDisks"
|
|
38
|
-
:key="hardDisksIndex[key]"
|
|
39
|
-
:index="hardDisksIndex[key]"
|
|
40
|
-
:type="hardDisksType[key]"
|
|
41
|
-
:storage="props.storage"
|
|
42
|
-
:hard-disk="item"
|
|
43
|
-
:error-validation-fields="props.errorValidationFields"
|
|
44
|
-
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
45
|
-
:datastore="props.datastore"
|
|
46
|
-
:is-edit="props.isEdit"
|
|
47
|
-
:state="props.state"
|
|
48
|
-
:guest-machine-type="props.guestMachineType"
|
|
49
|
-
@remove="onRemoveHardDisk(hardDisksIndex[key], item)"
|
|
50
|
-
@roll-back="onRollBackHardDisk(hardDisksIndex[key])"
|
|
51
|
-
@send-data="onSendDataNewHardDiskMethod($event, hardDisksIndex[key])"
|
|
52
|
-
@invalid="onSetInvalidHardDisk($event, hardDisksIndex[key])"
|
|
53
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
54
|
-
/>
|
|
55
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-new-network
|
|
56
|
-
v-for="(item, key) in networks"
|
|
57
|
-
:key="networksIndex[key]"
|
|
58
|
-
:index="networksIndex[key]"
|
|
59
|
-
:type="networksType[key]"
|
|
60
|
-
:network="item"
|
|
61
|
-
:networks-table="props.networksTable"
|
|
62
|
-
:error-validation-fields="props.errorValidationFields"
|
|
63
|
-
:is-edit="props.isEdit"
|
|
64
|
-
:state="props.state"
|
|
65
|
-
:project="props.project"
|
|
66
|
-
@remove="onRemoveNetwork(networksIndex[key])"
|
|
67
|
-
@send-data="sendDataNewNetworkMethod($event, networksIndex[key])"
|
|
68
|
-
@invalid="onSetInvalidNetwork($event, networksIndex[key])"
|
|
69
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
70
|
-
@get-networks-table="emits('get-networks-table', $event)"
|
|
71
|
-
/>
|
|
72
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-cd-dvd-drive
|
|
73
|
-
v-for="(item, key) in cdDvdDrives"
|
|
74
|
-
:key="cdDvdDrivesIndex[key]"
|
|
75
|
-
:index="cdDvdDrivesIndex[key]"
|
|
76
|
-
:hard-disks-count="hardDisks.length"
|
|
77
|
-
:type="cdDvdDrivesType[key]"
|
|
78
|
-
:cd-dvd-drive="item"
|
|
79
|
-
:nodes="props.nodes"
|
|
80
|
-
:files="props.files"
|
|
81
|
-
:error-validation-fields="props.errorValidationFields"
|
|
82
|
-
:is-edit="props.isEdit"
|
|
83
|
-
:state="props.state"
|
|
84
|
-
:guest-machine-type="props.guestMachineType"
|
|
85
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
86
|
-
@get-storage="emits('get-storage', $event)"
|
|
87
|
-
@get-folders-or-files="emits('get-folders-or-files', $event)"
|
|
88
|
-
@get-active-device-child="emits('get-active-device-child', $event)"
|
|
89
|
-
@show-datastore-child="emits('show-datastore-child', $event)"
|
|
90
|
-
@remove="onRemoveCdDvdDrive(cdDvdDrivesIndex[key], item)"
|
|
91
|
-
@roll-back="onRollBackCdDvdDrive(cdDvdDrivesIndex[key])"
|
|
92
|
-
@send-data="
|
|
93
|
-
sendDataNewCdDvdDriveMethod($event, cdDvdDrivesIndex[key])
|
|
94
|
-
"
|
|
95
|
-
/>
|
|
96
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-new-usb-controller
|
|
97
|
-
:usb-controller="props.usbController"
|
|
98
|
-
:is-edit="props.isEdit"
|
|
99
|
-
:state="props.state"
|
|
100
|
-
@send-data="onSendDataNewUsbControllerMethod"
|
|
101
|
-
/>
|
|
102
|
-
<template v-if="props.passthroughDevices">
|
|
103
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-new-pci-device
|
|
104
|
-
v-for="(item, key) in pciDevices"
|
|
105
|
-
:key="pciDevicesIndex[key]"
|
|
106
|
-
:index="pciDevicesIndex[key]"
|
|
107
|
-
:pci-device="item"
|
|
108
|
-
:error-validation-fields="props.errorValidationFields"
|
|
109
|
-
:passthrough-devices="props.passthroughDevices"
|
|
110
|
-
:type="pciDevicesType[key]"
|
|
111
|
-
:is-edit="props.isEdit"
|
|
112
|
-
:state="props.state"
|
|
113
|
-
@remove="onRemovePciDevice(pciDevicesIndex[key])"
|
|
114
|
-
@send-data="
|
|
115
|
-
onSendDataPciDevicesMethod($event, pciDevicesIndex[key])
|
|
116
|
-
"
|
|
117
|
-
@invalid="onSetInvalidPciDevice($event, pciDevicesIndex[key])"
|
|
118
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
119
|
-
/>
|
|
120
|
-
</template>
|
|
121
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-video-card
|
|
122
|
-
:is-edit="props.isEdit"
|
|
123
|
-
:video-card="props.videoCard"
|
|
124
|
-
:error-validation-fields="props.errorValidationFields"
|
|
125
|
-
:state="props.state"
|
|
126
|
-
@send-data="onSendDataVideoCardMethod"
|
|
127
|
-
@invalid="videoCardInvalid = $event"
|
|
128
|
-
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
129
|
-
/>
|
|
130
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-other />
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<Teleport to="body">
|
|
135
|
-
<common-vm-actions-common-customize-hardware-virtual-hardware-browse-view
|
|
136
|
-
v-if="isShowFileModal"
|
|
137
|
-
:show="isShowFileModal"
|
|
138
|
-
:nodes="props.nodes"
|
|
139
|
-
:files="props.files"
|
|
140
|
-
@submit="onAddExistHardDisk"
|
|
141
|
-
@get-storage="emits('get-storage', $event)"
|
|
142
|
-
@get-folders-or-files="emits('get-folders-or-files', $event)"
|
|
143
|
-
@get-active-device-child="emits('get-active-device-child', $event)"
|
|
144
|
-
@show-datastore-child="emits('show-datastore-child', $event)"
|
|
145
|
-
@hide="isShowFileModal = false"
|
|
146
|
-
/>
|
|
147
|
-
</Teleport>
|
|
148
|
-
</div>
|
|
149
|
-
</template>
|
|
150
|
-
|
|
151
|
-
<script setup lang="ts">
|
|
152
|
-
import type { UI_T_Project } from '~/lib/models/types'
|
|
153
|
-
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
154
|
-
import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
|
|
155
|
-
import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
|
|
156
|
-
import type { UI_I_FolderOrFileTreePayload } from '~/lib/models/store/storage/interfaces'
|
|
157
|
-
import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
|
|
158
|
-
import type {
|
|
159
|
-
UI_I_SendDataCpu,
|
|
160
|
-
UI_I_SendDataMemory,
|
|
161
|
-
UI_I_SendDataNewHardDisk,
|
|
162
|
-
UI_I_SendDataNewNetwork,
|
|
163
|
-
UI_I_SendDataVideoCard,
|
|
164
|
-
UI_I_InvalidKeys,
|
|
165
|
-
UI_I_SendDataVirtualHardware,
|
|
166
|
-
UI_I_SendDataNewCdDvdDrive,
|
|
167
|
-
// UI_I_HardDisk,
|
|
168
|
-
UI_I_SendDataNewPciDevice,
|
|
169
|
-
} from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
170
|
-
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
171
|
-
import type {
|
|
172
|
-
UI_T_HardDiskType,
|
|
173
|
-
UI_T_NetworkType,
|
|
174
|
-
UI_T_CdDvdType,
|
|
175
|
-
} from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
|
|
176
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
177
|
-
import type {
|
|
178
|
-
UI_I_DropdownTreeItem,
|
|
179
|
-
UI_I_DropdownTreeItemChild,
|
|
180
|
-
} from '~/components/atoms/dropdown/tree/lib/models/interfaces'
|
|
181
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
182
|
-
import type {
|
|
183
|
-
API_UI_I_VmEditCpu,
|
|
184
|
-
API_UI_I_VmEditMemory,
|
|
185
|
-
UI_I_PciDevice,
|
|
186
|
-
} from '~/lib/models/store/vm/interfaces'
|
|
187
|
-
import { dropdownItemsFunc } from './lib/config/dropdownItems'
|
|
188
|
-
|
|
189
|
-
const props = defineProps<{
|
|
190
|
-
storage: UI_I_DatastoreTableItem | null
|
|
191
|
-
cpuModels: UI_I_OptionItem[]
|
|
192
|
-
vmName: string
|
|
193
|
-
maxCpus: number
|
|
194
|
-
maxMemory: number
|
|
195
|
-
isEdit: boolean
|
|
196
|
-
isClone: boolean
|
|
197
|
-
errorValidationFields: UI_I_ErrorValidationField<string>[]
|
|
198
|
-
nodes: UI_I_FileTreeNode[]
|
|
199
|
-
files: UI_I_FileTreeNode[]
|
|
200
|
-
networksTable: UI_I_NetworkTableItem[]
|
|
201
|
-
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
202
|
-
datastore: UI_I_DatastoreTableItem[]
|
|
203
|
-
state?: string | number
|
|
204
|
-
cpu?: API_UI_I_VmEditCpu
|
|
205
|
-
memory?: API_UI_I_VmEditMemory
|
|
206
|
-
vmCpuHelpTextSecond?: string
|
|
207
|
-
hardDisks?: UI_I_SendDataNewHardDisk[] | null
|
|
208
|
-
cdDvdDrives?: UI_I_SendDataNewCdDvdDrive[] | null
|
|
209
|
-
networks?: UI_I_SendDataNewNetwork[] | null
|
|
210
|
-
videoCard?: UI_I_SendDataVideoCard
|
|
211
|
-
usbController?: string
|
|
212
|
-
pciDevices?: UI_I_SendDataNewPciDevice[]
|
|
213
|
-
passthroughDevices?: UI_I_PciDevice[]
|
|
214
|
-
project: UI_T_Project
|
|
215
|
-
guestMachineType?: UI_I_OptionItem | null
|
|
216
|
-
}>()
|
|
217
|
-
const emits = defineEmits<{
|
|
218
|
-
(event: 'send-data', value: UI_I_SendDataVirtualHardware): void
|
|
219
|
-
(event: 'invalid', value: string[]): void
|
|
220
|
-
(event: 'get-storage', value: UI_I_TablePayload): void
|
|
221
|
-
(event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
|
|
222
|
-
(event: 'get-active-device-child', value: UI_I_FileTreeNode): void
|
|
223
|
-
(event: 'show-datastore-child', value: UI_I_FileTreeNode): void
|
|
224
|
-
(event: 'remove-error-by-title', value: string): void
|
|
225
|
-
(event: 'get-networks-table', value: UI_I_TablePayload): void
|
|
226
|
-
(event: 'get-pci-devices'): void
|
|
227
|
-
}>()
|
|
228
|
-
|
|
229
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
230
|
-
const { $binary } = useNuxtApp()
|
|
231
|
-
|
|
232
|
-
const dropdownItems = computed<UI_I_DropdownTreeItem[]>(() =>
|
|
233
|
-
dropdownItemsFunc(localization.value, props.state, props.passthroughDevices)
|
|
234
|
-
)
|
|
235
|
-
|
|
236
|
-
const hardDisksIndex = ref<number[]>([0])
|
|
237
|
-
const hardDisksType = ref<UI_T_HardDiskType[]>(['new'])
|
|
238
|
-
const hardDisks = ref<UI_I_SendDataNewHardDisk[]>([
|
|
239
|
-
{
|
|
240
|
-
create: true,
|
|
241
|
-
size: 90,
|
|
242
|
-
source: '',
|
|
243
|
-
boot_order: -1,
|
|
244
|
-
},
|
|
245
|
-
])
|
|
246
|
-
watch(
|
|
247
|
-
() => props.hardDisks,
|
|
248
|
-
(newValue) => {
|
|
249
|
-
if ((!props.isEdit && !props.isClone) || !newValue) return
|
|
250
|
-
|
|
251
|
-
const count = newValue?.length || 0
|
|
252
|
-
hardDisksIndex.value = [...Array(count).keys()]
|
|
253
|
-
hardDisks.value = newValue
|
|
254
|
-
if (props.isEdit) {
|
|
255
|
-
hardDisksType.value = Array(count).fill('edit')
|
|
256
|
-
} else if (props.isClone) {
|
|
257
|
-
hardDisksType.value = Array(count).fill('new')
|
|
258
|
-
hardDisks.value = newValue.map((hardDisk) => {
|
|
259
|
-
hardDisk.create = true
|
|
260
|
-
return hardDisk
|
|
261
|
-
})
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
{ immediate: true }
|
|
265
|
-
)
|
|
266
|
-
|
|
267
|
-
const addHardDisk = (
|
|
268
|
-
create = true,
|
|
269
|
-
size = 90,
|
|
270
|
-
source = '',
|
|
271
|
-
type: UI_T_HardDiskType = 'new',
|
|
272
|
-
provisioned_type?: number // При добавлении существующей
|
|
273
|
-
): void => {
|
|
274
|
-
const newIndex = (hardDisksIndex.value.at(-1) ?? -1) + 1
|
|
275
|
-
hardDisksIndex.value.push(newIndex)
|
|
276
|
-
hardDisksType.value.push(type)
|
|
277
|
-
|
|
278
|
-
let provisionType = 'thick'
|
|
279
|
-
if (provisioned_type === 1) provisionType = 'thin'
|
|
280
|
-
|
|
281
|
-
hardDisks.value.push({
|
|
282
|
-
create,
|
|
283
|
-
size,
|
|
284
|
-
source,
|
|
285
|
-
attach: true,
|
|
286
|
-
boot_order: 0, // Убираем галочку
|
|
287
|
-
provision_type: provisionType,
|
|
288
|
-
})
|
|
289
|
-
sendData()
|
|
290
|
-
}
|
|
291
|
-
const onAddExistHardDisk = (file: UI_I_FileTreeNode): void => {
|
|
292
|
-
addHardDisk(
|
|
293
|
-
false,
|
|
294
|
-
$binary.bToGb(file.size),
|
|
295
|
-
file.path,
|
|
296
|
-
'exist',
|
|
297
|
-
file.provisioned_type
|
|
298
|
-
)
|
|
299
|
-
}
|
|
300
|
-
const onRemoveHardDisk = (
|
|
301
|
-
index: number,
|
|
302
|
-
hardDisk: UI_I_SendDataNewHardDisk
|
|
303
|
-
): void => {
|
|
304
|
-
const removeIndex = hardDisksIndex.value.indexOf(index)
|
|
305
|
-
|
|
306
|
-
if (!hardDisk.create && !hardDisk.attach) {
|
|
307
|
-
hardDisksType.value = hardDisksType.value.map((item, key) => {
|
|
308
|
-
if (key === removeIndex) return 'removed'
|
|
309
|
-
return item
|
|
310
|
-
})
|
|
311
|
-
sendData()
|
|
312
|
-
return
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
hardDisksIndex.value = hardDisksIndex.value.filter((item) => item !== index)
|
|
316
|
-
hardDisksType.value = hardDisksType.value.filter(
|
|
317
|
-
(_item, key) => key !== removeIndex
|
|
318
|
-
)
|
|
319
|
-
|
|
320
|
-
hardDisks.value = hardDisks.value.filter((_hardDisk, key: number) => {
|
|
321
|
-
return removeIndex !== key
|
|
322
|
-
})
|
|
323
|
-
|
|
324
|
-
delete newHardDiskInvalidKeys.value[index]
|
|
325
|
-
delete sendDataNewHardDisk.value[index]
|
|
326
|
-
sendData()
|
|
327
|
-
}
|
|
328
|
-
const onRollBackHardDisk = (index: number): void => {
|
|
329
|
-
const removeIndex = hardDisksIndex.value.indexOf(index)
|
|
330
|
-
hardDisksType.value = hardDisksType.value.map((item, key) => {
|
|
331
|
-
if (key === removeIndex) return 'edit'
|
|
332
|
-
return item
|
|
333
|
-
})
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
const defaultNetwork = {
|
|
337
|
-
network: '',
|
|
338
|
-
net_bridge: '',
|
|
339
|
-
mac: '',
|
|
340
|
-
target: '',
|
|
341
|
-
model: '',
|
|
342
|
-
boot_order: -1,
|
|
343
|
-
}
|
|
344
|
-
const networks = ref<UI_I_SendDataNewNetwork[]>([useDeepCopy(defaultNetwork)])
|
|
345
|
-
const networksType = ref<UI_T_NetworkType[]>(['new'])
|
|
346
|
-
const networksIndex = ref<number[]>([0])
|
|
347
|
-
watch(
|
|
348
|
-
() => props.networks,
|
|
349
|
-
(newValue) => {
|
|
350
|
-
if ((!props.isEdit && !props.isClone) || !newValue) return
|
|
351
|
-
|
|
352
|
-
// networks.value = newValue
|
|
353
|
-
// networksType.value = Array(newValue.length).fill('edit')
|
|
354
|
-
const count = newValue?.length || 0
|
|
355
|
-
networksIndex.value = [...Array(count).keys()]
|
|
356
|
-
networks.value = newValue
|
|
357
|
-
if (props.isEdit) {
|
|
358
|
-
networksType.value = Array(count).fill('edit')
|
|
359
|
-
} else if (props.isClone) {
|
|
360
|
-
networksType.value = Array(count).fill('new')
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
{ immediate: true }
|
|
364
|
-
)
|
|
365
|
-
const addNetwork = (): void => {
|
|
366
|
-
const index = (networksIndex.value.at(-1) ?? -1) + 1
|
|
367
|
-
networksIndex.value.push(index)
|
|
368
|
-
networksType.value.push('new')
|
|
369
|
-
|
|
370
|
-
networks.value.push({
|
|
371
|
-
...useDeepCopy(defaultNetwork),
|
|
372
|
-
boot_order: 0, // Убираем галочку
|
|
373
|
-
})
|
|
374
|
-
}
|
|
375
|
-
const onRemoveNetwork = (index: number): void => {
|
|
376
|
-
const removeIndex = networksIndex.value.indexOf(index)
|
|
377
|
-
networksIndex.value = networksIndex.value.filter((item) => item !== index)
|
|
378
|
-
networksType.value = networksType.value.filter(
|
|
379
|
-
(_item, key) => key !== removeIndex
|
|
380
|
-
)
|
|
381
|
-
networks.value = networks.value.filter(
|
|
382
|
-
(_network, key: number) => removeIndex !== key
|
|
383
|
-
)
|
|
384
|
-
|
|
385
|
-
delete newNetworkInvalidKeys.value[index]
|
|
386
|
-
delete sendDataNewNetwork.value[index]
|
|
387
|
-
sendData()
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
const defaultCdDvdDriver: UI_I_SendDataNewCdDvdDrive = {
|
|
391
|
-
create: false,
|
|
392
|
-
attach: false,
|
|
393
|
-
source: '',
|
|
394
|
-
bus: '',
|
|
395
|
-
device_type: 'cdrom',
|
|
396
|
-
boot_order: -1,
|
|
397
|
-
}
|
|
398
|
-
const cdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[]>([
|
|
399
|
-
useDeepCopy(defaultCdDvdDriver),
|
|
400
|
-
])
|
|
401
|
-
const cdDvdDrivesIndex = ref<number[]>([0])
|
|
402
|
-
const cdDvdDrivesType = ref<UI_T_CdDvdType[]>(['new'])
|
|
403
|
-
watch(
|
|
404
|
-
() => props.cdDvdDrives,
|
|
405
|
-
(newValue) => {
|
|
406
|
-
if ((!props.isEdit && !props.isClone) || !newValue) return
|
|
407
|
-
|
|
408
|
-
// cdDvdDrives.value = newValue
|
|
409
|
-
// cdDvdDrivesType.value = Array(newValue.length).fill('edit')
|
|
410
|
-
const count = newValue?.length || 0
|
|
411
|
-
cdDvdDrivesIndex.value = [...Array(count).keys()]
|
|
412
|
-
cdDvdDrives.value = newValue
|
|
413
|
-
if (props.isEdit) {
|
|
414
|
-
cdDvdDrivesType.value = Array(count).fill('edit')
|
|
415
|
-
} else if (props.isClone) {
|
|
416
|
-
cdDvdDrivesType.value = Array(count).fill('new')
|
|
417
|
-
}
|
|
418
|
-
},
|
|
419
|
-
{ immediate: true }
|
|
420
|
-
)
|
|
421
|
-
const addCdDvdDrive = (): void => {
|
|
422
|
-
const value = (cdDvdDrivesIndex.value.at(-1) ?? -1) + 1
|
|
423
|
-
cdDvdDrivesIndex.value.push(value)
|
|
424
|
-
cdDvdDrivesType.value.push('new')
|
|
425
|
-
cdDvdDrives.value.push({
|
|
426
|
-
...useDeepCopy(defaultCdDvdDriver),
|
|
427
|
-
attach: true,
|
|
428
|
-
boot_order: 0, // Убираем галочку
|
|
429
|
-
})
|
|
430
|
-
}
|
|
431
|
-
const onRemoveCdDvdDrive = (
|
|
432
|
-
index: number,
|
|
433
|
-
cdDvdDrive: UI_I_SendDataNewCdDvdDrive
|
|
434
|
-
): void => {
|
|
435
|
-
const removeIndex = cdDvdDrivesIndex.value.indexOf(index)
|
|
436
|
-
|
|
437
|
-
// if (!cdDvdDrive.create && !cdDvdDrive.attach) {
|
|
438
|
-
if (cdDvdDrivesType.value[index] === 'edit' && !cdDvdDrive.attach) {
|
|
439
|
-
cdDvdDrivesType.value = cdDvdDrivesType.value.map((item, key) => {
|
|
440
|
-
if (key === removeIndex) return 'removed'
|
|
441
|
-
return item
|
|
442
|
-
})
|
|
443
|
-
sendData()
|
|
444
|
-
return
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
cdDvdDrivesIndex.value = cdDvdDrivesIndex.value.filter(
|
|
448
|
-
(cdDvdDrive) => cdDvdDrive !== index
|
|
449
|
-
)
|
|
450
|
-
cdDvdDrivesType.value = cdDvdDrivesType.value.filter(
|
|
451
|
-
(_item, key) => key !== index
|
|
452
|
-
)
|
|
453
|
-
cdDvdDrives.value = cdDvdDrives.value.filter(
|
|
454
|
-
(_cdDvdDrive, key: number) => removeIndex !== key
|
|
455
|
-
)
|
|
456
|
-
|
|
457
|
-
delete sendDataNewCdDvdDrive.value[index]
|
|
458
|
-
sendData()
|
|
459
|
-
}
|
|
460
|
-
const onRollBackCdDvdDrive = (index: number): void => {
|
|
461
|
-
const removeIndex = cdDvdDrivesIndex.value.indexOf(index)
|
|
462
|
-
cdDvdDrivesType.value = cdDvdDrivesType.value.map((item, key) => {
|
|
463
|
-
if (key === removeIndex) return 'edit'
|
|
464
|
-
return item
|
|
465
|
-
})
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
const defaultPciDevice: UI_I_SendDataNewPciDevice = {
|
|
469
|
-
address: '',
|
|
470
|
-
vendor_name: '',
|
|
471
|
-
class_name: 'cdrom',
|
|
472
|
-
device_name: 'cdrom',
|
|
473
|
-
}
|
|
474
|
-
const pciDevicesIndex = ref<number[]>([0])
|
|
475
|
-
const pciDevicesType = ref<('new' | 'edit' | 'removed')[]>(['new'])
|
|
476
|
-
const pciDevices = ref<UI_I_SendDataNewPciDevice[]>([])
|
|
477
|
-
watch(
|
|
478
|
-
() => props.pciDevices,
|
|
479
|
-
(newValue) => {
|
|
480
|
-
if ((!props.isEdit && !props.isClone) || !newValue) return
|
|
481
|
-
|
|
482
|
-
const count = newValue?.length || 0
|
|
483
|
-
pciDevicesIndex.value = [...Array(count).keys()]
|
|
484
|
-
pciDevices.value = newValue || []
|
|
485
|
-
if (props.isEdit) {
|
|
486
|
-
pciDevicesType.value = Array(count).fill('edit')
|
|
487
|
-
} else if (props.isClone) {
|
|
488
|
-
pciDevicesType.value = Array(count).fill('new')
|
|
489
|
-
}
|
|
490
|
-
},
|
|
491
|
-
{ immediate: true }
|
|
492
|
-
)
|
|
493
|
-
|
|
494
|
-
const addPciDevice = (): void => {
|
|
495
|
-
const newIndex = (pciDevicesIndex.value.at(-1) ?? -1) + 1
|
|
496
|
-
pciDevicesIndex.value.push(newIndex)
|
|
497
|
-
pciDevicesType.value.push('new')
|
|
498
|
-
|
|
499
|
-
pciDevices.value.push(useDeepCopy(defaultPciDevice))
|
|
500
|
-
}
|
|
501
|
-
const onRemovePciDevice = (index: number): void => {
|
|
502
|
-
const removeIndex = pciDevicesIndex.value.indexOf(index)
|
|
503
|
-
pciDevicesIndex.value = pciDevicesIndex.value.filter((item) => item !== index)
|
|
504
|
-
pciDevicesType.value = pciDevicesType.value.filter(
|
|
505
|
-
(_item, key) => key !== removeIndex
|
|
506
|
-
)
|
|
507
|
-
|
|
508
|
-
pciDevices.value = pciDevices.value.filter((_pciDevice, key: number) => {
|
|
509
|
-
return removeIndex !== key
|
|
510
|
-
})
|
|
511
|
-
|
|
512
|
-
delete newPciDeviceInvalidKeys.value[index]
|
|
513
|
-
delete sendDataNewPciDevices.value[index]
|
|
514
|
-
sendData()
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
const isShowFileModal = ref<boolean>(false)
|
|
518
|
-
const onAddDevice = (item: UI_I_DropdownTreeItemChild): void => {
|
|
519
|
-
switch (item.value) {
|
|
520
|
-
case 1:
|
|
521
|
-
addHardDisk()
|
|
522
|
-
break
|
|
523
|
-
case 2:
|
|
524
|
-
isShowFileModal.value = true
|
|
525
|
-
break
|
|
526
|
-
case 5:
|
|
527
|
-
addCdDvdDrive()
|
|
528
|
-
break
|
|
529
|
-
case 10:
|
|
530
|
-
addPciDevice()
|
|
531
|
-
break
|
|
532
|
-
case 14:
|
|
533
|
-
addNetwork()
|
|
534
|
-
break
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
const cpuInvalid = ref<boolean>(false)
|
|
539
|
-
const sendDataCpu = ref<UI_I_SendDataCpu | null>(null)
|
|
540
|
-
const onSendDataCpuMethod = (data: UI_I_SendDataCpu): void => {
|
|
541
|
-
sendDataCpu.value = data
|
|
542
|
-
sendData()
|
|
543
|
-
}
|
|
544
|
-
const sendDataMemory = ref<UI_I_SendDataMemory | null>(null)
|
|
545
|
-
const onSendDataMemoryMethod = (data: UI_I_SendDataMemory): void => {
|
|
546
|
-
sendDataMemory.value = data
|
|
547
|
-
sendData()
|
|
548
|
-
}
|
|
549
|
-
const sendDataNewHardDisk = ref<UI_I_SendDataNewHardDisk[]>([])
|
|
550
|
-
const onSendDataNewHardDiskMethod = (
|
|
551
|
-
data: UI_I_SendDataNewHardDisk,
|
|
552
|
-
index: number
|
|
553
|
-
): void => {
|
|
554
|
-
sendDataNewHardDisk.value[index] = data
|
|
555
|
-
sendData()
|
|
556
|
-
}
|
|
557
|
-
const sendDataNewNetwork = ref<UI_I_SendDataNewNetwork[]>([])
|
|
558
|
-
const sendDataNewNetworkMethod = (
|
|
559
|
-
data: UI_I_SendDataNewNetwork,
|
|
560
|
-
index: number
|
|
561
|
-
): void => {
|
|
562
|
-
sendDataNewNetwork.value[index] = data
|
|
563
|
-
sendData()
|
|
564
|
-
}
|
|
565
|
-
const sendDataNewCdDvdDrive = ref<UI_I_SendDataNewCdDvdDrive[]>([])
|
|
566
|
-
const sendDataNewCdDvdDriveMethod = (
|
|
567
|
-
data: UI_I_SendDataNewCdDvdDrive,
|
|
568
|
-
index: number
|
|
569
|
-
): void => {
|
|
570
|
-
sendDataNewCdDvdDrive.value[index] = data
|
|
571
|
-
sendData()
|
|
572
|
-
}
|
|
573
|
-
const sendDataNewUsbController = ref<string | null>(null)
|
|
574
|
-
const onSendDataNewUsbControllerMethod = (data: string): void => {
|
|
575
|
-
sendDataNewUsbController.value = data
|
|
576
|
-
sendData()
|
|
577
|
-
}
|
|
578
|
-
const sendDataNewPciDevices = ref<UI_I_SendDataNewPciDevice[]>([])
|
|
579
|
-
const onSendDataPciDevicesMethod = (
|
|
580
|
-
data: UI_I_SendDataNewPciDevice,
|
|
581
|
-
index: number
|
|
582
|
-
): void => {
|
|
583
|
-
sendDataNewPciDevices.value[index] = data
|
|
584
|
-
sendData()
|
|
585
|
-
}
|
|
586
|
-
const sendDataVideoCard = ref<UI_I_SendDataVideoCard | null>(null)
|
|
587
|
-
const onSendDataVideoCardMethod = (data: UI_I_SendDataVideoCard): void => {
|
|
588
|
-
sendDataVideoCard.value = data
|
|
589
|
-
sendData()
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
const sendData = (): void => {
|
|
593
|
-
const cpu = sendDataCpu.value
|
|
594
|
-
const memory = sendDataMemory.value
|
|
595
|
-
const hardDisks = sendDataNewHardDisk.value.flat(2)
|
|
596
|
-
const networks = sendDataNewNetwork.value.flat(2)
|
|
597
|
-
const cdDvdDrives = sendDataNewCdDvdDrive.value.flat(2)
|
|
598
|
-
const pciDevices = sendDataNewPciDevices.value.flat()
|
|
599
|
-
const usbController = sendDataNewUsbController.value
|
|
600
|
-
const videoCard = sendDataVideoCard.value
|
|
601
|
-
|
|
602
|
-
const sendData: UI_I_SendDataVirtualHardware = {
|
|
603
|
-
cpu,
|
|
604
|
-
memory,
|
|
605
|
-
usbController,
|
|
606
|
-
pciDevices,
|
|
607
|
-
networks,
|
|
608
|
-
hardDisks,
|
|
609
|
-
cdDvdDrives,
|
|
610
|
-
videoCard,
|
|
611
|
-
}
|
|
612
|
-
emits('send-data', sendData)
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
const onSetInvalidHardDisk = (invalid: boolean, index: number): void => {
|
|
616
|
-
newHardDiskInvalidKeys.value[index] = invalid
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
const onSetInvalidNetwork = (invalid: boolean, key: number): void => {
|
|
620
|
-
newNetworkInvalidKeys.value[key] = invalid
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
const onSetInvalidPciDevice = (invalid: boolean, key: number): void => {
|
|
624
|
-
newPciDeviceInvalidKeys.value[key] = invalid
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
const memoryInvalid = ref<boolean>(false)
|
|
628
|
-
const videoCardInvalid = ref<boolean>(false)
|
|
629
|
-
const newHardDiskInvalidKeys = ref<UI_I_InvalidKeys>({})
|
|
630
|
-
const newNetworkInvalidKeys = ref<UI_I_InvalidKeys>({})
|
|
631
|
-
const newPciDeviceInvalidKeys = ref<UI_I_InvalidKeys>({})
|
|
632
|
-
|
|
633
|
-
watch(
|
|
634
|
-
[
|
|
635
|
-
cpuInvalid,
|
|
636
|
-
memoryInvalid,
|
|
637
|
-
newHardDiskInvalidKeys,
|
|
638
|
-
newNetworkInvalidKeys,
|
|
639
|
-
newPciDeviceInvalidKeys,
|
|
640
|
-
videoCardInvalid,
|
|
641
|
-
],
|
|
642
|
-
() => {
|
|
643
|
-
const cpu = cpuInvalid.value ? localization.value.common.cpu : ''
|
|
644
|
-
const memory = memoryInvalid.value ? localization.value.common.memory : ''
|
|
645
|
-
const videoCard = videoCardInvalid.value
|
|
646
|
-
? localization.value.common.videoCard
|
|
647
|
-
: ''
|
|
648
|
-
let newHardDisk = ''
|
|
649
|
-
Object.keys(newHardDiskInvalidKeys.value).forEach((key) => {
|
|
650
|
-
if (!newHardDiskInvalidKeys.value[+key]) {
|
|
651
|
-
return
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
newHardDisk +=
|
|
655
|
-
(newHardDisk ? ', ' : '') +
|
|
656
|
-
localization.value.common.newHardDisk +
|
|
657
|
-
' ' +
|
|
658
|
-
(+key + 1)
|
|
659
|
-
})
|
|
660
|
-
let newNetwork = ''
|
|
661
|
-
Object.keys(newNetworkInvalidKeys.value).forEach((key) => {
|
|
662
|
-
if (!newNetworkInvalidKeys.value[+key]) {
|
|
663
|
-
return
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
newNetwork +=
|
|
667
|
-
(newNetwork ? ', ' : '') +
|
|
668
|
-
localization.value.common.newNetwork +
|
|
669
|
-
' ' +
|
|
670
|
-
(+key + 1)
|
|
671
|
-
})
|
|
672
|
-
// let pciDevice = ''
|
|
673
|
-
// Object.keys(newPciDeviceInvalidKeys.value).forEach((key) => {
|
|
674
|
-
// if (!newPciDeviceInvalidKeys.value[+key]) {
|
|
675
|
-
// return
|
|
676
|
-
// }
|
|
677
|
-
//
|
|
678
|
-
// pciDevice +=
|
|
679
|
-
// (pciDevice ? ', ' : '') +
|
|
680
|
-
// localization.value.common.pciDevice +
|
|
681
|
-
// ' ' +
|
|
682
|
-
// (+key + 1)
|
|
683
|
-
// })
|
|
684
|
-
|
|
685
|
-
emits('invalid', [cpu, memory, newHardDisk, newNetwork, videoCard])
|
|
686
|
-
},
|
|
687
|
-
{ deep: true }
|
|
688
|
-
)
|
|
689
|
-
|
|
690
|
-
emits('get-pci-devices')
|
|
691
|
-
</script>
|
|
692
|
-
|
|
693
|
-
<style scoped lang="scss">
|
|
694
|
-
.virtual-hardware {
|
|
695
|
-
.content-dropdown {
|
|
696
|
-
width: 200px;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
.stack-view {
|
|
700
|
-
background-color: var(--block-view-bg-color);
|
|
701
|
-
}
|
|
702
|
-
</style>
|