bfg-common 1.5.323 → 1.5.326

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