bfg-common 1.5.548 → 1.5.550

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