bfg-common 1.5.534 → 1.5.535

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.
Files changed (133) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  4. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  5. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  6. package/assets/localization/local_ru.json +1 -1
  7. package/components/atoms/TheIcon3.vue +50 -50
  8. package/components/atoms/collapse/CollapseNav.vue +170 -170
  9. package/components/atoms/perPage/PerPage.vue +58 -58
  10. package/components/atoms/table/dataGrid/DataGrid.vue +1718 -1718
  11. package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
  12. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  13. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  14. package/components/common/backup/storage/actions/add/Add.vue +251 -251
  15. package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
  16. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  17. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  18. package/components/common/browse/lib/models/interfaces.ts +5 -5
  19. package/components/common/diagramMain/network/Contents.vue +497 -497
  20. package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
  21. package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
  22. package/components/common/pages/backups/DetailView.vue +52 -52
  23. package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
  24. package/components/common/pages/backups/modals/Modals.vue +243 -243
  25. package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +195 -195
  26. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  27. package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
  28. package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
  29. package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
  30. package/components/common/pages/backups/modals/restore/disks/Disks.vue +27 -27
  31. package/components/common/pages/backups/modals/restore/disks/tableView/lib/config/table.ts +117 -117
  32. package/components/common/pages/backups/modals/restore/name/Name.vue +166 -166
  33. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
  34. package/components/common/pages/backups/modals/restore/networks/Networks.vue +70 -67
  35. package/components/common/pages/backups/modals/restore/networks/table/Table.vue +214 -214
  36. package/components/common/pages/backups/modals/restore/types/lib/config/typeOptions.ts +25 -25
  37. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  38. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  39. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  40. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  41. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  42. package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
  43. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  44. package/components/common/select/radio/RadioGroup.vue +137 -137
  45. package/components/common/spiceConsole/Drawer.vue +420 -420
  46. package/components/common/spiceConsole/SpiceConsole.vue +184 -184
  47. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  48. package/components/common/tools/Actions.vue +207 -207
  49. package/components/common/treeView/TreeView.vue +52 -52
  50. package/components/common/vm/actions/add/Add.vue +945 -895
  51. package/components/common/vm/actions/add/New.vue +689 -695
  52. package/components/common/vm/actions/add/Old.vue +400 -414
  53. package/components/common/vm/actions/add/lib/config/steps.ts +347 -347
  54. package/components/common/vm/actions/clone/Clone.vue +806 -754
  55. package/components/common/vm/actions/clone/{cloneNew/CloneNew.vue → new/New.vue} +454 -434
  56. package/components/common/vm/actions/clone/{cloneOld/CloneOld.vue → old/Old.vue} +375 -382
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +368 -368
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +427 -427
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/Table.vue +99 -93
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
  67. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  68. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  69. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
  70. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  71. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
  72. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  73. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  74. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  75. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  76. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  77. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  78. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  79. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  80. package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
  81. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  82. package/components/common/vm/actions/register/Register.vue +352 -285
  83. package/components/common/vm/actions/register/lib/config/steps.ts +86 -86
  84. package/components/common/wizards/common/steps/computeResource/ComputeResource.vue +85 -95
  85. package/components/common/wizards/common/steps/computeResource/New.vue +92 -88
  86. package/components/common/wizards/common/steps/computeResource/Old.vue +102 -81
  87. package/components/common/wizards/common/steps/computeResource/compatibility/Compatibility.vue +31 -0
  88. package/components/common/wizards/common/steps/computeResource/compatibility/New.vue +98 -0
  89. package/components/common/wizards/{vm/common/validation/compatibility/Compatibility.vue → common/steps/computeResource/compatibility/Old.vue} +54 -62
  90. package/components/common/wizards/common/steps/computeResource/compatibility/lib/models/enums.ts +6 -0
  91. package/components/common/wizards/common/steps/name/Name.vue +178 -178
  92. package/components/common/wizards/common/steps/name/New.vue +221 -221
  93. package/components/common/wizards/common/steps/name/Old.vue +121 -121
  94. package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
  95. package/components/common/wizards/common/steps/name/location/Location.vue +85 -85
  96. package/components/common/wizards/common/steps/name/location/New.vue +40 -40
  97. package/components/common/wizards/datastore/add/Add.vue +228 -228
  98. package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
  99. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  100. package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +6 -6
  101. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  102. package/components/common/wizards/vm/migrate/select/storage/Storage.vue +3 -3
  103. package/composables/useAppVersion.ts +21 -21
  104. package/composables/useLocal.ts +6 -6
  105. package/composables/useLocalCommon.ts +39 -39
  106. package/package.json +2 -2
  107. package/plugins/console.ts +21 -21
  108. package/plugins/date.ts +233 -233
  109. package/plugins/mouse.ts +21 -21
  110. package/plugins/panelStates.ts +70 -70
  111. package/plugins/text.ts +59 -59
  112. package/public/spice-console/application/clientgui.js +854 -854
  113. package/public/spice-console/application/packetfactory.js +211 -211
  114. package/public/spice-console/application/virtualmouse.js +147 -147
  115. package/public/spice-console/lib/images/bitmap.js +203 -203
  116. package/public/spice-console/network/spicechannel.js +440 -440
  117. package/public/spice-console/process/cursorprocess.js +121 -121
  118. package/public/spice-console/process/inputprocess.js +227 -227
  119. package/public/spice-console/process/mainprocess.js +210 -210
  120. package/public/spice-console/run.js +210 -210
  121. package/store/main/mutations.ts +7 -7
  122. package/store/main/state.ts +7 -7
  123. package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +0 -143
  124. package/components/common/vm/actions/common/select/computeResource/New.vue +0 -184
  125. package/components/common/vm/actions/common/select/computeResource/Old.vue +0 -99
  126. package/components/common/vm/actions/common/select/computeResource/lib/ComputeResource.spec.ts +0 -479
  127. package/components/common/vm/actions/common/select/computeResource/treeView/New.vue +0 -51
  128. package/components/common/vm/actions/common/select/computeResource/treeView/Old.vue +0 -51
  129. package/components/common/vm/actions/common/select/computeResource/treeView/TreeView.vue +0 -131
  130. package/components/common/wizards/common/compatibility/Compatibility.vue +0 -13
  131. package/components/common/wizards/common/compatibility/New.vue +0 -10
  132. package/components/common/wizards/common/compatibility/Old.vue +0 -10
  133. package/components/common/wizards/vm/common/validation/lib/models/enums.ts +0 -5
