bfg-common 1.1.96 → 1.1.97

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.
@@ -2068,5 +2068,10 @@
2068
2068
  "invalidCertificateDescription": "Увага! Па змаўчанні ўсталяваны самазавераны сертыфікат SSL. Каб працягваць працаваць з гэтым сертыфікатам SSL, вам неабходна дадаць яго ў каранёвае сховішча. Гэта можна зрабіць на ўсіх кліенцкіх прыладах або замяніць сертыфікатам SSL арганізацыі, або выкарыстоўваць свой уласны.",
2069
2069
  "youAreHere": "Вы тут",
2070
2070
  "showAllDatastores": "Паказаць усе сховішчы дадзеных",
2071
- "showDatastoresConnectedAllHosts": "Паказаць сховішчы даных, падлучаныя да ўсіх хостаў"
2071
+ "showDatastoresConnectedAllHosts": "Паказаць сховішчы даных, падлучаныя да ўсіх хостаў",
2072
+ "selectCloneOptions": "Выберыце параметры клонавання",
2073
+ "selectFurtherCloneOptions": "Выберыце дадатковыя параметры клонавання",
2074
+ "customizeTheOperatingSystem": "Наладзьце аперацыйную сістэму",
2075
+ "customizeThisVirtualMachineHardware": "Наладзьце апаратнае забеспячэнне гэтай віртуальнай машыны",
2076
+ "powerOnVirtualMachineAfterCreation": "Уключыце віртуальную машыну пасля стварэння"
2072
2077
  }
@@ -2071,5 +2071,10 @@
2071
2071
  "invalidCertificateDescription": "Attention! A self-signed SSL certificate is installed by default. To continue working with this SSL certificate, you need to add it to the root store. This can be done on all client devices or replaced with the organization's SSL certificate, or use your own.",
2072
2072
  "youAreHere": "You are here",
2073
2073
  "showAllDatastores": "Show all datastores",
2074
- "showDatastoresConnectedAllHosts": "Show datastores connected to all hosts"
2074
+ "showDatastoresConnectedAllHosts": "Show datastores connected to all hosts",
2075
+ "selectCloneOptions": "Select clone options",
2076
+ "selectFurtherCloneOptions": "Select further clone options",
2077
+ "customizeTheOperatingSystem": "Customize the operating system",
2078
+ "customizeThisVirtualMachineHardware": "Customize this virtual machine's hardware",
2079
+ "powerOnVirtualMachineAfterCreation": "Power on virtual machine after creation"
2075
2080
  }
@@ -2071,5 +2071,10 @@
2071
2071
  "invalidCertificateDescription": "Ուշադրություն. Լռելյայն տեղադրվում է ինքնաստորագրված SSL վկայագիր: Այս SSL վկայագրի հետ աշխատելը շարունակելու համար դուք պետք է այն ավելացնեք արմատային խանութում: Սա կարելի է անել բոլոր հաճախորդի սարքերում կամ փոխարինել կազմակերպության SSL վկայականով, կամ օգտագործել ձերը:",
2072
2072
  "youAreHere": "Դու այստեղ ես",
2073
2073
  "showAllDatastores": "Ցույց տալ բոլոր տվյալների պահեստները",
2074
- "showDatastoresConnectedAllHosts": "Ցուցադրել տվյալների պահեստները, որոնք միացված են բոլոր հոսթներին"
2074
+ "showDatastoresConnectedAllHosts": "Ցուցադրել տվյալների պահեստները, որոնք միացված են բոլոր հոսթներին",
2075
+ "selectCloneOptions": "Ընտրեք կլոնավորման տարբերակները",
2076
+ "selectFurtherCloneOptions": "Ընտրեք կլոնավորման հետագա տարբերակները",
2077
+ "customizeTheOperatingSystem": "Անհատականացրեք օպերացիոն համակարգը",
2078
+ "customizeThisVirtualMachineHardware": "Անհատականացրեք այս վիրտուալ մեքենայի ապարատը",
2079
+ "powerOnVirtualMachineAfterCreation": "Միացնել վիրտուալ մեքենան ստեղծումից հետո"
2075
2080
  }
