bfg-common 1.5.335 → 1.5.336

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 (136) 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/scss/common/icons/icons-1.scss +3 -3
  7. package/assets/scss/common/icons/icons-5.scss +5 -5
  8. package/components/atoms/TheIcon3.vue +50 -50
  9. package/components/atoms/collapse/CollapseNav.vue +170 -170
  10. package/components/atoms/collapse/CollapseNavItem.vue +226 -226
  11. package/components/atoms/nav/NavBar.vue +147 -147
  12. package/components/atoms/perPage/PerPage.vue +58 -58
  13. package/components/atoms/table/dataGrid/DataGrid.vue +1717 -1717
  14. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  15. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  16. package/components/atoms/tabs/VerticalTabs.vue +105 -105
  17. package/components/common/backup/storage/actions/add/lib/config/steps.ts +168 -168
  18. package/components/common/backup/storage/actions/add/steps/hostAccessibility/HostAccessibility.vue +52 -52
  19. package/components/common/backup/storage/actions/add/steps/readyComplete/ReadyComplete.vue +45 -45
  20. package/components/common/backup/storage/actions/delete/Delete.vue +65 -65
  21. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  22. package/components/common/context/lib/models/interfaces.ts +33 -33
  23. package/components/common/diagramMain/DiagramMain.vue +897 -897
  24. package/components/common/diagramMain/modals/lib/config/networkModal.ts +398 -398
  25. package/components/common/diagramMain/network/Network.vue +141 -141
  26. package/components/common/layout/theHeader/helpMenu/About.vue +82 -82
  27. package/components/common/layout/theHeader/userMenu/modals/preferences/view/ViewOld.vue +112 -112
  28. package/components/common/monitor/overview/OverviewOld.vue +139 -139
  29. package/components/common/pages/home/headline/Headline.vue +45 -45
  30. package/components/common/pages/home/headline/HeadlineOld.vue +42 -42
  31. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  32. package/components/common/pages/home/widgets/Widgets.vue +49 -49
  33. package/components/common/pages/home/widgets/WidgetsNew.vue +88 -88
  34. package/components/common/pages/home/widgets/WidgetsOld.vue +36 -36
  35. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  36. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  37. package/components/common/pages/home/widgets/vms/Vms.vue +26 -26
  38. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  39. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  40. package/components/common/pages/packages/Packages.vue +208 -208
  41. package/components/common/pages/shortcuts/block/BlockOld.vue +68 -68
  42. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  43. package/components/common/recursionTree/RecursionTree.vue +223 -223
  44. package/components/common/select/button/ButtonDropdown.vue +112 -112
  45. package/components/common/select/radio/RadioGroup.vue +135 -135
  46. package/components/common/spiceConsole/Drawer.vue +377 -377
  47. package/components/common/spiceConsole/SpiceConsole.vue +127 -127
  48. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  49. package/components/common/tools/Actions.vue +207 -207
  50. package/components/common/vm/actions/add/New.vue +647 -647
  51. package/components/common/vm/actions/add/Old.vue +388 -388
  52. package/components/common/vm/actions/add/folderTreeView/FolderTreeView.vue +72 -72
  53. package/components/common/vm/actions/add/folderTreeView/New.vue +40 -40
  54. package/components/common/vm/actions/add/folderTreeView/Old.vue +50 -50
  55. package/components/common/vm/actions/clone/Clone.vue +823 -823
  56. package/components/common/vm/actions/clone/lib/config/steps.ts +291 -291
  57. package/components/common/vm/actions/clone/toTemplate/lib/config/steps.ts +116 -116
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +321 -321
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/BrowseView.vue +227 -227
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +100 -100
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +232 -232
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveOld.vue +168 -168
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +25 -25
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +78 -78
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaOld.vue +50 -50
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/TooltipNew.vue +154 -154
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +155 -155
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +220 -220
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +307 -307
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +385 -385
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/LocationOld.vue +85 -85
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +288 -288
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config.ts +94 -94
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +205 -205
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +66 -66
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoOld.vue +62 -62
  81. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  82. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoOld.vue +76 -76
  83. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +15 -15
  84. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteNew.vue +42 -42
  85. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteOld.vue +30 -30
  86. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridOld.vue +84 -84
  87. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  88. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +154 -154
  89. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
  90. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +155 -155
  91. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +130 -130
  92. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +113 -113
  93. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  94. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  95. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
  96. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +95 -95
  97. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +155 -155
  98. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  99. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/KeymapOld.vue +44 -44
  100. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -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/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -44
  103. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  104. package/components/common/vm/actions/common/select/computeResource/treeView/TreeView.vue +118 -118
  105. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  106. package/components/common/vm/actions/common/select/createType/lib/config/items.ts +48 -48
  107. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  108. package/components/common/vm/actions/common/select/name/Name.vue +174 -174
  109. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  110. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  111. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  112. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  113. package/components/common/vm/actions/editSettings/EditSettings.vue +242 -242
  114. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  115. package/components/common/vmt/actions/add/lib/models/interfaces.ts +23 -23
  116. package/components/common/wizards/network/add/steps/SelectConnectionType.vue +104 -104
  117. package/components/common/wizards/network/add/steps/SelectedTargetDevice.vue +467 -467
  118. package/components/common/wizards/vm/migrate/Migrate.vue +349 -349
  119. package/components/common/wizards/vm/migrate/lib/config/constructDataReady.ts +220 -220
  120. package/components/common/wizards/vm/migrate/lib/config/steps.ts +157 -157
  121. package/components/common/wizards/vm/migrate/lib/validations.ts +68 -68
  122. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  123. package/components/common/wizards/vm/migrate/select/network/table/network/lib/config/advancedTable.ts +91 -91
  124. package/components/common/wizards/vm/migrate/select/type/lib/config/typeOptions.ts +45 -45
  125. package/composables/productNameLocal.ts +30 -30
  126. package/composables/useAppVersion.ts +21 -21
  127. package/composables/useLocalStorage.ts +1 -1
  128. package/package.json +1 -1
  129. package/plugins/date.ts +233 -233
  130. package/plugins/panelStates.ts +70 -70
  131. package/plugins/text.ts +59 -59
  132. package/public/spice-console/lib/images/bitmap.js +203 -203
  133. package/public/spice-console/network/spicechannel.js +387 -387
  134. package/store/main/mutations.ts +7 -7
  135. package/store/main/state.ts +7 -7
  136. package/store/tasks/mappers/recentTasks.ts +64 -64
@@ -1,647 +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
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>
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>