bfg-common 1.1.96 → 1.1.98

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="clone-vm">
3
+ <atoms-modal-by-steps
4
+ test-id="clone-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
+ <atoms-loader v-show="!vmSettings || loading" id="loader" />
15
+ <div v-if="vmSettings" class="vm-context">
16
+ <div class="context-title-wrap">
17
+ <p>{{ stepSubTitle }}</p>
18
+ </div>
19
+
20
+ <common-vm-actions-add-select-name
21
+ v-show="stepPosition === 1"
22
+ :show="stepPosition === 1"
23
+ :name-form-submit="nameFormSubmit"
24
+ :project="props.project"
25
+ @submit="onChangeNameAndNext(...$event)"
26
+ @check-name="emits('check-name', $event)"
27
+ @loading="loading = $event"
28
+ />
29
+ <common-vm-actions-add-select-storage
30
+ v-show="stepPosition === 2"
31
+ :storage-submit="storageSubmit"
32
+ :datastore="props.datastore"
33
+ :get-datastore-table-func="props.getDatastoreTableFunc"
34
+ @submit="onChangeStorageAndNext"
35
+ />
36
+ <common-vm-actions-clone-select-options
37
+ v-show="stepPosition === 3"
38
+ :select-options-submit="selectOptionsSubmit"
39
+ @submit="onChangeSelectOptionsAndNext"
40
+ />
41
+ <common-vm-actions-add-customize-hardware
42
+ v-show="stepPosition === 4"
43
+ v-model:vm-name="vmName"
44
+ v-model:guest-machine-type="vmSettings.guestMachineType"
45
+ v-model:guest-os-family="vmSettings.guestOsFamily"
46
+ v-model:guest-os-version="vmSettings.guestOsVersion"
47
+ :storage="vmSettings.storage"
48
+ :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
49
+ :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
50
+ :networks-for-boot-options="virtualHardwareNetworksLocal"
51
+ :cd-dvd-drives="vmSettings.cdDvdDrives"
52
+ :hard-disks="vmSettings.hardDisks"
53
+ :networks="vmSettings.networks"
54
+ :customize-hardware-submit="0"
55
+ :max-cpus="vmSettings.maxCpus"
56
+ :max-memory="vmSettings.maxMemory"
57
+ :cpu-models="vmSettings.cpuModels"
58
+ :cpu="vmSettings.cpu"
59
+ :memory="vmSettings.memory"
60
+ :video-card="vmSettings.videoCard"
61
+ :usb-controller="vmSettings.usbController"
62
+ :pci-devices="vmSettings.pciDevices"
63
+ :selected-nav-item="selectedNavItem"
64
+ :hard-disks-for-edit="vmSettings.hardDisks"
65
+ :options="vmSettings.options"
66
+ :nodes="props.nodes"
67
+ :files="props.files"
68
+ :networks-table="props.networksTable"
69
+ :error-validation-fields="props.errorValidationFields"
70
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
71
+ :passthrough-devices="props.passthroughDevices"
72
+ :get-datastore-table-func="props.getDatastoreTableFunc"
73
+ :datastore="props.datastore"
74
+ :is-edit="false"
75
+ @get-storage="emits('get-storage', $event)"
76
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
77
+ @get-active-device-child="emits('get-active-device-child', $event)"
78
+ @show-datastore-child="emits('show-datastore-child', $event)"
79
+ @get-networks-table="emits('get-networks-table', $event)"
80
+ @get-pci-devices="emits('get-pci-devices')"
81
+ @change-boot-order="onChangeBootOrder"
82
+ @send-data="onChangeCustomizeHardware"
83
+ />
84
+ <common-vm-actions-clone-ready-to-complete
85
+ v-if="stepPosition === 5"
86
+ :ready-complete-table-info="props.readyCompleteTableInfo"
87
+ />
88
+ </div>
89
+ </template>
90
+
91
+ <template #modalFooter>
92
+ <div class="flex-align-center flex-space-between w-100">
93
+ <div class="power-on-by-default-wrap">
94
+ <template v-if="stepPosition === 5">
95
+ <input
96
+ id="power-on-by-default"
97
+ v-model="isPowerOnByDefault"
98
+ type="checkbox"
99
+ />
100
+ <label for="power-on-by-default" class="label-text-normal">{{
101
+ localization.powerOnByDefault
102
+ }}</label>
103
+ </template>
104
+ </div>
105
+ <div class="flex-align-center">
106
+ <button
107
+ id="vm-wizard-cancel-button"
108
+ class="btn btn-link"
109
+ @click="onHideModal"
110
+ >
111
+ {{ localization.cancel }}
112
+ </button>
113
+ <button
114
+ v-show="stepPosition > 0"
115
+ id="vm-wizard-back-button"
116
+ class="btn btn-outline"
117
+ @click="onBack"
118
+ >
119
+ {{ localization.back }}
120
+ </button>
121
+ <button
122
+ v-if="stepPosition === stepItems.length - 1"
123
+ id="vm-wizard-finish-button"
124
+ class="btn btn-success"
125
+ @click="onFinish"
126
+ >
127
+ {{ localization.finish }}
128
+ </button>
129
+ <button
130
+ v-else
131
+ id="vm-wizard-next-button"
132
+ class="btn btn-primary"
133
+ @click="onNext(false)"
134
+ >
135
+ {{ localization.next }}
136
+ </button>
137
+ </div>
138
+ </div>
139
+ </template>
140
+ </atoms-modal-by-steps>
141
+ </div>
142
+ </template>
143
+
144
+ <script setup lang="ts">
145
+ import type {
146
+ UI_I_DatastoreTableItem,
147
+ UI_I_FolderOrFileTreePayload,
148
+ } from '~/models/store/storage/interfaces'
149
+ import type { UI_I_NetworkTableItem } from '~/models/store/network/interfaces'
150
+ import type {
151
+ API_UI_I_Error,
152
+ UI_I_TablePayload,
153
+ } from '~/models/store/interfaces'
154
+ import type { UI_I_FileTreeNode } from '~/components/models/interfaces'
155
+ import type { UI_I_Localization } from '~/models/interfaces'
156
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/add/customizeHardware/models/interfaces'
157
+ import type { UI_I_ErrorValidationField } from '~/models/store/interfaces'
158
+ import type {
159
+ UI_I_SendDataCpu,
160
+ UI_I_SendDataMemory,
161
+ UI_I_SendDataNewCdDvdDrive,
162
+ UI_I_SendDataNewHardDisk,
163
+ UI_I_SendDataNewNetwork,
164
+ } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/interfaces'
165
+ import type {
166
+ UI_T_AddVmFinishFunc,
167
+ UI_T_SelectedNavItem,
168
+ } from '~/components/common/vm/actions/add/models/types'
169
+ import type {
170
+ UI_I_OptionItem,
171
+ UI_I_VerticalStepItem,
172
+ } from '~/components/atoms/models/interfaces'
173
+ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
174
+ import type { UI_I_ConfigurePciDevicesTable } from '~/models/store/host/interfaces'
175
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/models/types'
176
+ import type { UI_T_Project } from '~/models/types'
177
+ import type { UI_I_VmSettings } from '~/models/store/vm/interfaces'
178
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/clone/models/interfaces'
179
+ import { capabilities } from '~/components/common/vm/actions/add/config/capabilities'
180
+ import {
181
+ stepItemsFunc,
182
+ subTitleFunc,
183
+ } from '~/components/common/vm/actions/clone/utils'
184
+
185
+ const props = defineProps<{
186
+ project: UI_T_Project
187
+ vmSettings: UI_I_VmSettings | null
188
+ nodes: UI_I_FileTreeNode[]
189
+ files: UI_I_FileTreeNode[]
190
+ networksTable: UI_I_NetworkTableItem[]
191
+ datastore: UI_I_DatastoreTableItem[]
192
+ errorValidationFields: UI_I_ErrorValidationField[]
193
+ readyCompleteTableInfo: UI_I_TableInfoItem[]
194
+ vmCpuHelpTextSecond: string
195
+ finishFunc: any
196
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
197
+ validateSendDataFunc: any
198
+ passthroughDevices: UI_I_ConfigurePciDevicesTable | null
199
+ vmNameInWizard: string
200
+ }>()
201
+
202
+ const emits = defineEmits<{
203
+ (event: 'check-name', value: [string, (error: API_UI_I_Error) => void]): void
204
+ (event: 'get-storage', value: UI_I_TablePayload): void
205
+ (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
206
+ (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
207
+ (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
208
+ (event: 'remove-error-by-title', value: string): void
209
+ (event: 'get-networks-table', value: UI_I_TablePayload): void
210
+ (event: 'get-pci-devices'): void
211
+ (event: 'hide'): void
212
+ }>()
213
+
214
+ const localization = computed<UI_I_Localization>(() => useLocal())
215
+
216
+ const stepPosition = ref<number>(0)
217
+ watch(stepPosition, (newValue) => {
218
+ if (newValue === 5) validateSendData()
219
+ })
220
+ const stepItems = ref<UI_I_VerticalStepItem[]>([])
221
+ stepItems.value = stepItemsFunc(localization.value, props.project)
222
+
223
+ const subTitle: string[] = subTitleFunc(localization.value, props.project)
224
+ const stepSubTitle = computed<string>(() => subTitle[stepPosition.value])
225
+
226
+ const storageIdCash = ref<string | null>(null)
227
+ const vmForm = ref<UI_I_VmForm>({
228
+ name: '',
229
+ storage: null,
230
+ options: [],
231
+ })
232
+
233
+ const isPowerOnByDefault = ref<boolean>(true)
234
+
235
+ const onChangeNameAndNext = (name: string): void => {
236
+ checkLocalChangeAndChangeStepStatus()
237
+
238
+ vmForm.value.name = name
239
+ onNext(true)
240
+ }
241
+
242
+ const onChangeStorageAndNext = (
243
+ storage: UI_I_DatastoreTableItem | null
244
+ ): void => {
245
+ if (!storage) return
246
+
247
+ const hasChanges = storage.id !== storageIdCash.value
248
+ if (hasChanges) checkLocalChangeAndChangeStepStatus()
249
+
250
+ vmForm.value.storage = storage
251
+ storageIdCash.value = storage.id
252
+
253
+ onNext(true)
254
+ }
255
+
256
+ const onChangeSelectOptionsAndNext = (options: string[]): void => {
257
+ vmForm.value.options = options
258
+
259
+ onNext(true)
260
+ }
261
+
262
+ const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
263
+ const onChangeCustomizeHardware = (
264
+ data: UI_I_SendDataCustomizeHardware
265
+ ): void => {
266
+ customizeHardware.value = data
267
+ }
268
+
269
+ const virtualHardwareHardDisksLocal = computed<
270
+ UI_I_SendDataNewHardDisk[] | null
271
+ >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
272
+ const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
273
+ () => customizeHardware.value?.virtualHardware?.networks || null
274
+ )
275
+ const virtualHardwareCdDvdDrivesLocal = computed<
276
+ UI_I_SendDataNewCdDvdDrive[] | null
277
+ >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
278
+
279
+ const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
280
+ () => customizeHardware.value?.virtualHardware?.cpu || null
281
+ )
282
+ const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
283
+ () => customizeHardware.value?.virtualHardware?.memory || null
284
+ )
285
+ const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
286
+ const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
287
+ null
288
+ )
289
+ const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
290
+ const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
291
+ virtualHardwareHardDisks.value = data[0]
292
+ virtualHardwareCdDvdDrives.value = data[1]
293
+ virtualHardwareNetworks.value = data[2]
294
+ }
295
+
296
+ watch(
297
+ () => props.vmNameInWizard,
298
+ (newValue) => {
299
+ vmForm.value.name = newValue
300
+ }
301
+ )
302
+
303
+ const loading = ref<boolean>(false)
304
+ const validateSendData = (): void => {
305
+ loading.value = true
306
+ props
307
+ .validateSendDataFunc(
308
+ vmForm.value,
309
+ virtualHardwareCpu.value,
310
+ virtualHardwareMemory.value,
311
+ customizeHardware.value,
312
+ virtualHardwareNetworks.value,
313
+ virtualHardwareHardDisks.value,
314
+ virtualHardwareCdDvdDrives.value,
315
+ isPowerOnByDefault.value,
316
+ localization.value
317
+ )
318
+ .then((data) => {
319
+ loading.value = false
320
+ if (!data) return
321
+
322
+ selectedNavItem.value = data[0]
323
+ data[1] !== null && (stepPosition.value = data[1])
324
+ })
325
+ }
326
+ const onFinish = (): void => {
327
+ loading.value = true
328
+ props
329
+ .finishFunc(
330
+ vmForm.value,
331
+ virtualHardwareCpu.value,
332
+ virtualHardwareMemory.value,
333
+ customizeHardware.value,
334
+ virtualHardwareNetworks.value,
335
+ virtualHardwareHardDisks.value,
336
+ virtualHardwareCdDvdDrives.value,
337
+ isPowerOnByDefault.value,
338
+ localization.value
339
+ )
340
+ .then(() => {
341
+ onHideModal()
342
+ loading.value = false
343
+ })
344
+ }
345
+
346
+ const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
347
+
348
+ const nameFormSubmit = ref<number>(0)
349
+ const storageSubmit = ref<number>(0)
350
+ const selectOptionsSubmit = ref<number>(0)
351
+ const customizeHardwareSubmit = ref<number>(0)
352
+
353
+ const onNext = (force = false): void => {
354
+ const isValid = checkSubmit(force)
355
+ if (!isValid) {
356
+ return
357
+ }
358
+
359
+ const isDisabled = stepItems.value[cashStep]?.disabled
360
+ if (cashStep !== -1 && !isDisabled) {
361
+ stepPosition.value = cashStep
362
+ cashStep = -1
363
+ return
364
+ }
365
+
366
+ stepItems.value[stepPosition.value].complete = true
367
+ stepItems.value[stepPosition.value + 1].disabled = false
368
+ stepPosition.value++
369
+ }
370
+ const checkLocalChangeAndChangeStepStatus = (): void => {
371
+ stepItems.value = stepItems.value.map((step, index) => {
372
+ if (index > stepPosition.value) {
373
+ step.complete = false
374
+ step.disabled = index > stepPosition.value + 1
375
+ }
376
+
377
+ return step
378
+ })
379
+ }
380
+
381
+ const checkSubmit = (force = false): boolean => {
382
+ if (stepPosition.value === 1 && !force) {
383
+ nameFormSubmit.value++
384
+ return false
385
+ }
386
+ if (stepPosition.value === 2 && !force) {
387
+ storageSubmit.value++
388
+ return false
389
+ }
390
+ if (stepPosition.value === 3 && !force) {
391
+ selectOptionsSubmit.value++
392
+ return false
393
+ }
394
+ if (stepPosition.value === 4 && !force) {
395
+ customizeHardwareSubmit.value++
396
+ return false
397
+ }
398
+ return true
399
+ }
400
+ const checkSubmitByManual = (step: number): boolean => {
401
+ if (stepPosition.value === 1) {
402
+ nameFormSubmit.value++
403
+ return false
404
+ }
405
+ if (stepPosition.value === 2) {
406
+ storageSubmit.value++
407
+ return false
408
+ }
409
+ if (step === 6) {
410
+ customizeHardwareSubmit.value++
411
+ return false
412
+ }
413
+ return true
414
+ }
415
+ const onBack = (): void => {
416
+ stepPosition.value--
417
+ }
418
+ let cashStep = -1
419
+ const onChangeStep = (key: number): void => {
420
+ const isValid = checkSubmitByManual(key)
421
+ if (!isValid) {
422
+ cashStep = key
423
+ return
424
+ }
425
+
426
+ stepPosition.value = key
427
+ }
428
+
429
+ const compatibility = ref<UI_I_OptionItem[]>(capabilities.compatibility)
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
+ .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(--vm-context-title);
462
+ }
463
+ p {
464
+ font-weight: 400;
465
+ font-size: 13px;
466
+ color: var(--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
+ --vm-context-title: #333;
538
+ --vm-context-sub-title: #000;
539
+ }
540
+ :root.dark-theme {
541
+ --vm-context-title: #adbbc4;
542
+ --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
+ }
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <div class="add-vm">
2
+ <div class="edit-vm">
3
3
  <atoms-modal
4
- test-id="vm-edit-settings"
4
+ test-id="edit-vm-wizard"
5
5
  :show="true"
6
6
  :title="localization.editSettings"
7
7
  :second-title="vmNameCash"
@@ -14,7 +14,7 @@
14
14
  v-show="!vmSettings || loading"
15
15
  id="loader"
16
16
  />
17
- <div v-if="vmSettings" class="add-vm-context">
17
+ <div v-if="vmSettings" class="vm-context">
18
18
  <common-vm-actions-add-customize-hardware
19
19
  v-model:vm-name="vmName"
20
20
  v-model:guest-machine-type="vmSettings.guestMachineType"
@@ -205,7 +205,7 @@ const validateSendData = async (): Promise<void> => {
205
205
  </script>
206
206
 
207
207
  <style scoped lang="scss">
208
- .add-vm-context {
208
+ .vm-context {
209
209
  padding: 16px 15px 10px 10px;
210
210
  height: 100%;
211
211
  display: flex;
@@ -218,12 +218,12 @@ const validateSendData = async (): Promise<void> => {
218
218
  h4 {
219
219
  font-weight: 700;
220
220
  font-size: 13px;
221
- color: var(--add-vm-context-title);
221
+ color: var(--vm-context-title);
222
222
  }
223
223
  p {
224
224
  font-weight: 400;
225
225
  font-size: 13px;
226
- color: var(--add-vm-context-sub-title);
226
+ color: var(--vm-context-sub-title);
227
227
  }
228
228
  }
229
229
 
@@ -306,11 +306,11 @@ const validateSendData = async (): Promise<void> => {
306
306
 
307
307
  <style>
308
308
  :root {
309
- --add-vm-context-title: #333;
310
- --add-vm-context-sub-title: #000;
309
+ --vm-context-title: #333;
310
+ --vm-context-sub-title: #000;
311
311
  }
312
312
  :root.dark-theme {
313
- --add-vm-context-title: #adbbc4;
314
- --add-vm-context-sub-title: #adbbc4;
313
+ --vm-context-title: #adbbc4;
314
+ --vm-context-sub-title: #adbbc4;
315
315
  }
316
316
  </style>
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.98",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",