@@ -2071,5 +2071,10 @@
2071
2071
  "invalidCertificateDescription": "Назар аударыңыз! Өздігінен қол қойылған SSL сертификаты әдепкі бойынша орнатылады. Осы SSL сертификатымен жұмыс істеуді жалғастыру үшін оны түбірлік қоймаға қосу керек. Мұны барлық клиенттік құрылғыларда жасауға немесе ұйымның SSL сертификатымен ауыстыруға немесе өзіңізді пайдалануға болады.",
2072
2072
  "youAreHere": "Сен мындасың",
2073
2073
  "showAllDatastores": "Барлық деректер қоймаларын көрсету",
2074
- "showDatastoresConnectedAllHosts": "Барлық хосттарға қосылған деректер қоймаларын көрсету"
2074
+ "showDatastoresConnectedAllHosts": "Барлық хосттарға қосылған деректер қоймаларын көрсету",
2075
+ "selectCloneOptions": "Клондау опцияларын таңдаңыз",
2076
+ "selectFurtherCloneOptions": "Қосымша клондау опцияларын таңдаңыз",
2077
+ "customizeTheOperatingSystem": "Операциялық жүйені теңшеңіз",
2078
+ "customizeThisVirtualMachineHardware": "Осы виртуалды машинаның аппараттық құралын теңшеңіз",
2079
+ "powerOnVirtualMachineAfterCreation": "Жасалғаннан кейін виртуалды машинаны қосыңыз"
2075
2080
  }
@@ -2071,5 +2071,10 @@
2071
2071
  "invalidCertificateDescription": "Внимание! Установлен самоподписанный SSL-сертификат по умолчанию. Для продолжения работы с данным SSL-сертификатом необходимо его добавить в корневое хранилище. Это можно сделать на всех клиентских устройствах или заменить на SSL-сертификат организации, либо использовать собственный.",
2072
2072
  "youAreHere": "Вы здесь",
2073
2073
  "showAllDatastores": "Показать все хранилища данных",
2074
- "showDatastoresConnectedAllHosts": "Показать хранилища данных, подключенные ко всем хостам"
2074
+ "showDatastoresConnectedAllHosts": "Показать хранилища данных, подключенные ко всем хостам",
2075
+ "selectCloneOptions": "Выберите параметры клонирования",
2076
+ "selectFurtherCloneOptions": "Выберите дополнительные параметры клонирования",
2077
+ "customizeTheOperatingSystem": "Настройте операционную систему",
2078
+ "customizeThisVirtualMachineHardware": "Настройте оборудование этой виртуальной машины",
2079
+ "powerOnVirtualMachineAfterCreation": "Включите виртуальную машину после создания."
2075
2080
  }
@@ -2071,5 +2071,10 @@
2071
2071
  "invalidCertificateDescription": "注意力!默认情况下安装自签名 SSL 证书。要继续使用此 SSL 证书,您需要将其添加到根存储区。这可以在所有客户端设备上完成,或者替换为组织的 SSL 证书,或者使用您自己的证书。",
2072
2072
  "youAreHere": "你在这里",
2073
2073
  "showAllDatastores": "显示所有数据存储",
2074
- "showDatastoresConnectedAllHosts": "显示连接到所有主机的数据存储"
2074
+ "showDatastoresConnectedAllHosts": "显示连接到所有主机的数据存储",
2075
+ "selectCloneOptions": "选择克隆选项",
2076
+ "selectFurtherCloneOptions": "选择更多克隆选项",
2077
+ "customizeTheOperatingSystem": "定制操作系统",
2078
+ "customizeThisVirtualMachineHardware": "自定义该虚拟机的硬件",
2079
+ "powerOnVirtualMachineAfterCreation": "创建后启动虚拟机"
2075
2080
  }
