bfg-common 1.5.573 → 1.5.575
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/CODE_STYLE.md +109 -109
- package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
- package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
- package/assets/img/icons/icons-sprite-light-3.svg +227 -227
- package/assets/img/icons/icons-sprite-light-5.svg +488 -488
- package/assets/localization/local_be.json +29 -6
- package/assets/localization/local_en.json +29 -6
- package/assets/localization/local_hy.json +29 -6
- package/assets/localization/local_kk.json +29 -6
- package/assets/localization/local_ru.json +29 -6
- package/assets/localization/local_zh.json +30 -7
- package/components/atoms/TheIcon3.vue +50 -50
- package/components/atoms/collapse/CollapseNav.vue +170 -170
- package/components/atoms/perPage/PerPage.vue +58 -58
- package/components/atoms/table/dataGrid/DataGrid.vue +1718 -1718
- package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
- package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
- package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
- package/components/common/backup/storage/actions/add/Add.vue +3 -2
- package/components/common/backup/storage/actions/add/New.vue +3 -2
- package/components/common/backup/storage/actions/add/Old.vue +5 -4
- package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
- package/components/common/backup/storage/actions/add/steps/readyComplete/ReadyComplete.vue +45 -45
- package/components/common/backup/storage/actions/add/steps/readyComplete/lib/config/propertiesDetails.ts +7 -7
- package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
- package/components/common/diagramMain/DiagramMain.vue +1 -1
- package/components/common/diagramMain/modals/lib/config/portModal.ts +251 -251
- package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
- package/components/common/diagramMain/port/Port.vue +580 -580
- package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
- package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
- package/components/common/modals/confirmByInput/ConfirmByInput.vue +9 -1
- package/components/common/modals/confirmByInput/ConfirmByInputNew.vue +7 -2
- package/components/common/monitor/overview/filters/lib/config/filterOptions.ts +1 -0
- package/components/common/pages/backups/DetailView.vue +52 -52
- package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
- package/components/common/pages/backups/modals/Modals.vue +243 -243
- package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +1 -1
- package/components/common/pages/backups/modals/createBackup/New.vue +8 -2
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
- package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
- package/components/common/pages/backups/modals/createBackup/lib/config/steps.ts +2 -1
- package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
- package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
- package/components/common/pages/backups/modals/restore/Restore.vue +9 -5
- package/components/common/pages/backups/modals/restore/RestoreNew.vue +13 -3
- package/components/common/pages/backups/modals/restore/RestoreOld.vue +6 -18
- package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
- package/components/common/pages/home/lib/models/interfaces.ts +48 -48
- package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
- package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
- package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
- package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
- package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
- package/components/common/pages/scheduledTasks/table/Table.vue +1 -1
- package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
- package/components/common/select/radio/RadioGroup.vue +137 -137
- package/components/common/spiceConsole/Drawer.vue +420 -420
- package/components/common/spiceConsole/SpiceConsole.vue +184 -184
- package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
- package/components/common/tools/Actions.vue +207 -207
- package/components/common/treeView/TreeView.vue +52 -52
- package/components/common/vm/actions/add/Add.vue +127 -52
- package/components/common/vm/actions/add/New.vue +54 -16
- package/components/common/vm/actions/add/Old.vue +55 -16
- package/components/common/vm/actions/add/lib/config/steps.ts +347 -347
- package/components/common/vm/actions/clone/Clone.vue +121 -48
- package/components/common/vm/actions/clone/new/New.vue +50 -14
- package/components/common/vm/actions/clone/old/Old.vue +52 -16
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +81 -14
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +56 -7
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +56 -8
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +206 -208
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +120 -223
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +118 -218
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +53 -66
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/lib/config/options.ts +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +159 -139
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +15 -8
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuOld.vue +13 -8
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +75 -62
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryNew.vue +158 -158
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryOld.vue +155 -155
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +149 -241
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +4 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +3 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +96 -58
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +17 -6
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +3 -6
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerOld.vue +3 -6
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +39 -17
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +5 -6
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +5 -6
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options.ts +4 -4
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
- package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +93 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +62 -8
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +60 -8
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +69 -5
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +32 -12
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsOld.vue +33 -12
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +132 -114
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +6 -41
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderOld.vue +6 -44
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +23 -8
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +31 -21
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +34 -26
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +34 -28
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/Old.vue +30 -24
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +112 -8
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +3 -3
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{New.vue → KeymapNew.vue} +6 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{Old.vue → KeymapOld.vue} +5 -5
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +7 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +38 -4
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsNew.vue +26 -7
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsOld.vue +50 -24
- package/components/common/vm/actions/common/lib/models/interfaces.ts +25 -57
- package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
- package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
- package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/os/New.vue +19 -0
- package/components/common/vm/actions/common/select/os/Old.vue +34 -0
- package/components/common/vm/actions/common/select/os/Os.vue +25 -0
- package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
- package/components/common/vm/actions/common/select/storage/Storage.vue +178 -178
- package/components/common/vm/actions/common/select/storage/new/New.vue +311 -311
- package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
- package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
- package/components/common/vm/actions/editSettings/EditSettings.vue +90 -32
- package/components/common/vm/actions/editSettings/EditSettingsOld.vue +41 -14
- package/components/common/vm/actions/editSettings/new/New.vue +41 -14
- package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
- package/components/common/vm/actions/lib/models/interfaces.ts +29 -4
- package/components/common/vm/actions/lib/utils.ts +36 -64
- package/components/common/vm/actions/register/Register.vue +352 -352
- package/components/common/vm/actions/register/lib/config/steps.ts +86 -86
- package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
- package/components/common/wizards/common/compatibility/New.vue +99 -99
- package/components/common/wizards/common/compatibility/Old.vue +53 -53
- package/components/common/wizards/common/steps/computeResource/ComputeResource.vue +86 -86
- package/components/common/wizards/common/steps/computeResource/New.vue +93 -93
- package/components/common/wizards/common/steps/computeResource/Old.vue +103 -103
- package/components/common/wizards/common/steps/name/Name.vue +178 -178
- package/components/common/wizards/common/steps/name/New.vue +221 -221
- package/components/common/wizards/common/steps/name/Old.vue +121 -121
- package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
- package/components/common/wizards/common/steps/name/location/Location.vue +85 -85
- package/components/common/wizards/common/steps/name/location/New.vue +40 -40
- package/components/common/wizards/datastore/add/Add.vue +228 -228
- package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
- package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
- package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +205 -205
- package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
- package/composables/useAppVersion.ts +21 -21
- package/composables/useLocal.ts +6 -6
- package/composables/useLocalCommon.ts +39 -39
- package/package.json +3 -1
- package/plugins/console.ts +21 -21
- package/plugins/date.ts +233 -233
- package/plugins/mouse.ts +21 -21
- package/plugins/panelStates.ts +70 -70
- package/plugins/text.ts +59 -59
- package/public/spice-console/application/clientgui.js +854 -854
- package/public/spice-console/application/packetfactory.js +211 -211
- package/public/spice-console/application/virtualmouse.js +147 -147
- package/public/spice-console/lib/images/bitmap.js +203 -203
- package/public/spice-console/network/spicechannel.js +440 -440
- package/public/spice-console/process/cursorprocess.js +121 -121
- package/public/spice-console/process/inputprocess.js +227 -227
- package/public/spice-console/process/mainprocess.js +210 -210
- package/public/spice-console/run.js +210 -210
- package/store/main/mutations.ts +7 -7
- package/store/main/state.ts +7 -7
- package/store/tasks/mappers/recentTasks.ts +4 -0
- /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{New.vue → PasswordNew.vue} +0 -0
- /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{Old.vue → PasswordOld.vue} +0 -0
package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<common-vm-actions-common-customize-hardware-virtual-hardware-new
|
|
3
3
|
v-if="isNewView"
|
|
4
|
-
v-model="model"
|
|
5
4
|
v-model:cpu-invalid="cpuInvalid"
|
|
6
5
|
v-model:memory-invalid="memoryInvalid"
|
|
7
6
|
v-model:video-card-invalid="videoCardInvalid"
|
|
@@ -10,6 +9,7 @@
|
|
|
10
9
|
:is-edit="props.isEdit"
|
|
11
10
|
:storage="props.storage"
|
|
12
11
|
:project="props.project"
|
|
12
|
+
:max-cpus="props.maxCpus"
|
|
13
13
|
:max-memory="props.maxMemory"
|
|
14
14
|
:cpu-models="props.cpuModels"
|
|
15
15
|
:datastore="props.datastore"
|
|
@@ -27,9 +27,15 @@
|
|
|
27
27
|
:cd-dvd-drives-index="cdDvdDrivesIndex"
|
|
28
28
|
:error-validation-fields="errorValidationFields"
|
|
29
29
|
:get-datastore-table-func="getDatastoreTableFunc"
|
|
30
|
+
:cpu="cpu"
|
|
30
31
|
:state="state"
|
|
32
|
+
:memory="memory"
|
|
33
|
+
:networks="networksLocal"
|
|
34
|
+
:hard-disks="hardDisksLocal"
|
|
31
35
|
:video-card="videoCard"
|
|
32
36
|
:pci-devices="pciDevicesLocal"
|
|
37
|
+
:cd-dvd-drives="cdDvdDrivesLocal"
|
|
38
|
+
:usb-controller="usbController"
|
|
33
39
|
:guest-machine-type="guestMachineType"
|
|
34
40
|
:passthrough-devices="passthroughDevices"
|
|
35
41
|
:mediated-devices="mediatedDevices"
|
|
@@ -49,18 +55,22 @@
|
|
|
49
55
|
@remove-cd-dvd-drive="onRemoveCdDvdDrive(...$event)"
|
|
50
56
|
@show-datastore-child="emits('show-datastore-child', $event)"
|
|
51
57
|
@get-folders-or-files="emits('get-folders-or-files', $event)"
|
|
58
|
+
@send-data-cpu-method="onSendDataCpuMethod"
|
|
52
59
|
@set-invalid-hard-disk="onSetInvalidHardDisk(...$event)"
|
|
53
60
|
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
54
61
|
@roll-back-cd-dvd-drive="onRollBackCdDvdDrive"
|
|
55
62
|
@set-invalid-pci-device="onSetInvalidPciDevice(...$event)"
|
|
56
63
|
@get-active-device-child="emits('get-active-device-child', $event)"
|
|
64
|
+
@send-data-memory-method="onSendDataMemoryMethod"
|
|
65
|
+
@send-data-video-card-method="onSendDataVideoCardMethod"
|
|
66
|
+
@send-data-new-network-method="sendDataNewNetworkMethod(...$event)"
|
|
57
67
|
@send-data-pci-devices-method="onSendDataPciDevicesMethod(...$event)"
|
|
58
68
|
@send-data-new-hard-disk-method="onSendDataNewHardDiskMethod(...$event)"
|
|
59
69
|
@send-data-new-cd-dvd-drive-method="sendDataNewCdDvdDriveMethod(...$event)"
|
|
70
|
+
@send-data-new-usb-controller-method="onSendDataNewUsbControllerMethod"
|
|
60
71
|
/>
|
|
61
72
|
<common-vm-actions-common-customize-hardware-virtual-hardware-old
|
|
62
73
|
v-else
|
|
63
|
-
v-model="model"
|
|
64
74
|
v-model:cpu-invalid="cpuInvalid"
|
|
65
75
|
v-model:memory-invalid="memoryInvalid"
|
|
66
76
|
v-model:video-card-invalid="videoCardInvalid"
|
|
@@ -69,6 +79,7 @@
|
|
|
69
79
|
:is-edit="props.isEdit"
|
|
70
80
|
:storage="props.storage"
|
|
71
81
|
:project="props.project"
|
|
82
|
+
:max-cpus="props.maxCpus"
|
|
72
83
|
:max-memory="props.maxMemory"
|
|
73
84
|
:cpu-models="props.cpuModels"
|
|
74
85
|
:datastore="props.datastore"
|
|
@@ -86,9 +97,15 @@
|
|
|
86
97
|
:cd-dvd-drives-index="cdDvdDrivesIndex"
|
|
87
98
|
:error-validation-fields="errorValidationFields"
|
|
88
99
|
:get-datastore-table-func="getDatastoreTableFunc"
|
|
100
|
+
:cpu="cpu"
|
|
89
101
|
:state="state"
|
|
102
|
+
:memory="memory"
|
|
103
|
+
:networks="networksLocal"
|
|
104
|
+
:hard-disks="hardDisksLocal"
|
|
90
105
|
:video-card="videoCard"
|
|
91
106
|
:pci-devices="pciDevicesLocal"
|
|
107
|
+
:cd-dvd-drives="cdDvdDrivesLocal"
|
|
108
|
+
:usb-controller="usbController"
|
|
92
109
|
:guest-machine-type="guestMachineType"
|
|
93
110
|
:passthrough-devices="passthroughDevices"
|
|
94
111
|
:mediated-devices="mediatedDevices"
|
|
@@ -107,14 +124,19 @@
|
|
|
107
124
|
@remove-cd-dvd-drive="onRemoveCdDvdDrive(...$event)"
|
|
108
125
|
@show-datastore-child="emits('show-datastore-child', $event)"
|
|
109
126
|
@get-folders-or-files="emits('get-folders-or-files', $event)"
|
|
127
|
+
@send-data-cpu-method="onSendDataCpuMethod"
|
|
110
128
|
@set-invalid-hard-disk="onSetInvalidHardDisk(...$event)"
|
|
111
129
|
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
112
130
|
@roll-back-cd-dvd-drive="onRollBackCdDvdDrive"
|
|
113
131
|
@set-invalid-pci-device="onSetInvalidPciDevice(...$event)"
|
|
114
132
|
@get-active-device-child="emits('get-active-device-child', $event)"
|
|
133
|
+
@send-data-memory-method="onSendDataMemoryMethod"
|
|
134
|
+
@send-data-video-card-method="onSendDataVideoCardMethod"
|
|
135
|
+
@send-data-new-network-method="sendDataNewNetworkMethod(...$event)"
|
|
115
136
|
@send-data-pci-devices-method="onSendDataPciDevicesMethod(...$event)"
|
|
116
137
|
@send-data-new-hard-disk-method="onSendDataNewHardDiskMethod(...$event)"
|
|
117
138
|
@send-data-new-cd-dvd-drive-method="sendDataNewCdDvdDriveMethod(...$event)"
|
|
139
|
+
@send-data-new-usb-controller-method="onSendDataNewUsbControllerMethod"
|
|
118
140
|
/>
|
|
119
141
|
</template>
|
|
120
142
|
|
|
@@ -126,9 +148,13 @@ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
|
|
|
126
148
|
import type { UI_I_FolderOrFileTreePayload } from '~/lib/models/store/storage/interfaces'
|
|
127
149
|
import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
|
|
128
150
|
import type {
|
|
151
|
+
UI_I_SendDataCpu,
|
|
152
|
+
UI_I_SendDataMemory,
|
|
129
153
|
UI_I_SendDataNewHardDisk,
|
|
154
|
+
UI_I_SendDataNewNetwork,
|
|
130
155
|
UI_I_SendDataVideoCard,
|
|
131
156
|
UI_I_InvalidKeys,
|
|
157
|
+
UI_I_SendDataVirtualHardware,
|
|
132
158
|
UI_I_SendDataNewCdDvdDrive,
|
|
133
159
|
// UI_I_HardDisk,
|
|
134
160
|
UI_I_SendDataNewPciDevice,
|
|
@@ -146,23 +172,23 @@ import type {
|
|
|
146
172
|
} from '~/components/atoms/dropdown/tree/lib/models/interfaces'
|
|
147
173
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
148
174
|
import type {
|
|
175
|
+
API_UI_I_VmEditCpu,
|
|
176
|
+
API_UI_I_VmEditMemory,
|
|
149
177
|
UI_I_MediatedDevice,
|
|
150
178
|
UI_I_PciDevice,
|
|
151
179
|
} from '~/lib/models/store/vm/interfaces'
|
|
152
180
|
import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
|
|
153
|
-
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
154
181
|
import { dropdownItemsFunc } from './lib/config/dropdownItems'
|
|
155
182
|
|
|
156
|
-
const model = defineModel<UI_I_CreateVmData>({ required: true })
|
|
157
|
-
|
|
158
183
|
const props = withDefaults(
|
|
159
184
|
defineProps<{
|
|
160
185
|
storage: UI_I_DatastoreTableItem | null
|
|
161
186
|
cpuModels: UI_I_OptionItem[]
|
|
187
|
+
maxCpus: number
|
|
162
188
|
maxMemory: number
|
|
163
189
|
isEdit: boolean
|
|
164
190
|
isClone: boolean
|
|
165
|
-
errorValidationFields: UI_I_ErrorValidationField[]
|
|
191
|
+
errorValidationFields: UI_I_ErrorValidationField<string>[]
|
|
166
192
|
nodes: UI_I_FileTreeNode[]
|
|
167
193
|
files: UI_I_FileTreeNode[]
|
|
168
194
|
networksTable: UI_I_NetworkTableItem[]
|
|
@@ -171,10 +197,14 @@ const props = withDefaults(
|
|
|
171
197
|
isDatastoreLoading: boolean
|
|
172
198
|
project: UI_T_Project
|
|
173
199
|
state?: string | number
|
|
200
|
+
cpu?: API_UI_I_VmEditCpu
|
|
201
|
+
memory?: API_UI_I_VmEditMemory
|
|
174
202
|
vmCpuHelpTextSecond?: string
|
|
175
203
|
hardDisks?: UI_I_SendDataNewHardDisk[] | null
|
|
176
204
|
cdDvdDrives?: UI_I_SendDataNewCdDvdDrive[] | null
|
|
205
|
+
networks?: UI_I_SendDataNewNetwork[] | null
|
|
177
206
|
videoCard?: UI_I_SendDataVideoCard
|
|
207
|
+
usbController?: string
|
|
178
208
|
pciDevices?: UI_I_SendDataNewPciDevice[]
|
|
179
209
|
passthroughDevices?: UI_I_PciDevice[]
|
|
180
210
|
mediatedDevices?: UI_I_MediatedDevice[]
|
|
@@ -184,10 +214,14 @@ const props = withDefaults(
|
|
|
184
214
|
}>(),
|
|
185
215
|
{
|
|
186
216
|
state: undefined,
|
|
217
|
+
cpu: undefined,
|
|
218
|
+
memory: undefined,
|
|
187
219
|
vmCpuHelpTextSecond: undefined,
|
|
188
220
|
hardDisks: undefined,
|
|
189
221
|
cdDvdDrives: undefined,
|
|
222
|
+
networks: undefined,
|
|
190
223
|
videoCard: undefined,
|
|
224
|
+
usbController: undefined,
|
|
191
225
|
pciDevices: undefined,
|
|
192
226
|
passthroughDevices: undefined,
|
|
193
227
|
mediatedDevices: undefined,
|
|
@@ -197,6 +231,7 @@ const props = withDefaults(
|
|
|
197
231
|
}
|
|
198
232
|
)
|
|
199
233
|
const emits = defineEmits<{
|
|
234
|
+
(event: 'send-data', value: UI_I_SendDataVirtualHardware): void
|
|
200
235
|
(event: 'invalid', value: string[]): void
|
|
201
236
|
(event: 'get-storage', value: UI_I_TablePayload): void
|
|
202
237
|
(event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
|
|
@@ -223,57 +258,38 @@ const dropdownItems = computed<UI_I_DropdownTreeItem[]>(() =>
|
|
|
223
258
|
|
|
224
259
|
const hardDisksIndex = ref<number[]>([0])
|
|
225
260
|
const hardDisksType = ref<UI_T_HardDiskType[]>(['new'])
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
model.value.disk_devices
|
|
239
|
-
.filter((disk) => disk.device_type !== 'cdrom')
|
|
240
|
-
.forEach((_disk, _index, array) => {
|
|
241
|
-
if (!props.isEdit && !props.isClone) return
|
|
242
|
-
|
|
243
|
-
const count = array.length
|
|
244
|
-
hardDisksIndex.value = [...Array(count).keys()]
|
|
245
|
-
if (props.isEdit) {
|
|
246
|
-
hardDisksType.value = Array(count).fill('edit')
|
|
247
|
-
} else if (props.isClone) {
|
|
248
|
-
hardDisksType.value = Array(count).fill('clone')
|
|
249
|
-
}
|
|
250
|
-
})
|
|
251
|
-
}
|
|
261
|
+
const hardDisksLocal = ref<UI_I_SendDataNewHardDisk[]>([
|
|
262
|
+
{
|
|
263
|
+
create: true,
|
|
264
|
+
size: 90,
|
|
265
|
+
source: '',
|
|
266
|
+
boot_order: -1,
|
|
267
|
+
},
|
|
268
|
+
])
|
|
269
|
+
watch(
|
|
270
|
+
() => props.hardDisks,
|
|
271
|
+
(newValue) => {
|
|
272
|
+
if ((!props.isEdit && !props.isClone) || !newValue) return
|
|
252
273
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
// })
|
|
269
|
-
// }
|
|
270
|
-
// },
|
|
271
|
-
// { immediate: true }
|
|
272
|
-
// )
|
|
274
|
+
const count = newValue?.length || 0
|
|
275
|
+
hardDisksIndex.value = [...Array(count).keys()]
|
|
276
|
+
hardDisksLocal.value = newValue
|
|
277
|
+
if (props.isEdit) {
|
|
278
|
+
hardDisksType.value = Array(count).fill('edit')
|
|
279
|
+
} else if (props.isClone) {
|
|
280
|
+
hardDisksType.value = Array(count).fill('clone')
|
|
281
|
+
hardDisksLocal.value = newValue.map((hardDisk) => {
|
|
282
|
+
hardDisk.create = true
|
|
283
|
+
return hardDisk
|
|
284
|
+
})
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
{ immediate: true }
|
|
288
|
+
)
|
|
273
289
|
|
|
274
290
|
const addHardDisk = (
|
|
275
291
|
create = true,
|
|
276
|
-
size =
|
|
292
|
+
size = 90,
|
|
277
293
|
source = '',
|
|
278
294
|
type: UI_T_HardDiskType = 'new',
|
|
279
295
|
provisioned_type?: number // При добавлении существующей
|
|
@@ -285,43 +301,15 @@ const addHardDisk = (
|
|
|
285
301
|
let provisionType = 'thick'
|
|
286
302
|
if (provisioned_type === 1) provisionType = 'thin'
|
|
287
303
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
//
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
// },
|
|
298
|
-
{
|
|
299
|
-
create,
|
|
300
|
-
size,
|
|
301
|
-
source,
|
|
302
|
-
bus: 'virtio',
|
|
303
|
-
storage_id: '',
|
|
304
|
-
provision_type: 'thick',
|
|
305
|
-
disk_mode: 'dependent',
|
|
306
|
-
boot_order: 0, // Убираем галочку
|
|
307
|
-
device_type: 'disk',
|
|
308
|
-
sharing: false,
|
|
309
|
-
shares: 0,
|
|
310
|
-
cache: 'none',
|
|
311
|
-
io: '',
|
|
312
|
-
limit_iops: 0,
|
|
313
|
-
attach: true,
|
|
314
|
-
},
|
|
315
|
-
...model.value.disk_devices.filter((disk) => disk.device_type === 'cdrom'),
|
|
316
|
-
]
|
|
317
|
-
// hardDisksLocal.value.push({
|
|
318
|
-
// create,
|
|
319
|
-
// size,
|
|
320
|
-
// source,
|
|
321
|
-
// attach: true,
|
|
322
|
-
// boot_order: 0, // Убираем галочку
|
|
323
|
-
// provision_type: provisionType,
|
|
324
|
-
// })
|
|
304
|
+
hardDisksLocal.value.push({
|
|
305
|
+
create,
|
|
306
|
+
size,
|
|
307
|
+
source,
|
|
308
|
+
attach: true,
|
|
309
|
+
boot_order: 0, // Убираем галочку
|
|
310
|
+
provision_type: provisionType,
|
|
311
|
+
})
|
|
312
|
+
sendData()
|
|
325
313
|
}
|
|
326
314
|
const onAddExistHardDisk = (file: UI_I_FileTreeNode): void => {
|
|
327
315
|
addHardDisk(
|
|
@@ -343,6 +331,7 @@ const onRemoveHardDisk = (
|
|
|
343
331
|
if (key === removeIndex) return 'removed'
|
|
344
332
|
return item
|
|
345
333
|
})
|
|
334
|
+
sendData()
|
|
346
335
|
return
|
|
347
336
|
}
|
|
348
337
|
|
|
@@ -351,18 +340,15 @@ const onRemoveHardDisk = (
|
|
|
351
340
|
(_item, key) => key !== removeIndex
|
|
352
341
|
)
|
|
353
342
|
|
|
354
|
-
|
|
343
|
+
hardDisksLocal.value = hardDisksLocal.value.filter(
|
|
355
344
|
(_hardDisk, key: number) => {
|
|
356
345
|
return removeIndex !== key
|
|
357
346
|
}
|
|
358
347
|
)
|
|
359
|
-
// hardDisksLocal.value = hardDisksLocal.value.filter(
|
|
360
|
-
// (_hardDisk, key: number) => {
|
|
361
|
-
// return removeIndex !== key
|
|
362
|
-
// }
|
|
363
|
-
// )
|
|
364
348
|
|
|
365
349
|
delete newHardDiskInvalidKeys.value[index]
|
|
350
|
+
delete sendDataNewHardDisk.value[index]
|
|
351
|
+
sendData()
|
|
366
352
|
}
|
|
367
353
|
const onRollBackHardDisk = (index: number): void => {
|
|
368
354
|
const removeIndex = hardDisksIndex.value.indexOf(index)
|
|
@@ -372,40 +358,51 @@ const onRollBackHardDisk = (index: number): void => {
|
|
|
372
358
|
})
|
|
373
359
|
}
|
|
374
360
|
|
|
361
|
+
const defaultNetwork = {
|
|
362
|
+
network: '',
|
|
363
|
+
net_bridge: '',
|
|
364
|
+
mac: '',
|
|
365
|
+
target: '',
|
|
366
|
+
model: '',
|
|
367
|
+
boot_order: -1,
|
|
368
|
+
}
|
|
369
|
+
const networksLocal = ref<UI_I_SendDataNewNetwork[]>([
|
|
370
|
+
useDeepCopy(defaultNetwork),
|
|
371
|
+
])
|
|
375
372
|
const networksType = ref<UI_T_NetworkType[]>(['new'])
|
|
376
373
|
const networksIndex = ref<number[]>([0])
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
} else {
|
|
381
|
-
model.value.network_devices.forEach(() => {
|
|
374
|
+
watch(
|
|
375
|
+
() => props.networks,
|
|
376
|
+
(newValue) => {
|
|
382
377
|
if (!props.isEdit && !props.isClone) return
|
|
378
|
+
if (!newValue) {
|
|
379
|
+
networksLocal.value = []
|
|
380
|
+
networksType.value = []
|
|
381
|
+
networksIndex.value = []
|
|
382
|
+
return
|
|
383
|
+
}
|
|
383
384
|
|
|
384
|
-
|
|
385
|
+
// networksLocal.value = newValue
|
|
386
|
+
// networksType.value = Array(newValue.length).fill('edit')
|
|
387
|
+
const count = newValue?.length || 0
|
|
385
388
|
networksIndex.value = [...Array(count).keys()]
|
|
389
|
+
networksLocal.value = newValue
|
|
386
390
|
if (props.isEdit) {
|
|
387
391
|
networksType.value = Array(count).fill('edit')
|
|
388
392
|
} else if (props.isClone) {
|
|
389
393
|
networksType.value = Array(count).fill('clone')
|
|
390
394
|
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
const defaultNetwork = {
|
|
395
|
-
network: '',
|
|
396
|
-
net_bridge: '',
|
|
397
|
-
mac: '',
|
|
398
|
-
target: '',
|
|
399
|
-
model: 'rtl8139',
|
|
400
|
-
boot_order: 0,
|
|
401
|
-
}
|
|
395
|
+
},
|
|
396
|
+
{ immediate: true }
|
|
397
|
+
)
|
|
402
398
|
const addNetwork = (): void => {
|
|
403
399
|
const index = (networksIndex.value.at(-1) ?? -1) + 1
|
|
404
400
|
networksIndex.value.push(index)
|
|
405
401
|
networksType.value.push('new')
|
|
406
402
|
|
|
407
|
-
|
|
403
|
+
networksLocal.value.push({
|
|
408
404
|
...useDeepCopy(defaultNetwork),
|
|
405
|
+
boot_order: 0, // Убираем галочку
|
|
409
406
|
})
|
|
410
407
|
}
|
|
411
408
|
const onRemoveNetwork = (index: number): void => {
|
|
@@ -414,97 +411,55 @@ const onRemoveNetwork = (index: number): void => {
|
|
|
414
411
|
networksType.value = networksType.value.filter(
|
|
415
412
|
(_item, key) => key !== removeIndex
|
|
416
413
|
)
|
|
417
|
-
|
|
414
|
+
networksLocal.value = networksLocal.value.filter(
|
|
418
415
|
(_network, key: number) => removeIndex !== key
|
|
419
416
|
)
|
|
420
417
|
|
|
421
418
|
delete newNetworkInvalidKeys.value[index]
|
|
419
|
+
delete sendDataNewNetwork.value[index]
|
|
420
|
+
sendData()
|
|
422
421
|
}
|
|
423
422
|
|
|
424
|
-
// const defaultCdDvdDriver: UI_I_SendDataNewCdDvdDrive = {
|
|
425
|
-
// create: false,
|
|
426
|
-
// attach: false,
|
|
427
|
-
// source: '',
|
|
428
|
-
// bus: '',
|
|
429
|
-
// device_type: 'cdrom',
|
|
430
|
-
// boot_order: -1,
|
|
431
|
-
// }
|
|
432
423
|
const defaultCdDvdDriver: UI_I_SendDataNewCdDvdDrive = {
|
|
424
|
+
create: false,
|
|
425
|
+
attach: false,
|
|
433
426
|
source: '',
|
|
434
|
-
storage_id: '',
|
|
435
|
-
device_type: 'cdrom',
|
|
436
427
|
bus: '',
|
|
437
|
-
|
|
438
|
-
boot_order:
|
|
439
|
-
provision_type: 'thick',
|
|
440
|
-
disk_mode: 'dependent',
|
|
441
|
-
sharing: false,
|
|
442
|
-
read_only: true,
|
|
443
|
-
shares: 0,
|
|
444
|
-
cache: 'none',
|
|
445
|
-
io: 'native',
|
|
446
|
-
limit_iops: 0,
|
|
447
|
-
discard: 'unmap',
|
|
448
|
-
attach: false,
|
|
449
|
-
detach: false,
|
|
450
|
-
remove: false,
|
|
451
|
-
create: false,
|
|
428
|
+
device_type: 'cdrom',
|
|
429
|
+
boot_order: -1,
|
|
452
430
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
431
|
+
const cdDvdDrivesLocal = ref<UI_I_SendDataNewCdDvdDrive[]>([
|
|
432
|
+
useDeepCopy(defaultCdDvdDriver),
|
|
433
|
+
])
|
|
456
434
|
const cdDvdDrivesIndex = ref<number[]>([0])
|
|
457
435
|
const cdDvdDrivesType = ref<UI_T_CdDvdType[]>(['new'])
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
.
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
// watch(
|
|
477
|
-
// () => props.cdDvdDrives,
|
|
478
|
-
// (newValue) => {
|
|
479
|
-
// if ((!props.isEdit && !props.isClone) || !newValue) return
|
|
480
|
-
//
|
|
481
|
-
// // cdDvdDrivesLocal.value = newValue
|
|
482
|
-
// // cdDvdDrivesType.value = Array(newValue.length).fill('edit')
|
|
483
|
-
// const count = newValue?.length || 0
|
|
484
|
-
// cdDvdDrivesIndex.value = [...Array(count).keys()]
|
|
485
|
-
// cdDvdDrivesLocal.value = newValue
|
|
486
|
-
// if (props.isEdit) {
|
|
487
|
-
// cdDvdDrivesType.value = Array(count).fill('edit')
|
|
488
|
-
// } else if (props.isClone) {
|
|
489
|
-
// cdDvdDrivesType.value = Array(count).fill('new')
|
|
490
|
-
// }
|
|
491
|
-
// },
|
|
492
|
-
// { immediate: true }
|
|
493
|
-
// )
|
|
436
|
+
watch(
|
|
437
|
+
() => props.cdDvdDrives,
|
|
438
|
+
(newValue) => {
|
|
439
|
+
if ((!props.isEdit && !props.isClone) || !newValue) return
|
|
440
|
+
|
|
441
|
+
// cdDvdDrivesLocal.value = newValue
|
|
442
|
+
// cdDvdDrivesType.value = Array(newValue.length).fill('edit')
|
|
443
|
+
const count = newValue?.length || 0
|
|
444
|
+
cdDvdDrivesIndex.value = [...Array(count).keys()]
|
|
445
|
+
cdDvdDrivesLocal.value = newValue
|
|
446
|
+
if (props.isEdit) {
|
|
447
|
+
cdDvdDrivesType.value = Array(count).fill('edit')
|
|
448
|
+
} else if (props.isClone) {
|
|
449
|
+
cdDvdDrivesType.value = Array(count).fill('new')
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
{ immediate: true }
|
|
453
|
+
)
|
|
494
454
|
const addCdDvdDrive = (): void => {
|
|
495
455
|
const value = (cdDvdDrivesIndex.value.at(-1) ?? -1) + 1
|
|
496
456
|
cdDvdDrivesIndex.value.push(value)
|
|
497
457
|
cdDvdDrivesType.value.push('new')
|
|
498
|
-
|
|
458
|
+
cdDvdDrivesLocal.value.push({
|
|
499
459
|
...useDeepCopy(defaultCdDvdDriver),
|
|
500
460
|
attach: true,
|
|
501
461
|
boot_order: 0, // Убираем галочку
|
|
502
462
|
})
|
|
503
|
-
// cdDvdDrivesLocal.value.push({
|
|
504
|
-
// ...useDeepCopy(defaultCdDvdDriver),
|
|
505
|
-
// attach: true,
|
|
506
|
-
// boot_order: 0, // Убираем галочку
|
|
507
|
-
// })
|
|
508
463
|
}
|
|
509
464
|
const onRemoveCdDvdDrive = (
|
|
510
465
|
index: number,
|
|
@@ -518,6 +473,7 @@ const onRemoveCdDvdDrive = (
|
|
|
518
473
|
if (key === removeIndex) return 'removed'
|
|
519
474
|
return item
|
|
520
475
|
})
|
|
476
|
+
sendData()
|
|
521
477
|
return
|
|
522
478
|
}
|
|
523
479
|
|
|
@@ -527,12 +483,12 @@ const onRemoveCdDvdDrive = (
|
|
|
527
483
|
cdDvdDrivesType.value = cdDvdDrivesType.value.filter(
|
|
528
484
|
(_item, key) => key !== index
|
|
529
485
|
)
|
|
530
|
-
|
|
486
|
+
cdDvdDrivesLocal.value = cdDvdDrivesLocal.value.filter(
|
|
531
487
|
(_cdDvdDrive, key: number) => removeIndex !== key
|
|
532
488
|
)
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
489
|
+
|
|
490
|
+
delete sendDataNewCdDvdDrive.value[index]
|
|
491
|
+
sendData()
|
|
536
492
|
}
|
|
537
493
|
const onRollBackCdDvdDrive = (index: number): void => {
|
|
538
494
|
const removeIndex = cdDvdDrivesIndex.value.indexOf(index)
|
|
@@ -574,7 +530,6 @@ const addPciDevice = (): void => {
|
|
|
574
530
|
pciDevicesType.value.push('new')
|
|
575
531
|
|
|
576
532
|
pciDevicesLocal.value.push(useDeepCopy(defaultPciDevice))
|
|
577
|
-
model.value.passthrough_pci_devices.push(useDeepCopy(defaultPciDevice))
|
|
578
533
|
}
|
|
579
534
|
const onRemovePciDevice = (index: number): void => {
|
|
580
535
|
const removeIndex = pciDevicesIndex.value.indexOf(index)
|
|
@@ -583,10 +538,6 @@ const onRemovePciDevice = (index: number): void => {
|
|
|
583
538
|
(_item, key) => key !== removeIndex
|
|
584
539
|
)
|
|
585
540
|
|
|
586
|
-
model.value.passthrough_pci_devices =
|
|
587
|
-
model.value.passthrough_pci_devices.filter((_pciDevice, key: number) => {
|
|
588
|
-
return removeIndex !== key
|
|
589
|
-
})
|
|
590
541
|
pciDevicesLocal.value = pciDevicesLocal.value.filter(
|
|
591
542
|
(_pciDevice, key: number) => {
|
|
592
543
|
return removeIndex !== key
|
|
@@ -594,6 +545,8 @@ const onRemovePciDevice = (index: number): void => {
|
|
|
594
545
|
)
|
|
595
546
|
|
|
596
547
|
delete newPciDeviceInvalidKeys.value[index]
|
|
548
|
+
delete sendDataNewPciDevices.value[index]
|
|
549
|
+
sendData()
|
|
597
550
|
}
|
|
598
551
|
|
|
599
552
|
const isShowFileModal = ref<boolean>(false)
|
|
@@ -618,35 +571,80 @@ const onAddDevice = (item: UI_I_DropdownTreeItemChild): void => {
|
|
|
618
571
|
}
|
|
619
572
|
|
|
620
573
|
const cpuInvalid = ref<boolean>(false)
|
|
574
|
+
const sendDataCpu = ref<UI_I_SendDataCpu | null>(null)
|
|
575
|
+
const onSendDataCpuMethod = (data: UI_I_SendDataCpu): void => {
|
|
576
|
+
sendDataCpu.value = data
|
|
577
|
+
sendData()
|
|
578
|
+
}
|
|
579
|
+
const sendDataMemory = ref<UI_I_SendDataMemory | null>(null)
|
|
580
|
+
const onSendDataMemoryMethod = (data: UI_I_SendDataMemory): void => {
|
|
581
|
+
sendDataMemory.value = data
|
|
582
|
+
sendData()
|
|
583
|
+
}
|
|
584
|
+
const sendDataNewHardDisk = ref<UI_I_SendDataNewHardDisk[]>([])
|
|
621
585
|
const onSendDataNewHardDiskMethod = (
|
|
622
586
|
data: UI_I_SendDataNewHardDisk,
|
|
623
587
|
index: number
|
|
624
588
|
): void => {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
boot_order: model.value.disk_devices[index]?.boot_order || 0,
|
|
628
|
-
}
|
|
589
|
+
sendDataNewHardDisk.value[index] = data
|
|
590
|
+
sendData()
|
|
629
591
|
}
|
|
592
|
+
const sendDataNewNetwork = ref<UI_I_SendDataNewNetwork[]>([])
|
|
593
|
+
const sendDataNewNetworkMethod = (
|
|
594
|
+
data: UI_I_SendDataNewNetwork,
|
|
595
|
+
index: number
|
|
596
|
+
): void => {
|
|
597
|
+
sendDataNewNetwork.value[index] = data
|
|
598
|
+
sendData()
|
|
599
|
+
}
|
|
600
|
+
const sendDataNewCdDvdDrive = ref<UI_I_SendDataNewCdDvdDrive[]>([])
|
|
630
601
|
const sendDataNewCdDvdDriveMethod = (
|
|
631
602
|
data: UI_I_SendDataNewCdDvdDrive,
|
|
632
603
|
index: number
|
|
633
604
|
): void => {
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
)
|
|
637
|
-
model.value.disk_devices[cdromIndexStart + index] = {
|
|
638
|
-
...data,
|
|
639
|
-
boot_order:
|
|
640
|
-
model.value.disk_devices[cdromIndexStart + index]?.boot_order || 0,
|
|
641
|
-
}
|
|
605
|
+
sendDataNewCdDvdDrive.value[index] = data
|
|
606
|
+
sendData()
|
|
642
607
|
}
|
|
608
|
+
const sendDataNewUsbController = ref<string | null>(null)
|
|
609
|
+
const onSendDataNewUsbControllerMethod = (data: string): void => {
|
|
610
|
+
sendDataNewUsbController.value = data
|
|
611
|
+
sendData()
|
|
612
|
+
}
|
|
613
|
+
const sendDataNewPciDevices = ref<UI_I_SendDataNewPciDevice[]>([])
|
|
643
614
|
const onSendDataPciDevicesMethod = (
|
|
644
615
|
data: UI_I_SendDataNewPciDevice,
|
|
645
616
|
index: number
|
|
646
617
|
): void => {
|
|
647
|
-
|
|
648
|
-
|
|
618
|
+
sendDataNewPciDevices.value[index] = data
|
|
619
|
+
sendData()
|
|
620
|
+
}
|
|
621
|
+
const sendDataVideoCard = ref<UI_I_SendDataVideoCard | null>(null)
|
|
622
|
+
const onSendDataVideoCardMethod = (data: UI_I_SendDataVideoCard): void => {
|
|
623
|
+
sendDataVideoCard.value = data
|
|
624
|
+
sendData()
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
const sendData = (): void => {
|
|
628
|
+
const cpu = sendDataCpu.value
|
|
629
|
+
const memory = sendDataMemory.value
|
|
630
|
+
const hardDisks = sendDataNewHardDisk.value.flat(2)
|
|
631
|
+
const networks = sendDataNewNetwork.value.flat(2)
|
|
632
|
+
const cdDvdDrives = sendDataNewCdDvdDrive.value.flat(2)
|
|
633
|
+
const pciDevices = sendDataNewPciDevices.value.flat()
|
|
634
|
+
const usbController = sendDataNewUsbController.value
|
|
635
|
+
const videoCard = sendDataVideoCard.value
|
|
636
|
+
|
|
637
|
+
const sendData: UI_I_SendDataVirtualHardware = {
|
|
638
|
+
cpu,
|
|
639
|
+
memory,
|
|
640
|
+
usbController,
|
|
641
|
+
pciDevices,
|
|
642
|
+
networks,
|
|
643
|
+
hardDisks,
|
|
644
|
+
cdDvdDrives,
|
|
645
|
+
videoCard,
|
|
649
646
|
}
|
|
647
|
+
emits('send-data', sendData)
|
|
650
648
|
}
|
|
651
649
|
|
|
652
650
|
const onSetInvalidHardDisk = (invalid: boolean, index: number): void => {
|