@@ -1,695 +1,689 @@
1
- <template>
2
- <ui-wizard
3
- :steps="props.wizard.steps"
4
- :selected-scheme="props.selectedScheme"
5
- :title="props.title"
6
- :texts="texts"
7
- :is-loading="props.isLoading"
8
- :class="[{ 'select-template-step': props.isShowSelectTemplate }]"
9
- test-id="add-vm-or-vmt-wizard"
10
- show
11
- @change-steps="emits('change-steps', $event)"
12
- @hide="emits('hide')"
13
- @submit="emits('finish')"
14
- >
15
- <template #content="{ selectedStep }">
16
- <ui-wizard-block
17
- v-if="selectedStep.id === dynamicSteps.creationType"
18
- :sub-title-height="height0"
19
- >
20
- <template #subTitle>
21
- <div ref="subTitleBlock0">
22
- <div class="subtitle-block">
23
- <ui-wizard-subtitle
24
- :sub-title="localization.vmWizard.howWouldYouLikeCreateVm"
25
- />
26
- </div>
27
- </div>
28
- </template>
29
- <template #content>
30
- <common-vm-actions-common-select-create-type
31
- v-model="selectedCreateType"
32
- :import-from-v-m-warev-sphere="props.importFromVMWarevSphere"
33
- />
34
- </template>
35
- </ui-wizard-block>
36
- <ui-wizard-block v-if="selectedStep.id === dynamicSteps.selectTemplate">
37
- <template #content>
38
- <common-vm-actions-common-select-template
39
- :template-submit="props.templateSubmit"
40
- :templates-tree="props.templatesTree"
41
- :selected-template-id="props.selectedTemplateId"
42
- @submit="emits('change-template', $event)"
43
- />
44
- </template>
45
- </ui-wizard-block>
46
- <!-- 41 = 25 (subtitle height) + 16 (margin-bottom)-->
47
- <ui-wizard-block
48
- v-if="
49
- selectedStep.id === dynamicSteps.selectName ||
50
- selectedStep.id === dynamicSteps.selectNameFolder
51
- "
52
- :sub-title-height="heightName"
53
- >
54
- <template #subTitle>
55
- <div ref="subTitleBlockName" class="subtitle-block">
56
- <div
57
- id="name-alert-wrapper"
58
- :class="[{ 'mb-4': !isNameAlertWrapperEmpty }]"
59
- ></div>
60
- <ui-wizard-subtitle
61
- :sub-title="
62
- localization.vmWizard.specifyUniqueNameAndTargetLocationForVm
63
- "
64
- />
65
- </div>
66
- </template>
67
- <template #content>
68
- <common-wizards-common-steps-name
69
- v-model:name="vmForm.name"
70
- v-model:location="location"
71
- :show="
72
- selectedStep.id === dynamicSteps.selectName ||
73
- selectedStep.id === dynamicSteps.selectNameFolder
74
- "
75
- :name-form-submit="props.nameFormSubmit"
76
- :name-request-url="props.nameRequestUrl"
77
- :has-location="props.project === 'sphere'"
78
- :location-nodes="props.locationNodes"
79
- :allowed-location-kinds="props.allowedLocationKinds"
80
- :location-description="props.locationDescription"
81
- :validate-empty-name="props.validateEmptyName"
82
- :validation-description="props.validationDescription"
83
- :name-exist-validation-description="props.nameExistValidation"
84
- :test-ids="props.nameTestIds"
85
- @submit="emits('change-name', $event)"
86
- @has-errors="isNameAlertWrapperEmpty = $event"
87
- />
88
- </template>
89
- </ui-wizard-block>
90
- <ui-wizard-block
91
- v-if="
92
- props.isSphere &&
93
- selectedStep.id === dynamicSteps.selectComputeResource
94
- "
95
- :sub-title-height="heightComputeResource"
96
- >
97
- <template #subTitle>
98
- <div ref="subTitleBlockComputeResource">
99
- <div class="subtitle-block">
100
- <div
101
- id="compute-resource-alert-wrapper"
102
- :class="[{ 'mb-4': !isComputeResourceAlertWrapperEmpty }]"
103
- ></div>
104
- <ui-wizard-subtitle
105
- :sub-title="
106
- localization.vmWizard
107
- .selectDestinationComputeResourceForThisOperation
108
- "
109
- />
110
- </div>
111
- </div>
112
- </template>
113
- <template #content>
114
- <common-vm-actions-common-select-compute-resource
115
- v-model="vmForm.computeResource"
116
- :compute-resource-submit="props.computeResourceSubmit"
117
- :data-center="vmForm.dataCenter"
118
- :compute-resource="props.computeResource"
119
- :compute-resource-tree="props.computeResourceTree"
120
- @submit="emits('change-compute-resource', $event)"
121
- @select-compute-resource-tree="
122
- emits('select-compute-resource-tree', $event)
123
- "
124
- @get-compute-resource-tree="
125
- emits('get-compute-resource-tree', $event)
126
- "
127
- @show-compute-resource-tree="
128
- emits('show-compute-resource-tree', $event)
129
- "
130
- @clear-compute-resource-tree="emits('clear-compute-resource-tree')"
131
- @has-errors="isComputeResourceAlertWrapperEmpty = $event"
132
- />
133
- </template>
134
- </ui-wizard-block>
135
- <ui-wizard-block
136
- v-if="selectedStep.id === dynamicSteps.selectStorage"
137
- :sub-title-height="heightStorage"
138
- >
139
- <template #subTitle>
140
- <div ref="subTitleBlockStorage">
141
- <div class="subtitle-block">
142
- <div
143
- id="storage-alert-wrapper"
144
- :class="[{ 'mb-4': !isStorageAlertWrapperEmpty }]"
145
- ></div>
146
- <ui-wizard-subtitle
147
- :sub-title="
148
- localization.vmWizard.selectStorageForConfigurationDiskFiles
149
- "
150
- />
151
- </div>
152
- </div>
153
- </template>
154
- <template #content>
155
- <common-vm-actions-common-select-storage
156
- :storage-submit="props.storageSubmit"
157
- :datastore="props.datastore"
158
- :is-datastore-loading="props.isDatastoreLoading"
159
- :get-datastore-table-func="props.getDatastoreTableFunc"
160
- :storage="props.vmtSettings?.storage"
161
- @submit="emits('change-storage', $event)"
162
- @has-errors="isStorageAlertWrapperEmpty = $event"
163
- />
164
- </template>
165
- </ui-wizard-block>
166
- <ui-wizard-block
167
- v-if="
168
- selectedStep.id === dynamicSteps.selectOptions ||
169
- selectedStep.id === dynamicSteps.selectOptionsForDeployment
170
- "
171
- :sub-title-height="heightSelectOptions"
172
- >
173
- <template #subTitle>
174
- <div ref="subTitleBlockSelectOptions">
175
- <div class="subtitle-block">
176
- <ui-wizard-subtitle
177
- :sub-title="localization.vmWizard.selectAdvancedOptionsTargetVm"
178
- />
179
- </div>
180
- </div>
181
- </template>
182
- <template #content>
183
- <common-vm-actions-common-select-options
184
- :is-create-template="selectedCreateType === '1'"
185
- @change="emits('change-select-options', $event)"
186
- />
187
- </template>
188
- </ui-wizard-block>
189
- <ui-wizard-block
190
- v-if="selectedStep.id === dynamicSteps.compatibility"
191
- :sub-title-height="heightCompatibility"
192
- >
193
- <template #subTitle>
194
- <div ref="subTitleBlockCompatibility">
195
- <div class="subtitle-block">
196
- <div
197
- id="compatibility-alert-wrapper"
198
- :class="[{ 'mb-4': !isCompatibilityAlertWrapperEmpty }]"
199
- ></div>
200
- <ui-wizard-subtitle
201
- :sub-title="localization.vmWizard.compatibilitySubTitle"
202
- />
203
- </div>
204
- </div>
205
- </template>
206
- <template #content>
207
- <common-vm-actions-common-select-compatibility
208
- :options="props.compatibility"
209
- :error-validation-fields="props.errorValidationFields"
210
- @change="emits('change-compatibility', $event)"
211
- @remove-error-by-title="emits('remove-error-by-title', $event)"
212
- @has-errors="isCompatibilityAlertWrapperEmpty = $event"
213
- />
214
- </template>
215
- </ui-wizard-block>
216
- <ui-wizard-block
217
- v-if="
218
- selectedStep.id === dynamicSteps.selectGuestOSMachineType ||
219
- selectedStep.id === dynamicSteps.selectGuestOS
220
- "
221
- :sub-title-height="heightOs"
222
- >
223
- <template #subTitle>
224
- <div ref="subTitleBlockOs">
225
- <div class="subtitle-block">
226
- <!-- <div id="compatibility-alert-wrapper"></div>-->
227
- <ui-wizard-subtitle
228
- :sub-title="localization.common.chooseGuestOSInstalledVM"
229
- />
230
- </div>
231
- </div>
232
- </template>
233
- <template #content>
234
- <div class="select-block-wrap overflow-auto pb-4">
235
- <common-vm-actions-common-select-os
236
- v-model:machine-type="vmForm.guestMachineType"
237
- v-model:guest-os-family="vmForm.guestOsFamily"
238
- v-model:guest-os-version="vmForm.guestOsVersion"
239
- :families-options="props.guestOsFamilies"
240
- :versions-options="props.guestOsVersions"
241
- :machine-types-options="props.machineTypes"
242
- :error-validation-fields="props.errorValidationFields"
243
- @remove-error-by-title="emits('remove-error-by-title', $event)"
244
- />
245
- <div class="vm-hardware-version-wrap justify-end flex flex-1 mt-7">
246
- <span class="vm-hardware-version">{{
247
- props.compatibilityInfo
248
- }}</span>
249
- </div>
250
- </div>
251
- </template>
252
- </ui-wizard-block>
253
- <ui-wizard-block
254
- v-if="selectedStep.id === dynamicSteps.customizeHardware"
255
- >
256
- <template #content>
257
- <div class="select-block-wrap customize-hardware flex flex-col">
258
- <common-vm-actions-common-customize-hardware
259
- :project="props.project"
260
- :is-vmt="props.isVmt"
261
- :vm-name="vmForm.name"
262
- :guest-machine-type="vmForm.guestMachineType"
263
- :guest-os-family="vmForm.guestOsFamily"
264
- :guest-os-version="vmForm.guestOsVersion"
265
- :storage="vmForm.storage"
266
- :hard-disks-for-boot-options="props.virtualHardwareHardDisksLocal"
267
- :cd-dvd-drives-for-boot-options="
268
- props.virtualHardwareCdDvdDrivesLocal
269
- "
270
- :networks-for-boot-options="props.virtualHardwareNetworksLocal"
271
- :cd-dvd-drives="props.virtualHardwareCdDvdDrivesLocal"
272
- :customize-hardware-submit="props.customizeHardwareSubmit"
273
- :max-cpus="props.maxCpus"
274
- :max-memory="props.maxMemory"
275
- :cpu-models="props.cpuModels"
276
- :selected-nav-item="props.selectedNavItem"
277
- :nodes="props.nodes"
278
- :files="props.files"
279
- :networks-table="props.networksTable"
280
- :error-validation-fields="props.errorValidationFields"
281
- :get-datastore-table-func="props.getDatastoreTableFunc"
282
- :datastore="props.datastore"
283
- :is-datastore-loading="props.isDatastoreLoading"
284
- :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
285
- :passthrough-devices="props.passthroughDevices"
286
- :mediated-devices="props.mediatedDevices"
287
- :compute-resource="vmForm.computeResource"
288
- :compatibility-info="props.compatibilityInfo"
289
- @change-boot-order="emits('change-boot-order', $event)"
290
- @send-data="emits('change-customize-hardware', $event)"
291
- @get-storage="emits('get-storage', $event)"
292
- @get-folders-or-files="emits('get-folders-or-files', $event)"
293
- @get-active-device-child="
294
- emits('get-active-device-child', $event)
295
- "
296
- @show-datastore-child="emits('show-datastore-child', $event)"
297
- @remove-error-by-title="emits('remove-error-by-title', $event)"
298
- @get-networks-table="emits('get-networks-table', $event)"
299
- @get-pci-devices="emits('get-pci-devices')"
300
- />
301
- <!-- <div-->
302
- <!-- class="vm-hardware-version-wrap justify-end flex flex-1 mt-4 mr-8"-->
303
- <!-- >-->
304
- <!-- <span class="vm-hardware-version">{{-->
305
- <!-- props.compatibilityInfo-->
306
- <!-- }}</span>-->
307
- <!-- </div>-->
308
- </div>
309
- </template>
310
- </ui-wizard-block>
311
- <ui-wizard-block
312
- v-if="
313
- selectedStep.id === dynamicSteps.customizeHardwareTemplate &&
314
- props.vmtSettings
315
- "
316
- >
317
- <template #content>
318
- <div
319
- class="select-block-wrap overflow-auto h-full flex flex-col pr-8"
320
- >
321
- <common-vm-actions-common-customize-hardware
322
- :project="props.project"
323
- :is-vmt="props.isVmt"
324
- :vm-name="vmForm.name"
325
- :guest-machine-type="vmForm.guestMachineType"
326
- :guest-os-family="vmForm.guestOsFamily"
327
- :guest-os-version="vmForm.guestOsVersion"
328
- :storage="vmForm.storage"
329
- :hard-disks-for-boot-options="props.virtualHardwareHardDisksLocal"
330
- :cd-dvd-drives-for-boot-options="
331
- props.virtualHardwareCdDvdDrivesLocal
332
- "
333
- :networks-for-boot-options="props.virtualHardwareNetworksLocal"
334
- :cd-dvd-drives="props.vmtSettings.cdDvdDrives || []"
335
- :hard-disks="props.vmtSettings.hardDisks || []"
336
- :networks="props.vmtSettings.networks || []"
337
- :customize-hardware-submit="
338
- props.customizeHardwareForTemplateSubmit
339
- "
340
- :max-cpus="props.maxCpus"
341
- :max-memory="props.maxMemory"
342
- :cpu-models="props.cpuModels"
343
- :cpu="props.vmtSettings.cpu"
344
- :memory="props.vmtSettings.memory"
345
- :video-card="props.vmtSettings.videoCard"
346
- :usb-controller="props.vmtSettings.usbController"
347
- :pci-devices="props.vmtSettings.pciDevices"
348
- :hard-disks-for-edit="props.vmtSettings.hardDisks || []"
349
- :options="props.vmtSettings.options"
350
- :selected-nav-item="props.selectedNavItem"
351
- :nodes="props.nodes"
352
- :files="props.files"
353
- :networks-table="props.networksTable"
354
- :error-validation-fields="props.errorValidationFields"
355
- :get-datastore-table-func="props.getDatastoreTableFunc"
356
- :datastore="props.datastore"
357
- :is-datastore-loading="props.isDatastoreLoading"
358
- :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
359
- :passthrough-devices="props.passthroughDevices"
360
- :mediated-devices="props.mediatedDevices"
361
- :compute-resource="vmForm.computeResource"
362
- :compatibility-info="props.compatibilityInfo"
363
- is-clone
364
- @change-boot-order="emits('change-boot-order', $event)"
365
- @send-data="emits('change-customize-hardware', $event)"
366
- @get-storage="emits('get-storage', $event)"
367
- @get-folders-or-files="emits('get-folders-or-files', $event)"
368
- @get-active-device-child="
369
- emits('get-active-device-child', $event)
370
- "
371
- @show-datastore-child="emits('show-datastore-child', $event)"
372
- @remove-error-by-title="emits('remove-error-by-title', $event)"
373
- @get-networks-table="emits('get-networks-table', $event)"
374
- @get-pci-devices="emits('get-pci-devices')"
375
- />
376
- <!-- <div class="vm-hardware-version-wrap justify-end flex flex-1 mt-4">-->
377
- <!-- <span class="vm-hardware-version">{{-->
378
- <!-- props.compatibilityInfo-->
379
- <!-- }}</span>-->
380
- <!-- </div>-->
381
- </div>
382
- </template>
383
- </ui-wizard-block>
384
- <ui-wizard-block
385
- v-if="selectedStep.id === dynamicSteps.readyComplete"
386
- :sub-title-height="heightReadyComplete"
387
- >
388
- <template #subTitle>
389
- <div ref="subTitleBlockReadyComplete">
390
- <div class="subtitle-block">
391
- <ui-wizard-subtitle
392
- :sub-title="localization.vmWizard.lastCreateSubtitle"
393
- />
394
- </div>
395
- </div>
396
- </template>
397
- <template #content>
398
- <div class="select-block-wrap h-full flex flex-col mt-3">
399
- <div v-if="props.isShowPowerOn" class="power-on-by-default-wrap">
400
- <ui-checkbox
401
- v-model="isPowerOnByDefault"
402
- :label-text="localization.common.powerOnByDefault"
403
- test-id="power-on-by-default"
404
- size="md"
405
- />
406
- </div>
407
-
408
- <div v-if="props.isShowPowerOn" class="divider my-4"></div>
409
-
410
- <common-ready-to-complete
411
- v-if="selectedStep.id === dynamicSteps.readyComplete"
412
- :data="props.readyCompleteTableInfo"
413
- />
414
- <div
415
- class="vm-hardware-version-wrap justify-end flex flex-1 mt-4 pb-4"
416
- >
417
- <span class="vm-hardware-version">{{
418
- props.compatibilityInfo
419
- }}</span>
420
- </div>
421
- </div>
422
- </template>
423
- </ui-wizard-block>
424
- </template>
425
- </ui-wizard>
426
- </template>
427
-
428
- <script setup lang="ts">
429
- import { useElementSize } from '@vueuse/core'
430
- import type { UI_I_WizardTexts } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
431
- import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
432
- import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
433
- import type {
434
- UI_I_Localization,
435
- UI_I_ArbitraryObject,
436
- } from '~/lib/models/interfaces'
437
- import type { UI_T_Project } from '~/lib/models/types'
438
- import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
439
- import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
440
- import type {
441
- UI_I_DatastoreTableItem,
442
- UI_I_FolderOrFileTreePayload,
443
- } from '~/lib/models/store/storage/interfaces'
444
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
445
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
446
- import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
447
- import type {
448
- // UI_T_AddVmFinishFunc,
449
- UI_T_SelectedNavItem,
450
- } from '~/components/common/vm/actions/common/lib/models/types'
451
- import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
452
- import type {
453
- // UI_I_Capabilities,
454
- UI_I_VmForm,
455
- } from '~/components/common/vm/actions/common/lib/models/interfaces'
456
- import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
457
- import type {
458
- UI_I_SendDataNewCdDvdDrive,
459
- UI_I_SendDataNewHardDisk,
460
- UI_I_SendDataNewNetwork,
461
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
462
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
463
- import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
464
- import type {
465
- UI_I_MediatedDevice,
466
- UI_I_PciDevice,
467
- UI_I_VmSettings,
468
- } from '~/lib/models/store/vm/interfaces'
469
- import type { UI_I_NameTestIds } from '~/components/common/wizards/common/steps/name/lib/models/interfaces'
470
- import { dynamicSteps } from '~/components/common/vm/actions/add/lib/config/steps'
471
-
472
- const vmForm = defineModel<UI_I_VmForm>('vmForm', {
473
- required: true,
474
- })
475
- const selectedCreateType = defineModel<string>('selectedCreateType', {
476
- required: true,
477
- })
478
- const isPowerOnByDefault = defineModel<boolean>('isPowerOnByDefault', {
479
- required: true,
480
- })
481
-
482
- const props = withDefaults(
483
- defineProps<{
484
- project: UI_T_Project
485
- isVmt: boolean
486
- nodes: UI_I_FileTreeNode[]
487
- files: UI_I_FileTreeNode[]
488
- networksTable: UI_I_NetworkTableItem[]
489
- datastore: UI_I_DatastoreTableItem[]
490
- isDatastoreLoading: boolean
491
- errorValidationFields: UI_I_ErrorValidationField[]
492
- readyCompleteTableInfo: UI_I_TableInfoItem[]
493
- vmCpuHelpTextSecond: string
494
- importFromVMWarevSphere: string
495
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
496
- passthroughDevices: UI_I_PciDevice[]
497
- mediatedDevices: UI_I_MediatedDevice[]
498
- templatesTree: UI_I_TreeNode[]
499
- wizard: Wizard
500
- selectedScheme: number[]
501
- templateSubmit: null | Function
502
- nameFormSubmit: null | Function
503
- storageSubmit: null | Function
504
- customizeHardwareSubmit: null | Function
505
- customizeHardwareForTemplateSubmit: null | Function
506
- isSphere: boolean
507
- compatibility: UI_I_OptionItem[]
508
- guestOsFamilies: UI_I_OptionItem[]
509
- guestOsVersions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
510
- machineTypes: UI_I_OptionItem[]
511
- virtualHardwareHardDisksLocal: UI_I_SendDataNewHardDisk[] | null
512
- virtualHardwareCdDvdDrivesLocal: UI_I_SendDataNewCdDvdDrive[] | null
513
- virtualHardwareNetworksLocal: UI_I_SendDataNewNetwork[] | null
514
- maxCpus: number
515
- maxMemory: number
516
- cpuModels: UI_I_OptionItem[]
517
- selectedNavItem: UI_T_SelectedNavItem
518
- compatibilityInfo: string
519
- isShowPowerOn: boolean
520
- validateEmptyName: boolean
521
- validationDescription: string
522
- nameExistValidation: string
523
- isShowSelectTemplate: boolean
524
- title: string
525
- nameRequestUrl: string
526
- nameTestIds: UI_I_NameTestIds
527
- computeResourceSubmit: null | Function // для сферы
528
- dataCenter?: UI_I_TreeNode | null // для сферы
529
- computeResource?: UI_I_TreeNode // для сферы
530
- computeResourceTree?: UI_I_TreeNode[] // для сферы
531
- locationNodes?: UI_I_TreeNode[] // для сферы
532
- allowedLocationKinds?: number[] // для сферы
533
- locationDescription?: string // для сферы
534
- vmtSettings?: UI_I_VmSettings | null // для шаблонов
535
- isLoading?: boolean
536
- selectedTemplateId?: string
537
- }>(),
538
- {
539
- dataCenter: null,
540
- computeResource: undefined,
541
- computeResourceTree: undefined,
542
- locationNodes: () => [],
543
- vmtSettings: undefined,
544
- isLoading: undefined,
545
- selectedTemplateId: '',
546
- }
547
- )
548
-
549
- const emits = defineEmits<{
550
- (event: 'get-storage', value: UI_I_TablePayload): void
551
- (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
552
- (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
553
- (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
554
- (event: 'remove-error-by-title', value: string): void
555
- (event: 'get-networks-table', value: UI_I_TablePayload): void
556
- (event: 'get-pci-devices'): void
557
- (event: 'change-steps', value: UI_I_WizardStep[]): void
558
- (event: 'finish'): void
559
- (event: 'change-template', value: UI_I_TreeNode): void
560
- (event: 'change-name', value: [string, UI_I_TreeNode | null]): void
561
- (event: 'change-storage', value: UI_I_DatastoreTableItem | null): void
562
- (event: 'change-select-options', value: string[]): void
563
- (event: 'change-compatibility', value: UI_I_OptionItem): void
564
- (event: 'change-boot-order', value: UI_T_ChangeBootOrder): void
565
- (
566
- event: 'change-customize-hardware',
567
- value: UI_I_SendDataCustomizeHardware
568
- ): void
569
- (event: 'hide'): void
570
- (event: 'clear-compute-resource-tree'): void // для сферы
571
- (event: 'change-compute-resource', value: UI_I_TreeNode): void // для сферы
572
- (event: 'select-compute-resource-tree', value: UI_I_TreeNode): void // для сферы
573
- (
574
- event: 'get-compute-resource-tree',
575
- value: { id: string | number; cb: () => void }
576
- ): void // для сферы
577
- (event: 'show-compute-resource-tree', value: UI_I_TreeNode): void // для сферы
578
- }>()
579
-
580
- const localization = computed<UI_I_Localization>(() => useLocal())
581
-
582
- const location = ref<UI_I_TreeNode | null>(props.dataCenter) // для сферы
583
-
584
- const texts = computed<UI_I_WizardTexts>(() => ({
585
- cancel: localization.value.common.cancel,
586
- back: localization.value.common.backCap,
587
- processing: localization.value.common.processing,
588
- next: localization.value.common.next,
589
- finish: localization.value.common.create,
590
- incompleteTitle: localization.value.common.incompleteProcess,
591
- incompleteMessage: localization.value.common.incompleteProcessMessage,
592
- incompleteCancel: localization.value.common.cancel,
593
- incompleteLeave: localization.value.common.leave,
594
- step: localization.value.common.step,
595
- of: localization.value.common.of2,
596
- }))
597
-
598
- const subTitleBlock0 = ref<HTMLElement | null>(null)
599
- const { height: height0 } = useElementSize(subTitleBlock0)
600
-
601
- const subTitleBlockName = ref<HTMLElement | null>(null)
602
- const { height: heightName } = useElementSize(subTitleBlockName)
603
- const subTitleBlockComputeResource = ref<HTMLElement | null>(null)
604
- const { height: heightComputeResource } = useElementSize(
605
- subTitleBlockComputeResource
606
- )
607
- const subTitleBlockStorage = ref<HTMLElement | null>(null)
608
- const { height: heightStorage } = useElementSize(subTitleBlockStorage)
609
- const subTitleBlockCompatibility = ref<HTMLElement | null>(null)
610
- const { height: heightCompatibility } = useElementSize(
611
- subTitleBlockCompatibility
612
- )
613
- const subTitleBlockOs = ref<HTMLElement | null>(null)
614
- const { height: heightOs } = useElementSize(subTitleBlockOs)
615
- const subTitleBlockReadyComplete = ref<HTMLElement | null>(null)
616
- const { height: heightReadyComplete } = useElementSize(
617
- subTitleBlockReadyComplete
618
- )
619
- const subTitleBlockSelectOptions = ref<HTMLElement | null>(null)
620
- const { height: heightSelectOptions } = useElementSize(
621
- subTitleBlockSelectOptions
622
- )
623
-
624
- const isNameAlertWrapperEmpty = ref<boolean>(false)
625
- const isComputeResourceAlertWrapperEmpty = ref<boolean>(false)
626
- const isStorageAlertWrapperEmpty = ref<boolean>(false)
627
- const isCompatibilityAlertWrapperEmpty = ref<boolean>(false)
628
- </script>
629
-
630
- <style>
631
- :root {
632
- --ready-to-complate-run-bg-color: #e9ebed66;
633
- --ready-to-complate-run-border-color: #e9ebeda3;
634
- }
635
- :root.dark-theme {
636
- --ready-to-complate-run-bg-color: #e9ebed0f;
637
- --ready-to-complate-run-border-color: #e9ebed1f;
638
- }
639
- </style>
640
- <style scoped lang="scss">
641
- .subtitle-block {
642
- display: flex;
643
- flex-direction: column;
644
- border-bottom: 1px solid var(--wizard-line);
645
- padding-bottom: 12px;
646
- }
647
- .select-block-wrap {
648
- &.customize-hardware {
649
- height: inherit;
650
- max-height: 100%;
651
- //padding-bottom: 16px;
652
-
653
- :deep(.tabs-wrapper) {
654
- overflow-y: auto;
655
- }
656
- :deep(.tabs-wrapper),
657
- :deep(.errors-alert),
658
- :deep(.action-wrap) {
659
- margin-right: 32px;
660
- }
661
- :deep(.virtual-hardware-content-block),
662
- :deep(.vm-options) {
663
- padding-right: 18px;
664
- }
665
- }
666
- .vm-hardware-version-wrap {
667
- align-items: flex-end;
668
- text-align: right;
669
-
670
- .vm-hardware-version {
671
- font-size: 13px;
672
- color: #9da6ad; // for light and dark
673
- }
674
- }
675
- :deep(.details-list) {
676
- margin-top: 0;
677
- }
678
- }
679
-
680
- .power-on-by-default-wrap {
681
- padding: 12px;
682
- border-radius: 8px;
683
- background-color: var(--ready-to-complate-run-bg-color);
684
- }
685
- .divider {
686
- width: 100%;
687
- min-height: 1px;
688
- background-color: var(--ready-to-complate-run-border-color);
689
- }
690
- .select-template-step {
691
- :deep(.ui-wizard-content-right-bottom) {
692
- height: 8px;
693
- }
694
- }
695
- </style>
1
+ <template>
2
+ <ui-wizard
3
+ :steps="props.wizard.steps"
4
+ :selected-scheme="props.selectedScheme"
5
+ :title="props.title"
6
+ :texts="texts"
7
+ :is-loading="props.isLoading"
8
+ :class="[{ 'select-template-step': props.isShowSelectTemplate }]"
9
+ test-id="add-vm-or-vmt-wizard"
10
+ show
11
+ @change-steps="emits('change-steps', $event)"
12
+ @hide="emits('hide')"
13
+ @submit="emits('finish')"
14
+ >
15
+ <template #content="{ selectedStep }">
16
+ <ui-wizard-block
17
+ v-if="selectedStep.id === dynamicSteps.creationType"
18
+ :sub-title-height="height0"
19
+ >
20
+ <template #subTitle>
21
+ <div ref="subTitleBlock0">
22
+ <div class="subtitle-block">
23
+ <ui-wizard-subtitle
24
+ :sub-title="localization.vmWizard.howWouldYouLikeCreateVm"
25
+ />
26
+ </div>
27
+ </div>
28
+ </template>
29
+ <template #content>
30
+ <common-vm-actions-common-select-create-type
31
+ v-model="selectedCreateType"
32
+ :import-from-v-m-warev-sphere="props.importFromVMWarevSphere"
33
+ />
34
+ </template>
35
+ </ui-wizard-block>
36
+ <ui-wizard-block v-if="selectedStep.id === dynamicSteps.selectTemplate">
37
+ <template #content>
38
+ <common-vm-actions-common-select-template
39
+ :template-submit="props.templateSubmit"
40
+ :templates-tree="props.templatesTree"
41
+ :selected-template-id="props.selectedTemplateId"
42
+ @submit="emits('change-template', $event)"
43
+ />
44
+ </template>
45
+ </ui-wizard-block>
46
+ <!-- 41 = 25 (subtitle height) + 16 (margin-bottom)-->
47
+ <ui-wizard-block
48
+ v-if="
49
+ selectedStep.id === dynamicSteps.selectName ||
50
+ selectedStep.id === dynamicSteps.selectNameFolder
51
+ "
52
+ :sub-title-height="heightName"
53
+ >
54
+ <template #subTitle>
55
+ <div ref="subTitleBlockName" class="subtitle-block">
56
+ <div
57
+ id="name-alert-wrapper"
58
+ :class="[{ 'mb-4': !isNameAlertWrapperEmpty }]"
59
+ ></div>
60
+ <ui-wizard-subtitle
61
+ :sub-title="
62
+ localization.vmWizard.specifyUniqueNameAndTargetLocationForVm
63
+ "
64
+ />
65
+ </div>
66
+ </template>
67
+ <template #content>
68
+ <common-wizards-common-steps-name
69
+ v-model:name="vmForm.name"
70
+ v-model:location="location"
71
+ :show="
72
+ selectedStep.id === dynamicSteps.selectName ||
73
+ selectedStep.id === dynamicSteps.selectNameFolder
74
+ "
75
+ :name-form-submit="props.nameFormSubmit"
76
+ :name-request-url="props.nameRequestUrl"
77
+ :has-location="props.project === 'sphere'"
78
+ :location-nodes="props.locationNodes"
79
+ :allowed-location-kinds="props.allowedLocationKinds"
80
+ :location-description="props.locationDescription"
81
+ :validate-empty-name="props.validateEmptyName"
82
+ :validation-description="props.validationDescription"
83
+ :name-exist-validation-description="props.nameExistValidation"
84
+ :test-ids="props.nameTestIds"
85
+ @submit="emits('change-name', $event)"
86
+ @has-errors="isNameAlertWrapperEmpty = $event"
87
+ />
88
+ </template>
89
+ </ui-wizard-block>
90
+ <ui-wizard-block
91
+ v-if="
92
+ props.isSphere &&
93
+ selectedStep.id === dynamicSteps.selectComputeResource
94
+ "
95
+ :sub-title-height="heightComputeResource"
96
+ >
97
+ <template #subTitle>
98
+ <div ref="subTitleBlockComputeResource">
99
+ <div class="subtitle-block">
100
+ <ui-alert
101
+ v-if="props.computeResourceAlert.length"
102
+ :messages="props.computeResourceAlert"
103
+ test-id="computed-resource-alert"
104
+ type="error"
105
+ size="md"
106
+ class="subtitle-block__alert"
107
+ />
108
+ <ui-wizard-subtitle
109
+ :sub-title="
110
+ localization.vmWizard
111
+ .selectDestinationComputeResourceForThisOperation
112
+ "
113
+ />
114
+ </div>
115
+ </div>
116
+ </template>
117
+ <template #content>
118
+ <common-wizards-common-steps-compute-resource
119
+ v-if="props.isSphere"
120
+ v-show="selectedStep.id === dynamicSteps.selectComputeResource"
121
+ v-model="vmForm.computeResource"
122
+ :node="computeResourceTreeLocal"
123
+ :alert-messages="props.computeResourceAlert"
124
+ :is-loading="props.isLoadingComputeTree"
125
+ :compatibility-text="props.compatibilityText"
126
+ />
127
+ </template>
128
+ </ui-wizard-block>
129
+ <ui-wizard-block
130
+ v-if="selectedStep.id === dynamicSteps.selectStorage"
131
+ :sub-title-height="heightStorage"
132
+ >
133
+ <template #subTitle>
134
+ <div ref="subTitleBlockStorage">
135
+ <div class="subtitle-block">
136
+ <div
137
+ id="storage-alert-wrapper"
138
+ :class="[{ 'mb-4': !isStorageAlertWrapperEmpty }]"
139
+ ></div>
140
+ <ui-wizard-subtitle
141
+ :sub-title="
142
+ localization.vmWizard.selectStorageForConfigurationDiskFiles
143
+ "
144
+ />
145
+ </div>
146
+ </div>
147
+ </template>
148
+ <template #content>
149
+ <common-vm-actions-common-select-storage
150
+ :storage-submit="props.storageSubmit"
151
+ :datastore="props.datastore"
152
+ :is-datastore-loading="props.isDatastoreLoading"
153
+ :get-datastore-table-func="props.getDatastoreTableFunc"
154
+ :storage="props.vmtSettings?.storage"
155
+ @submit="emits('change-storage', $event)"
156
+ @has-errors="isStorageAlertWrapperEmpty = $event"
157
+ />
158
+ </template>
159
+ </ui-wizard-block>
160
+ <ui-wizard-block
161
+ v-if="
162
+ selectedStep.id === dynamicSteps.selectOptions ||
163
+ selectedStep.id === dynamicSteps.selectOptionsForDeployment
164
+ "
165
+ :sub-title-height="heightSelectOptions"
166
+ >
167
+ <template #subTitle>
168
+ <div ref="subTitleBlockSelectOptions">
169
+ <div class="subtitle-block">
170
+ <ui-wizard-subtitle
171
+ :sub-title="localization.vmWizard.selectAdvancedOptionsTargetVm"
172
+ />
173
+ </div>
174
+ </div>
175
+ </template>
176
+ <template #content>
177
+ <common-vm-actions-common-select-options
178
+ :is-create-template="selectedCreateType === '1'"
179
+ @change="emits('change-select-options', $event)"
180
+ />
181
+ </template>
182
+ </ui-wizard-block>
183
+ <ui-wizard-block
184
+ v-if="selectedStep.id === dynamicSteps.compatibility"
185
+ :sub-title-height="heightCompatibility"
186
+ >
187
+ <template #subTitle>
188
+ <div ref="subTitleBlockCompatibility">
189
+ <div class="subtitle-block">
190
+ <div
191
+ id="compatibility-alert-wrapper"
192
+ :class="[{ 'mb-4': !isCompatibilityAlertWrapperEmpty }]"
193
+ ></div>
194
+ <ui-wizard-subtitle
195
+ :sub-title="localization.vmWizard.compatibilitySubTitle"
196
+ />
197
+ </div>
198
+ </div>
199
+ </template>
200
+ <template #content>
201
+ <common-vm-actions-common-select-compatibility
202
+ :options="props.compatibility"
203
+ :error-validation-fields="props.errorValidationFields"
204
+ @change="emits('change-compatibility', $event)"
205
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
206
+ @has-errors="isCompatibilityAlertWrapperEmpty = $event"
207
+ />
208
+ </template>
209
+ </ui-wizard-block>
210
+ <ui-wizard-block
211
+ v-if="
212
+ selectedStep.id === dynamicSteps.selectGuestOSMachineType ||
213
+ selectedStep.id === dynamicSteps.selectGuestOS
214
+ "
215
+ :sub-title-height="heightOs"
216
+ >
217
+ <template #subTitle>
218
+ <div ref="subTitleBlockOs">
219
+ <div class="subtitle-block">
220
+ <!-- <div id="compatibility-alert-wrapper"></div>-->
221
+ <ui-wizard-subtitle
222
+ :sub-title="localization.common.chooseGuestOSInstalledVM"
223
+ />
224
+ </div>
225
+ </div>
226
+ </template>
227
+ <template #content>
228
+ <div class="select-block-wrap overflow-auto pb-4">
229
+ <common-vm-actions-common-select-os
230
+ v-model:machine-type="vmForm.guestMachineType"
231
+ v-model:guest-os-family="vmForm.guestOsFamily"
232
+ v-model:guest-os-version="vmForm.guestOsVersion"
233
+ :families-options="props.guestOsFamilies"
234
+ :versions-options="props.guestOsVersions"
235
+ :machine-types-options="props.machineTypes"
236
+ :error-validation-fields="props.errorValidationFields"
237
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
238
+ />
239
+ <div class="vm-hardware-version-wrap justify-end flex flex-1 mt-7">
240
+ <span class="vm-hardware-version">{{
241
+ props.compatibilityInfo
242
+ }}</span>
243
+ </div>
244
+ </div>
245
+ </template>
246
+ </ui-wizard-block>
247
+ <ui-wizard-block
248
+ v-if="selectedStep.id === dynamicSteps.customizeHardware"
249
+ >
250
+ <template #content>
251
+ <div class="select-block-wrap customize-hardware flex flex-col">
252
+ <common-vm-actions-common-customize-hardware
253
+ :project="props.project"
254
+ :is-vmt="props.isVmt"
255
+ :vm-name="vmForm.name"
256
+ :guest-machine-type="vmForm.guestMachineType"
257
+ :guest-os-family="vmForm.guestOsFamily"
258
+ :guest-os-version="vmForm.guestOsVersion"
259
+ :storage="vmForm.storage"
260
+ :hard-disks-for-boot-options="props.virtualHardwareHardDisksLocal"
261
+ :cd-dvd-drives-for-boot-options="
262
+ props.virtualHardwareCdDvdDrivesLocal
263
+ "
264
+ :networks-for-boot-options="props.virtualHardwareNetworksLocal"
265
+ :cd-dvd-drives="props.virtualHardwareCdDvdDrivesLocal"
266
+ :customize-hardware-submit="props.customizeHardwareSubmit"
267
+ :max-cpus="props.maxCpus"
268
+ :max-memory="props.maxMemory"
269
+ :cpu-models="props.cpuModels"
270
+ :selected-nav-item="props.selectedNavItem"
271
+ :nodes="props.nodes"
272
+ :files="props.files"
273
+ :networks-table="props.networksTable"
274
+ :error-validation-fields="props.errorValidationFields"
275
+ :get-datastore-table-func="props.getDatastoreTableFunc"
276
+ :datastore="props.datastore"
277
+ :is-datastore-loading="props.isDatastoreLoading"
278
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
279
+ :passthrough-devices="props.passthroughDevices"
280
+ :mediated-devices="props.mediatedDevices"
281
+ :compute-resource="vmForm.computeResource"
282
+ :compatibility-info="props.compatibilityInfo"
283
+ @change-boot-order="emits('change-boot-order', $event)"
284
+ @send-data="emits('change-customize-hardware', $event)"
285
+ @get-storage="emits('get-storage', $event)"
286
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
287
+ @get-active-device-child="
288
+ emits('get-active-device-child', $event)
289
+ "
290
+ @show-datastore-child="emits('show-datastore-child', $event)"
291
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
292
+ @get-networks-table="emits('get-networks-table', $event)"
293
+ @get-pci-devices="emits('get-pci-devices')"
294
+ />
295
+ <!-- <div-->
296
+ <!-- class="vm-hardware-version-wrap justify-end flex flex-1 mt-4 mr-8"-->
297
+ <!-- >-->
298
+ <!-- <span class="vm-hardware-version">{{-->
299
+ <!-- props.compatibilityInfo-->
300
+ <!-- }}</span>-->
301
+ <!-- </div>-->
302
+ </div>
303
+ </template>
304
+ </ui-wizard-block>
305
+ <ui-wizard-block
306
+ v-if="
307
+ selectedStep.id === dynamicSteps.customizeHardwareTemplate &&
308
+ props.vmtSettings
309
+ "
310
+ >
311
+ <template #content>
312
+ <div
313
+ class="select-block-wrap overflow-auto h-full flex flex-col pr-8"
314
+ >
315
+ <common-vm-actions-common-customize-hardware
316
+ :project="props.project"
317
+ :is-vmt="props.isVmt"
318
+ :vm-name="vmForm.name"
319
+ :guest-machine-type="vmForm.guestMachineType"
320
+ :guest-os-family="vmForm.guestOsFamily"
321
+ :guest-os-version="vmForm.guestOsVersion"
322
+ :storage="vmForm.storage"
323
+ :hard-disks-for-boot-options="props.virtualHardwareHardDisksLocal"
324
+ :cd-dvd-drives-for-boot-options="
325
+ props.virtualHardwareCdDvdDrivesLocal
326
+ "
327
+ :networks-for-boot-options="props.virtualHardwareNetworksLocal"
328
+ :cd-dvd-drives="props.vmtSettings.cdDvdDrives || []"
329
+ :hard-disks="props.vmtSettings.hardDisks || []"
330
+ :networks="props.vmtSettings.networks || []"
331
+ :customize-hardware-submit="
332
+ props.customizeHardwareForTemplateSubmit
333
+ "
334
+ :max-cpus="props.maxCpus"
335
+ :max-memory="props.maxMemory"
336
+ :cpu-models="props.cpuModels"
337
+ :cpu="props.vmtSettings.cpu"
338
+ :memory="props.vmtSettings.memory"
339
+ :video-card="props.vmtSettings.videoCard"
340
+ :usb-controller="props.vmtSettings.usbController"
341
+ :pci-devices="props.vmtSettings.pciDevices"
342
+ :hard-disks-for-edit="props.vmtSettings.hardDisks || []"
343
+ :options="props.vmtSettings.options"
344
+ :selected-nav-item="props.selectedNavItem"
345
+ :nodes="props.nodes"
346
+ :files="props.files"
347
+ :networks-table="props.networksTable"
348
+ :error-validation-fields="props.errorValidationFields"
349
+ :get-datastore-table-func="props.getDatastoreTableFunc"
350
+ :datastore="props.datastore"
351
+ :is-datastore-loading="props.isDatastoreLoading"
352
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
353
+ :passthrough-devices="props.passthroughDevices"
354
+ :mediated-devices="props.mediatedDevices"
355
+ :compute-resource="vmForm.computeResource"
356
+ :compatibility-info="props.compatibilityInfo"
357
+ is-clone
358
+ @change-boot-order="emits('change-boot-order', $event)"
359
+ @send-data="emits('change-customize-hardware', $event)"
360
+ @get-storage="emits('get-storage', $event)"
361
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
362
+ @get-active-device-child="
363
+ emits('get-active-device-child', $event)
364
+ "
365
+ @show-datastore-child="emits('show-datastore-child', $event)"
366
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
367
+ @get-networks-table="emits('get-networks-table', $event)"
368
+ @get-pci-devices="emits('get-pci-devices')"
369
+ />
370
+ <!-- <div class="vm-hardware-version-wrap justify-end flex flex-1 mt-4">-->
371
+ <!-- <span class="vm-hardware-version">{{-->
372
+ <!-- props.compatibilityInfo-->
373
+ <!-- }}</span>-->
374
+ <!-- </div>-->
375
+ </div>
376
+ </template>
377
+ </ui-wizard-block>
378
+ <ui-wizard-block
379
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
380
+ :sub-title-height="heightReadyComplete"
381
+ >
382
+ <template #subTitle>
383
+ <div ref="subTitleBlockReadyComplete">
384
+ <div class="subtitle-block">
385
+ <ui-wizard-subtitle
386
+ :sub-title="localization.vmWizard.lastCreateSubtitle"
387
+ />
388
+ </div>
389
+ </div>
390
+ </template>
391
+ <template #content>
392
+ <div class="select-block-wrap h-full flex flex-col mt-3">
393
+ <div v-if="props.isShowPowerOn" class="power-on-by-default-wrap">
394
+ <ui-checkbox
395
+ v-model="isPowerOnByDefault"
396
+ :label-text="localization.common.powerOnByDefault"
397
+ test-id="power-on-by-default"
398
+ size="md"
399
+ />
400
+ </div>
401
+
402
+ <div v-if="props.isShowPowerOn" class="divider my-4"></div>
403
+
404
+ <common-ready-to-complete
405
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
406
+ :data="props.readyCompleteTableInfo"
407
+ />
408
+ <div
409
+ class="vm-hardware-version-wrap justify-end flex flex-1 mt-4 pb-4"
410
+ >
411
+ <span class="vm-hardware-version">{{
412
+ props.compatibilityInfo
413
+ }}</span>
414
+ </div>
415
+ </div>
416
+ </template>
417
+ </ui-wizard-block>
418
+ </template>
419
+ </ui-wizard>
420
+ </template>
421
+
422
+ <script setup lang="ts">
423
+ import { useElementSize } from '@vueuse/core'
424
+ import type { UI_I_WizardTexts } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
425
+ import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
426
+ import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
427
+ import type {
428
+ UI_I_Localization,
429
+ UI_I_ArbitraryObject,
430
+ } from '~/lib/models/interfaces'
431
+ import type { UI_T_Project } from '~/lib/models/types'
432
+ import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
433
+ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
434
+ import type {
435
+ UI_I_DatastoreTableItem,
436
+ UI_I_FolderOrFileTreePayload,
437
+ } from '~/lib/models/store/storage/interfaces'
438
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
439
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
440
+ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
441
+ import type {
442
+ // UI_T_AddVmFinishFunc,
443
+ UI_T_SelectedNavItem,
444
+ } from '~/components/common/vm/actions/common/lib/models/types'
445
+ import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
446
+ import type {
447
+ // UI_I_Capabilities,
448
+ UI_I_VmForm,
449
+ } from '~/components/common/vm/actions/common/lib/models/interfaces'
450
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
451
+ import type {
452
+ UI_I_SendDataNewCdDvdDrive,
453
+ UI_I_SendDataNewHardDisk,
454
+ UI_I_SendDataNewNetwork,
455
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
456
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
457
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
458
+ import type {
459
+ UI_I_MediatedDevice,
460
+ UI_I_PciDevice,
461
+ UI_I_VmSettings,
462
+ } from '~/lib/models/store/vm/interfaces'
463
+ import type { UI_I_NameTestIds } from '~/components/common/wizards/common/steps/name/lib/models/interfaces'
464
+ import { dynamicSteps } from '~/components/common/vm/actions/add/lib/config/steps'
465
+
466
+ const vmForm = defineModel<UI_I_VmForm>('vmForm', {
467
+ required: true,
468
+ })
469
+ const selectedCreateType = defineModel<string>('selectedCreateType', {
470
+ required: true,
471
+ })
472
+ const isPowerOnByDefault = defineModel<boolean>('isPowerOnByDefault', {
473
+ required: true,
474
+ })
475
+
476
+ const props = withDefaults(
477
+ defineProps<{
478
+ project: UI_T_Project
479
+ isVmt: boolean
480
+ nodes: UI_I_FileTreeNode[]
481
+ files: UI_I_FileTreeNode[]
482
+ networksTable: UI_I_NetworkTableItem[]
483
+ datastore: UI_I_DatastoreTableItem[]
484
+ isDatastoreLoading: boolean
485
+ errorValidationFields: UI_I_ErrorValidationField[]
486
+ readyCompleteTableInfo: UI_I_TableInfoItem[]
487
+ vmCpuHelpTextSecond: string
488
+ importFromVMWarevSphere: string
489
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
490
+ passthroughDevices: UI_I_PciDevice[]
491
+ mediatedDevices: UI_I_MediatedDevice[]
492
+ templatesTree: UI_I_TreeNode[]
493
+ wizard: Wizard
494
+ selectedScheme: number[]
495
+ templateSubmit: null | Function
496
+ nameFormSubmit: null | Function
497
+ storageSubmit: null | Function
498
+ customizeHardwareSubmit: null | Function
499
+ customizeHardwareForTemplateSubmit: null | Function
500
+ isSphere: boolean
501
+ compatibility: UI_I_OptionItem[]
502
+ guestOsFamilies: UI_I_OptionItem[]
503
+ guestOsVersions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
504
+ machineTypes: UI_I_OptionItem[]
505
+ virtualHardwareHardDisksLocal: UI_I_SendDataNewHardDisk[] | null
506
+ virtualHardwareCdDvdDrivesLocal: UI_I_SendDataNewCdDvdDrive[] | null
507
+ virtualHardwareNetworksLocal: UI_I_SendDataNewNetwork[] | null
508
+ maxCpus: number
509
+ maxMemory: number
510
+ cpuModels: UI_I_OptionItem[]
511
+ selectedNavItem: UI_T_SelectedNavItem
512
+ compatibilityInfo: string
513
+ isShowPowerOn: boolean
514
+ validateEmptyName: boolean
515
+ validationDescription: string
516
+ nameExistValidation: string
517
+ isShowSelectTemplate: boolean
518
+ title: string
519
+ nameRequestUrl: string
520
+ nameTestIds: UI_I_NameTestIds
521
+ isLoadingComputeTree?: boolean // для сферы
522
+ computeResourceAlert?: string[] // для сферы
523
+ compatibilityText?: [string, string] // для сферы
524
+ dataCenter?: UI_I_TreeNode | null // для сферы
525
+ computeResourceTree?: UI_I_TreeNode[] // для сферы
526
+ locationNodes?: UI_I_TreeNode[] // для сферы
527
+ allowedLocationKinds?: number[] // для сферы
528
+ locationDescription?: string // для сферы
529
+ vmtSettings?: UI_I_VmSettings | null // для шаблонов
530
+ isLoading?: boolean
531
+ selectedTemplateId?: string
532
+ }>(),
533
+ {
534
+ isLoadingComputeTree: false,
535
+ computeResourceAlert: () => [],
536
+ compatibilityText: () => [],
537
+ dataCenter: null,
538
+ computeResourceTree: undefined,
539
+ locationNodes: () => [],
540
+ vmtSettings: undefined,
541
+ isLoading: undefined,
542
+ selectedTemplateId: '',
543
+ }
544
+ )
545
+
546
+ const emits = defineEmits<{
547
+ (event: 'get-storage', value: UI_I_TablePayload): void
548
+ (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
549
+ (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
550
+ (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
551
+ (event: 'remove-error-by-title', value: string): void
552
+ (event: 'get-networks-table', value: UI_I_TablePayload): void
553
+ (event: 'get-pci-devices'): void
554
+ (event: 'change-steps', value: UI_I_WizardStep[]): void
555
+ (event: 'finish'): void
556
+ (event: 'change-template', value: UI_I_TreeNode): void
557
+ (event: 'change-name', value: [string, UI_I_TreeNode | null]): void
558
+ (event: 'change-storage', value: UI_I_DatastoreTableItem | null): void
559
+ (event: 'change-select-options', value: string[]): void
560
+ (event: 'change-compatibility', value: UI_I_OptionItem): void
561
+ (event: 'change-boot-order', value: UI_T_ChangeBootOrder): void
562
+ (
563
+ event: 'change-customize-hardware',
564
+ value: UI_I_SendDataCustomizeHardware
565
+ ): void
566
+ (event: 'hide'): void
567
+ }>()
568
+
569
+ const localization = computed<UI_I_Localization>(() => useLocal())
570
+
571
+ const location = ref<UI_I_TreeNode | null>(props.dataCenter) // для сферы
572
+
573
+ const computeResourceTreeLocal = computed<UI_I_TreeNode | null>(() => {
574
+ // для сферы
575
+ return props.computeResourceTree?.[0] || null
576
+ })
577
+
578
+ const texts = computed<UI_I_WizardTexts>(() => ({
579
+ cancel: localization.value.common.cancel,
580
+ back: localization.value.common.backCap,
581
+ processing: localization.value.common.processing,
582
+ next: localization.value.common.next,
583
+ finish: localization.value.common.create,
584
+ incompleteTitle: localization.value.common.incompleteProcess,
585
+ incompleteMessage: localization.value.common.incompleteProcessMessage,
586
+ incompleteCancel: localization.value.common.cancel,
587
+ incompleteLeave: localization.value.common.leave,
588
+ step: localization.value.common.step,
589
+ of: localization.value.common.of2,
590
+ }))
591
+
592
+ const subTitleBlock0 = ref<HTMLElement | null>(null)
593
+ const { height: height0 } = useElementSize(subTitleBlock0)
594
+
595
+ const subTitleBlockName = ref<HTMLElement | null>(null)
596
+ const { height: heightName } = useElementSize(subTitleBlockName)
597
+ const subTitleBlockComputeResource = ref<HTMLElement | null>(null)
598
+ const { height: heightComputeResource } = useElementSize(
599
+ subTitleBlockComputeResource
600
+ )
601
+ const subTitleBlockStorage = ref<HTMLElement | null>(null)
602
+ const { height: heightStorage } = useElementSize(subTitleBlockStorage)
603
+ const subTitleBlockCompatibility = ref<HTMLElement | null>(null)
604
+ const { height: heightCompatibility } = useElementSize(
605
+ subTitleBlockCompatibility
606
+ )
607
+ const subTitleBlockOs = ref<HTMLElement | null>(null)
608
+ const { height: heightOs } = useElementSize(subTitleBlockOs)
609
+ const subTitleBlockReadyComplete = ref<HTMLElement | null>(null)
610
+ const { height: heightReadyComplete } = useElementSize(
611
+ subTitleBlockReadyComplete
612
+ )
613
+ const subTitleBlockSelectOptions = ref<HTMLElement | null>(null)
614
+ const { height: heightSelectOptions } = useElementSize(
615
+ subTitleBlockSelectOptions
616
+ )
617
+
618
+ const isNameAlertWrapperEmpty = ref<boolean>(false)
619
+ // const isComputeResourceAlertWrapperEmpty = ref<boolean>(false)
620
+ const isStorageAlertWrapperEmpty = ref<boolean>(false)
621
+ const isCompatibilityAlertWrapperEmpty = ref<boolean>(false)
622
+ </script>
623
+
624
+ <style>
625
+ :root {
626
+ --ready-to-complate-run-bg-color: #e9ebed66;
627
+ --ready-to-complate-run-border-color: #e9ebeda3;
628
+ }
629
+ :root.dark-theme {
630
+ --ready-to-complate-run-bg-color: #e9ebed0f;
631
+ --ready-to-complate-run-border-color: #e9ebed1f;
632
+ }
633
+ </style>
634
+ <style scoped lang="scss">
635
+ .subtitle-block {
636
+ display: flex;
637
+ flex-direction: column;
638
+ border-bottom: 1px solid var(--wizard-line);
639
+ padding-bottom: 12px;
640
+ }
641
+ .select-block-wrap {
642
+ &.customize-hardware {
643
+ height: inherit;
644
+ max-height: 100%;
645
+ //padding-bottom: 16px;
646
+
647
+ :deep(.tabs-wrapper) {
648
+ overflow-y: auto;
649
+ }
650
+ :deep(.tabs-wrapper),
651
+ :deep(.errors-alert),
652
+ :deep(.action-wrap) {
653
+ margin-right: 32px;
654
+ }
655
+ :deep(.virtual-hardware-content-block),
656
+ :deep(.vm-options) {
657
+ padding-right: 18px;
658
+ }
659
+ }
660
+ .vm-hardware-version-wrap {
661
+ align-items: flex-end;
662
+ text-align: right;
663
+
664
+ .vm-hardware-version {
665
+ font-size: 13px;
666
+ color: #9da6ad; // for light and dark
667
+ }
668
+ }
669
+ :deep(.details-list) {
670
+ margin-top: 0;
671
+ }
672
+ }
673
+
674
+ .power-on-by-default-wrap {
675
+ padding: 12px;
676
+ border-radius: 8px;
677
+ background-color: var(--ready-to-complate-run-bg-color);
678
+ }
679
+ .divider {
680
+ width: 100%;
681
+ min-height: 1px;
682
+ background-color: var(--ready-to-complate-run-border-color);
683
+ }
684
+ .select-template-step {
685
+ :deep(.ui-wizard-content-right-bottom) {
686
+ height: 8px;
687
+ }
688
+ }
689
+ </style>