@@ -0,0 +1,544 @@
1
+ <template>
2
+ <div class="add-vm">
3
+ <atoms-modal-by-steps
4
+ test-id="add-vm-wizard"
5
+ :show="true"
6
+ :title="localization.cloneExistingVirtualMachine"
7
+ :step-items="stepItems"
8
+ :step-position="stepPosition"
9
+ :loading="loading"
10
+ @change-step="onChangeStep"
11
+ @hide="onHideModal"
12
+ >
13
+ <template #modalBody>
14
+ <div class="add-vm-context">
15
+ <div class="context-title-wrap">
16
+ <p>{{ stepSubTitle }}</p>
17
+ </div>
18
+
19
+ <common-vm-actions-add-select-name
20
+ v-show="stepPosition === 1"
21
+ :show="stepPosition === 1"
22
+ :name-form-submit="nameFormSubmit"
23
+ :project="props.project"
24
+ @submit="onChangeNameAndNext(...$event)"
25
+ @check-name="emits('check-name', $event)"
26
+ @loading="loading = $event"
27
+ />
28
+ <common-vm-actions-add-select-storage
29
+ v-show="stepPosition === 2"
30
+ :storage-submit="storageSubmit"
31
+ :datastore="props.datastore"
32
+ :get-datastore-table-func="props.getDatastoreTableFunc"
33
+ @submit="onChangeStorageAndNext"
34
+ />
35
+ <common-vm-actions-clone-select-options
36
+ v-show="stepPosition === 3"
37
+ :select-options-submit="selectOptionsSubmit"
38
+ @submit="onChangeSelectOptionsAndNext"
39
+ />
40
+ <common-vm-actions-add-customize-hardware
41
+ v-show="stepPosition === 4"
42
+ v-model:vm-name="vmName"
43
+ v-model:guest-machine-type="vmSettings.guestMachineType"
44
+ v-model:guest-os-family="vmSettings.guestOsFamily"
45
+ v-model:guest-os-version="vmSettings.guestOsVersion"
46
+ :storage="vmSettings.storage"
47
+ :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
48
+ :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
49
+ :networks-for-boot-options="virtualHardwareNetworksLocal"
50
+ :cd-dvd-drives="vmSettings.cdDvdDrives"
51
+ :hard-disks="vmSettings.hardDisks"
52
+ :networks="vmSettings.networks"
53
+ :customize-hardware-submit="0"
54
+ :max-cpus="vmSettings.maxCpus"
55
+ :max-memory="vmSettings.maxMemory"
56
+ :cpu-models="vmSettings.cpuModels"
57
+ :cpu="vmSettings.cpu"
58
+ :memory="vmSettings.memory"
59
+ :video-card="vmSettings.videoCard"
60
+ :usb-controller="vmSettings.usbController"
61
+ :pci-devices="vmSettings.pciDevices"
62
+ :selected-nav-item="selectedNavItem"
63
+ :hard-disks-for-edit="vmSettings.hardDisks"
64
+ :options="vmSettings.options"
65
+ :nodes="props.nodes"
66
+ :files="props.files"
67
+ :networks-table="props.networksTable"
68
+ :error-validation-fields="props.errorValidationFields"
69
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
70
+ :passthrough-devices="props.passthroughDevices"
71
+ :get-datastore-table-func="props.getDatastoreTableFunc"
72
+ :datastore="props.datastore"
73
+ :is-edit="false"
74
+ @get-storage="emits('get-storage', $event)"
75
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
76
+ @get-active-device-child="emits('get-active-device-child', $event)"
77
+ @show-datastore-child="emits('show-datastore-child', $event)"
78
+ @get-networks-table="emits('get-networks-table', $event)"
79
+ @get-pci-devices="emits('get-pci-devices')"
80
+ @change-boot-order="onChangeBootOrder"
81
+ @send-data="onChangeCustomizeHardware"
82
+ />
83
+ <common-vm-actions-clone-ready-to-complete
84
+ v-if="stepPosition === 5"
85
+ :ready-complete-table-info="props.readyCompleteTableInfo"
86
+ />
87
+ </div>
88
+ </template>
89
+
90
+ <template #modalFooter>
91
+ <div class="flex-align-center flex-space-between w-100">
92
+ <div class="power-on-by-default-wrap">
93
+ <template v-if="stepPosition === 5">
94
+ <input
95
+ id="power-on-by-default"
96
+ v-model="isPowerOnByDefault"
97
+ type="checkbox"
98
+ />
99
+ <label for="power-on-by-default" class="label-text-normal">{{
100
+ localization.powerOnByDefault
101
+ }}</label>
102
+ </template>
103
+ </div>
104
+ <div class="flex-align-center">
105
+ <button
106
+ id="vm-wizard-cancel-button"
107
+ class="btn btn-link"
108
+ @click="onHideModal"
109
+ >
110
+ {{ localization.cancel }}
111
+ </button>
112
+ <button
113
+ v-show="stepPosition > 0"
114
+ id="vm-wizard-back-button"
115
+ class="btn btn-outline"
116
+ @click="onBack"
117
+ >
118
+ {{ localization.back }}
119
+ </button>
120
+ <button
121
+ v-if="stepPosition === stepItems.length - 1"
122
+ id="vm-wizard-finish-button"
123
+ class="btn btn-success"
124
+ @click="onFinish"
125
+ >
126
+ {{ localization.finish }}
127
+ </button>
128
+ <button
129
+ v-else
130
+ id="vm-wizard-next-button"
131
+ class="btn btn-primary"
132
+ @click="onNext(false)"
133
+ >
134
+ {{ localization.next }}
135
+ </button>
136
+ </div>
137
+ </div>
138
+ </template>
139
+ </atoms-modal-by-steps>
140
+ </div>
141
+ </template>
142
+
143
+ <script setup lang="ts">
144
+ import type {
145
+ UI_I_DatastoreTableItem,
146
+ UI_I_FolderOrFileTreePayload,
147
+ } from '~/models/store/storage/interfaces'
148
+ import type { UI_I_NetworkTableItem } from '~/models/store/network/interfaces'
149
+ import type { API_UI_I_Error, UI_I_TablePayload } from '~/models/store/interfaces'
150
+ import type { UI_I_FileTreeNode } from '~/components/models/interfaces'
151
+ import type { UI_I_Localization } from '~/models/interfaces'
152
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/add/customizeHardware/models/interfaces'
153
+ import type { UI_I_ErrorValidationField } from '~/models/store/interfaces'
154
+ import type {
155
+ UI_I_SendDataCpu,
156
+ UI_I_SendDataMemory,
157
+ UI_I_SendDataNewCdDvdDrive,
158
+ UI_I_SendDataNewHardDisk,
159
+ UI_I_SendDataNewNetwork,
160
+ } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/interfaces'
161
+ import type {
162
+ UI_T_AddVmFinishFunc,
163
+ UI_T_SelectedNavItem,
164
+ } from '~/components/common/vm/actions/add/models/types'
165
+ import type {
166
+ UI_I_OptionItem,
167
+ UI_I_VerticalStepItem,
168
+ } from '~/components/atoms/models/interfaces'
169
+ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
170
+ import type { UI_I_ConfigurePciDevicesTable } from '~/models/store/host/interfaces'
171
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/models/types'
172
+ import type { UI_T_Project } from '~/models/types'
173
+ import type { UI_I_VmSettings } from '~/models/store/vm/interfaces'
174
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/clone/models/interfaces'
175
+ import { capabilities } from '~/components/common/vm/actions/add/config/capabilities'
176
+ import {
177
+ stepItemsFunc,
178
+ subTitleFunc,
179
+ } from '~/components/common/vm/actions/clone/utils'
180
+
181
+ const props = defineProps<{
182
+ project: UI_T_Project
183
+ vmSettings: UI_I_VmSettings | null
184
+ nodes: UI_I_FileTreeNode[]
185
+ files: UI_I_FileTreeNode[]
186
+ networksTable: UI_I_NetworkTableItem[]
187
+ datastore: UI_I_DatastoreTableItem[]
188
+ errorValidationFields: UI_I_ErrorValidationField[]
189
+ readyCompleteTableInfo: UI_I_TableInfoItem[]
190
+ vmCpuHelpTextSecond: string
191
+ finishFunc: UI_T_AddVmFinishFunc
192
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
193
+ validateSendDataFunc: UI_T_AddVmFinishFunc<
194
+ [UI_T_SelectedNavItem, null | number] | null
195
+ >
196
+ passthroughDevices: UI_I_ConfigurePciDevicesTable | null
197
+ vmNameInWizard: string
198
+ }>()
199
+
200
+ const emits = defineEmits<{
201
+ (event: 'check-name', value: [string, (error: API_UI_I_Error) => void]): void
202
+ (event: 'get-storage', value: UI_I_TablePayload): void
203
+ (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
204
+ (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
205
+ (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
206
+ (event: 'remove-error-by-title', value: string): void
207
+ (event: 'get-networks-table', value: UI_I_TablePayload): void
208
+ (event: 'get-pci-devices'): void
209
+ (event: 'hide'): void
210
+ }>()
211
+
212
+ const localization = computed<UI_I_Localization>(() => useLocal())
213
+
214
+ const stepPosition = ref<number>(0)
215
+ watch(stepPosition, (newValue) => {
216
+ if (newValue === 5) validateSendData()
217
+ })
218
+ const stepItems = ref<UI_I_VerticalStepItem[]>([])
219
+ stepItems.value = stepItemsFunc(localization.value, props.project)
220
+
221
+ const subTitle: string[] = subTitleFunc(localization.value, props.project)
222
+ const stepSubTitle = computed<string>(() => subTitle[stepPosition.value])
223
+
224
+ const storageIdCash = ref<string | null>(null)
225
+ const vmForm = ref<UI_I_VmForm>({
226
+ name: '',
227
+ storage: null,
228
+ options: [],
229
+ })
230
+
231
+ const isPowerOnByDefault = ref<boolean>(true)
232
+
233
+ const onChangeNameAndNext = (name: string): void => {
234
+ checkLocalChangeAndChangeStepStatus()
235
+
236
+ vmForm.value.name = name
237
+ onNext(true)
238
+ }
239
+
240
+ const onChangeStorageAndNext = (
241
+ storage: UI_I_DatastoreTableItem | null
242
+ ): void => {
243
+ if (!storage) return
244
+
245
+ const hasChanges = storage.id !== storageIdCash.value
246
+ if (hasChanges) checkLocalChangeAndChangeStepStatus()
247
+
248
+ vmForm.value.storage = storage
249
+ storageIdCash.value = storage.id
250
+
251
+ onNext(true)
252
+ }
253
+
254
+ const onChangeSelectOptionsAndNext = (options: string[]): void => {
255
+ vmForm.value.options = options
256
+
257
+ onNext(true)
258
+ }
259
+
260
+ const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
261
+ const onChangeCustomizeHardware = (
262
+ data: UI_I_SendDataCustomizeHardware
263
+ ): void => {
264
+ customizeHardware.value = data
265
+ }
266
+
267
+ const virtualHardwareHardDisksLocal = computed<
268
+ UI_I_SendDataNewHardDisk[] | null
269
+ >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
270
+ const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
271
+ () => customizeHardware.value?.virtualHardware?.networks || null
272
+ )
273
+ const virtualHardwareCdDvdDrivesLocal = computed<
274
+ UI_I_SendDataNewCdDvdDrive[] | null
275
+ >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
276
+
277
+ const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
278
+ () => customizeHardware.value?.virtualHardware?.cpu || null
279
+ )
280
+ const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
281
+ () => customizeHardware.value?.virtualHardware?.memory || null
282
+ )
283
+ const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
284
+ const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
285
+ null
286
+ )
287
+ const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
288
+ const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
289
+ virtualHardwareHardDisks.value = data[0]
290
+ virtualHardwareCdDvdDrives.value = data[1]
291
+ virtualHardwareNetworks.value = data[2]
292
+ }
293
+
294
+ watch(
295
+ () => props.vmNameInWizard,
296
+ (newValue) => {
297
+ vmForm.value.name = newValue
298
+ }
299
+ )
300
+
301
+ const loading = ref<boolean>(false)
302
+ const validateSendData = (): void => {
303
+ loading.value = true
304
+ props
305
+ .validateSendDataFunc(
306
+ vmForm.value,
307
+ virtualHardwareCpu.value,
308
+ virtualHardwareMemory.value,
309
+ customizeHardware.value,
310
+ virtualHardwareNetworks.value,
311
+ virtualHardwareHardDisks.value,
312
+ virtualHardwareCdDvdDrives.value,
313
+ isPowerOnByDefault.value,
314
+ localization.value
315
+ )
316
+ .then((data) => {
317
+ loading.value = false
318
+ if (!data) return
319
+
320
+ selectedNavItem.value = data[0]
321
+ data[1] !== null && (stepPosition.value = data[1])
322
+ })
323
+ }
324
+ const onFinish = (): void => {
325
+ loading.value = true
326
+ props
327
+ .finishFunc(
328
+ vmForm.value,
329
+ virtualHardwareCpu.value,
330
+ virtualHardwareMemory.value,
331
+ customizeHardware.value,
332
+ virtualHardwareNetworks.value,
333
+ virtualHardwareHardDisks.value,
334
+ virtualHardwareCdDvdDrives.value,
335
+ isPowerOnByDefault.value,
336
+ localization.value
337
+ )
338
+ .then(() => {
339
+ onHideModal()
340
+ loading.value = false
341
+ })
342
+ }
343
+
344
+ const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
345
+
346
+ const nameFormSubmit = ref<number>(0)
347
+ const storageSubmit = ref<number>(0)
348
+ const selectOptionsSubmit = ref<number>(0)
349
+ const customizeHardwareSubmit = ref<number>(0)
350
+
351
+ const onNext = (force = false): void => {
352
+ const isValid = checkSubmit(force)
353
+ if (!isValid) {
354
+ return
355
+ }
356
+
357
+ const isDisabled = stepItems.value[cashStep]?.disabled
358
+ if (cashStep !== -1 && !isDisabled) {
359
+ stepPosition.value = cashStep
360
+ cashStep = -1
361
+ return
362
+ }
363
+
364
+ stepItems.value[stepPosition.value].complete = true
365
+ stepItems.value[stepPosition.value + 1].disabled = false
366
+ stepPosition.value++
367
+ }
368
+ const checkLocalChangeAndChangeStepStatus = (): void => {
369
+ stepItems.value = stepItems.value.map((step, index) => {
370
+ if (index > stepPosition.value) {
371
+ step.complete = false
372
+ step.disabled = index > stepPosition.value + 1
373
+ }
374
+
375
+ return step
376
+ })
377
+ }
378
+
379
+ const checkSubmit = (force = false): boolean => {
380
+ if (stepPosition.value === 1 && !force) {
381
+ nameFormSubmit.value++
382
+ return false
383
+ }
384
+ if (stepPosition.value === 2 && !force) {
385
+ storageSubmit.value++
386
+ return false
387
+ }
388
+ if (stepPosition.value === 3 && !force) {
389
+ selectOptionsSubmit.value++
390
+ return false
391
+ }
392
+ if (stepPosition.value === 4 && !force) {
393
+ customizeHardwareSubmit.value++
394
+ return false
395
+ }
396
+ return true
397
+ }
398
+ const checkSubmitByManual = (step: number): boolean => {
399
+ if (stepPosition.value === 1) {
400
+ nameFormSubmit.value++
401
+ return false
402
+ }
403
+ if (stepPosition.value === 2) {
404
+ storageSubmit.value++
405
+ return false
406
+ }
407
+ if (step === 6) {
408
+ customizeHardwareSubmit.value++
409
+ return false
410
+ }
411
+ return true
412
+ }
413
+ const onBack = (): void => {
414
+ stepPosition.value--
415
+ }
416
+ let cashStep = -1
417
+ const onChangeStep = (key: number): void => {
418
+ const isValid = checkSubmitByManual(key)
419
+ if (!isValid) {
420
+ cashStep = key
421
+ return
422
+ }
423
+
424
+ stepPosition.value = key
425
+ }
426
+
427
+ const compatibility = ref<UI_I_OptionItem[]>(capabilities.compatibility)
428
+ const cpuModels = ref<UI_I_OptionItem[]>(capabilities.cpuModels)
429
+ const maxCpus = ref<number>(capabilities.maxCpus)
430
+ const maxMemory = ref<number>(capabilities.maxMemory)
431
+
432
+ const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
433
+ const vmName = ref<string>(vmSettings.value?.name || '')
434
+ watch(vmSettings, (newValue) => {
435
+ vmName.value = newValue?.name || ''
436
+ })
437
+
438
+ const onHideModal = (): void => {
439
+ emits('hide')
440
+ }
441
+ </script>
442
+
443
+ <style scoped lang="scss">
444
+ :deep(.has-solid.close-icon.clr-icon) {
445
+ width: 20px;
446
+ top: 0;
447
+ }
448
+ .add-vm-context {
449
+ padding: 16px 15px 10px 10px;
450
+ height: 100%;
451
+ display: flex;
452
+ flex-direction: column;
453
+
454
+ .context-title-wrap {
455
+ padding-bottom: 3px;
456
+ border-bottom: 1px solid #a6a6a6;
457
+
458
+ h4 {
459
+ font-weight: 700;
460
+ font-size: 13px;
461
+ color: var(--add-vm-context-title);
462
+ }
463
+ p {
464
+ font-weight: 400;
465
+ font-size: 13px;
466
+ color: var(--add-vm-context-sub-title);
467
+ }
468
+ }
469
+
470
+ .finish-block {
471
+ padding: 18px 24px 24px 24px;
472
+
473
+ .add-hosts-ready-to-complete-mt-12 {
474
+ margin-top: 12px;
475
+
476
+ .add-hosts-ready-to-complete-bold {
477
+ line-height: 18px;
478
+ font-weight: 700;
479
+ }
480
+ }
481
+ }
482
+
483
+ .vm-hardware-version {
484
+ align-self: flex-end;
485
+ margin-top: auto;
486
+ }
487
+ }
488
+
489
+ :deep(.modal .modal-dialog .modal-content .modal-footer) {
490
+ flex: unset;
491
+ height: unset;
492
+ min-height: unset;
493
+ }
494
+ :deep(.wizard-modal-titlebar h3) {
495
+ color: #000;
496
+ font-size: 24px;
497
+ font-weight: 200;
498
+ line-height: 27px;
499
+ margin: 0;
500
+ padding: 0;
501
+ }
502
+ :deep(.clr-wizard-stepnav-item) {
503
+ padding-left: 0;
504
+ }
505
+ :deep(.clr-wizard-stepnav
506
+ .clr-wizard-stepnav-item
507
+ button
508
+ .clr-wizard-stepnav-link-title) {
509
+ width: 189px;
510
+ font-weight: 700;
511
+ font-size: 13px;
512
+ }
513
+
514
+ #vm-wizard-notification {
515
+ h3 {
516
+ color: var(--global-font-color7);
517
+ margin-top: 6px;
518
+ }
519
+ p {
520
+ color: var(--global-font-color6);
521
+ line-height: 16px;
522
+ }
523
+ }
524
+
525
+ .power-on-by-default-wrap {
526
+ display: flex;
527
+ align-items: center;
528
+
529
+ input {
530
+ margin-right: 6px;
531
+ }
532
+ }
533
+ </style>
534
+
535
+ <style>
536
+ :root {
537
+ --add-vm-context-title: #333;
538
+ --add-vm-context-sub-title: #000;
539
+ }
540
+ :root.dark-theme {
541
+ --add-vm-context-title: #adbbc4;
542
+ --add-vm-context-sub-title: #adbbc4;
543
+ }
544
+ </style>
@@ -0,0 +1,7 @@
1
+ import { UI_I_DatastoreTableItem } from '~/models/store/storage/interfaces'
2
+
3
+ export interface UI_I_VmForm {
4
+ name: string
5
+ storage: UI_I_DatastoreTableItem | null
6
+ options: string[]
7
+ }
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <div class="select-options">
3
+ <div class="checkbox">
4
+ <input
5
+ id="customize-os"
6
+ v-model="selectedOptions"
7
+ type="checkbox"
8
+ value="customize-os"
9
+ />
10
+ <label for="customize-os">{{
11
+ localization.customizeTheOperatingSystem
12
+ }}</label>
13
+ </div>
14
+ <div class="checkbox">
15
+ <input
16
+ id="customize-hardware"
17
+ v-model="selectedOptions"
18
+ type="checkbox"
19
+ value="customize-hardware"
20
+ />
21
+ <label for="customize-hardware">{{
22
+ localization.customizeThisVirtualMachineHardware
23
+ }}</label>
24
+ </div>
25
+ <div class="checkbox">
26
+ <input
27
+ id="power-on"
28
+ v-model="selectedOptions"
29
+ type="checkbox"
30
+ value="power-on"
31
+ />
32
+ <label for="power-on">{{
33
+ localization.powerOnVirtualMachineAfterCreation
34
+ }}</label>
35
+ </div>
36
+ </div>
37
+ </template>
38
+
39
+ <script setup lang="ts">
40
+ import type { UI_I_Localization } from '~/models/interfaces'
41
+
42
+ const props = defineProps<{
43
+ selectOptionsSubmit: number
44
+ }>()
45
+
46
+ const emits = defineEmits<{
47
+ (event: 'submit', value: string[]): void
48
+ }>()
49
+ const localization = computed<UI_I_Localization>(() => useLocal())
50
+
51
+ const selectedOptions = ref<string[]>([])
52
+ watch(selectedOptions, newValue => {
53
+ emits('submit', newValue)
54
+ })
55
+ </script>
56
+
57
+ <style scoped lang="scss">
58
+ .select-os {
59
+ .select-os-block {
60
+ label:not(.windows-virtualization-label) {
61
+ padding: 0 5px 5px 0;
62
+ }
63
+
64
+ .windows-virtualization-label {
65
+ padding: 0 4px;
66
+ }
67
+ }
68
+ }
69
+
70
+ #os-select-help-icon {
71
+ h3 {
72
+ margin-top: 7px;
73
+ font-size: 22px;
74
+ color: #565656;
75
+ }
76
+ p {
77
+ width: 310px;
78
+ margin-top: 24px;
79
+ font-size: 14px;
80
+ color: #565656;
81
+ }
82
+ }
83
+ </style>
@@ -0,0 +1,43 @@
1
+ import { UI_I_Localization } from '~/models/interfaces'
2
+ import { UI_I_VerticalStepItem } from '~/components/atoms/models/interfaces'
3
+ import { UI_T_Project } from '~/models/types'
4
+
5
+ export const stepItemsFunc = (
6
+ localization: UI_I_Localization,
7
+ project: UI_T_Project
8
+ ): UI_I_VerticalStepItem[] => {
9
+ if (project === 'sphere') {
10
+ return []
11
+ }
12
+ return [
13
+ {
14
+ text: localization.selectName,
15
+ disabled: true,
16
+ complete: false,
17
+ },
18
+ { text: localization.selectStorage, disabled: true, complete: false },
19
+ { text: localization.selectCloneOptions, disabled: true, complete: false },
20
+ {
21
+ text: localization.customizeHardware,
22
+ disabled: true,
23
+ complete: false,
24
+ },
25
+ { text: localization.readyComplete, disabled: true, complete: false },
26
+ ]
27
+ }
28
+
29
+ export const subTitleFunc = (
30
+ localization: UI_I_Localization,
31
+ project: UI_T_Project
32
+ ): string[] => {
33
+ if (project === 'sphere') {
34
+ return []
35
+ }
36
+ return [
37
+ localization.specifyUniqueName,
38
+ localization.selectStorageConfigurationDiskFiles,
39
+ localization.chooseGuestOSInstalledVmAndMachineTypeUsedCreateVm,
40
+ localization.selectFurtherCloneOptions,
41
+ localization.clickFinishStartCreation,
42
+ ]
43
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.1.96",
4
+ "version": "1.1.97",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",