bfg-common 1.3.28 → 1.3.29

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.
@@ -1,545 +1,733 @@
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-common-select-name-old
21
- v-show="stepPosition === 0"
22
- :show="stepPosition === 0"
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-common-select-storage-old
30
- v-show="stepPosition === 1"
31
- :storage-submit="storageSubmit"
32
- :datastore="props.datastore"
33
- :storage="vmSettings.storage"
34
- :get-datastore-table-func="props.getDatastoreTableFunc"
35
- @submit="onChangeStorageAndNext"
36
- />
37
- <common-vm-actions-clone-select-options
38
- v-show="stepPosition === 2"
39
- :select-options-submit="selectOptionsSubmit"
40
- @submit="onChangeSelectOptionsAndNext"
41
- />
42
- <common-vm-actions-common-customize-hardware-old
43
- v-show="stepPosition === 3"
44
- v-model:vm-name="vmName"
45
- v-model:guest-machine-type="vmSettings.guestMachineType"
46
- v-model:guest-os-family="vmSettings.guestOsFamily"
47
- v-model:guest-os-version="vmSettings.guestOsVersion"
48
- :storage="vmSettings.storage"
49
- :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
50
- :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
51
- :networks-for-boot-options="virtualHardwareNetworksLocal"
52
- :cd-dvd-drives="vmSettings.cdDvdDrives"
53
- :hard-disks="vmSettings.hardDisks"
54
- :networks="vmSettings.networks"
55
- :customize-hardware-submit="customizeHardwareSubmit"
56
- :max-cpus="vmSettings.maxCpus"
57
- :max-memory="vmSettings.maxMemory"
58
- :cpu-models="vmSettings.cpuModels"
59
- :cpu="vmSettings.cpu"
60
- :memory="vmSettings.memory"
61
- :video-card="vmSettings.videoCard"
62
- :usb-controller="vmSettings.usbController"
63
- :pci-devices="vmSettings.pciDevices"
64
- :selected-nav-item="selectedNavItem"
65
- :hard-disks-for-edit="vmSettings.hardDisks"
66
- :options="vmSettings.options"
67
- :nodes="props.nodes"
68
- :files="props.files"
69
- :networks-table="props.networksTable"
70
- :error-validation-fields="props.errorValidationFields"
71
- :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
72
- :passthrough-devices="props.passthroughDevices"
73
- :get-datastore-table-func="props.getDatastoreTableFunc"
74
- :datastore="props.datastore"
75
- is-clone
76
- @change-boot-order="onChangeBootOrder"
77
- @send-data="onChangeCustomizeHardware"
78
- @get-storage="emits('get-storage', $event)"
79
- @get-folders-or-files="emits('get-folders-or-files', $event)"
80
- @get-active-device-child="emits('get-active-device-child', $event)"
81
- @show-datastore-child="emits('show-datastore-child', $event)"
82
- @get-networks-table="emits('get-networks-table', $event)"
83
- @get-pci-devices="emits('get-pci-devices')"
84
- @next="onNext(true)"
85
- />
86
- <common-vm-actions-common-ready-to-complete
87
- v-if="stepPosition === 4"
88
- :ready-complete-table-info="props.readyCompleteTableInfo"
89
- />
90
- </div>
91
- </template>
92
-
93
- <template #modalFooter>
94
- <div class="flex-align-center flex-space-between w-100">
95
- <div class="power-on-by-default-wrap">
96
- <template v-if="stepPosition === 4">
97
- <input
98
- id="power-on-by-default"
99
- v-model="isPowerOnByDefault"
100
- type="checkbox"
101
- />
102
- <label for="power-on-by-default" class="label-text-normal">{{
103
- localization.powerOnByDefault
104
- }}</label>
105
- </template>
106
- </div>
107
- <div class="flex-align-center">
108
- <button
109
- id="vm-wizard-cancel-button"
110
- class="btn btn-link"
111
- @click="onHideModal"
112
- >
113
- {{ localization.cancel }}
114
- </button>
115
- <button
116
- v-show="stepPosition > 0"
117
- id="vm-wizard-back-button"
118
- class="btn btn-outline"
119
- @click="onBack"
120
- >
121
- {{ localization.back }}
122
- </button>
123
- <button
124
- v-if="stepPosition === stepItems.length - 1"
125
- id="vm-wizard-finish-button"
126
- class="btn btn-success"
127
- @click="onFinish"
128
- >
129
- {{ localization.finish }}
130
- </button>
131
- <button
132
- v-else
133
- id="vm-wizard-next-button"
134
- class="btn btn-primary"
135
- @click="onNext(false)"
136
- >
137
- {{ localization.next }}
138
- </button>
139
- </div>
140
- </div>
141
- </template>
142
- </atoms-modal-by-steps>
143
- </div>
144
- </template>
145
-
146
- <script setup lang="ts">
147
- import type {
148
- UI_I_DatastoreTableItem,
149
- UI_I_FolderOrFileTreePayload,
150
- } from '~/lib/models/store/storage/interfaces'
151
- import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
152
- import type {
153
- API_UI_I_Error,
154
- UI_I_TablePayload,
155
- } from '~/lib/models/store/interfaces'
156
- import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
157
- import type { UI_I_Localization } from '~/lib/models/interfaces'
158
- import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
159
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
160
- import type {
161
- UI_I_SendDataCpu,
162
- UI_I_SendDataMemory,
163
- UI_I_SendDataNewCdDvdDrive,
164
- UI_I_SendDataNewHardDisk,
165
- UI_I_SendDataNewNetwork,
166
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
167
- import type {
168
- UI_T_SelectedNavItem,
169
- } from '~/components/common/vm/actions/common/lib/models/types'
170
- import type {
171
- UI_I_OptionItem,
172
- UI_I_VerticalStepItem,
173
- } from '~/components/atoms/lib/models/interfaces'
174
- import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
175
- import type { UI_I_ConfigurePciDevicesTable } from '~/lib/models/store/host/interfaces'
176
- import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
177
- import type { UI_T_Project } from '~/lib/models/types'
178
- import type { UI_I_VmSettings } from '~/lib/models/store/vm/interfaces'
179
- import type { UI_I_VmForm } from '~/components/common/vm/actions/clone/lib/models/interfaces'
180
- import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
181
- import {
182
- stepItemsFunc,
183
- subTitleFunc,
184
- } from '~/components/common/vm/actions/clone/lib/utils'
185
-
186
- const props = defineProps<{
187
- project: UI_T_Project
188
- vmSettings: UI_I_VmSettings | null
189
- nodes: UI_I_FileTreeNode[]
190
- files: UI_I_FileTreeNode[]
191
- networksTable: UI_I_NetworkTableItem[]
192
- datastore: UI_I_DatastoreTableItem[]
193
- errorValidationFields: UI_I_ErrorValidationField[]
194
- readyCompleteTableInfo: UI_I_TableInfoItem[]
195
- vmCpuHelpTextSecond: string
196
- finishFunc: any
197
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
198
- validateSendDataFunc: any
199
- passthroughDevices: UI_I_ConfigurePciDevicesTable | null
200
- vmNameInWizard: string
201
- }>()
202
-
203
- const emits = defineEmits<{
204
- (event: 'check-name', value: [string, (error: API_UI_I_Error) => void]): void
205
- (event: 'get-storage', value: UI_I_TablePayload): void
206
- (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
207
- (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
208
- (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
209
- (event: 'remove-error-by-title', value: string): void
210
- (event: 'get-networks-table', value: UI_I_TablePayload): void
211
- (event: 'get-pci-devices'): void
212
- (event: 'hide'): void
213
- }>()
214
-
215
- const localization = computed<UI_I_Localization>(() => useLocal())
216
-
217
- const stepPosition = ref<number>(0)
218
- watch(stepPosition, (newValue) => {
219
- if (newValue === 4) validateSendData()
220
- })
221
- const stepItems = ref<UI_I_VerticalStepItem[]>([])
222
- stepItems.value = stepItemsFunc(localization.value, props.project)
223
-
224
- const subTitle: string[] = subTitleFunc(localization.value, props.project)
225
- const stepSubTitle = computed<string>(() => subTitle[stepPosition.value])
226
-
227
- const storageIdCash = ref<string | null>(null)
228
- const vmForm = ref<UI_I_VmForm>({
229
- name: '',
230
- storage: null,
231
- options: [],
232
- })
233
-
234
- const isPowerOnByDefault = ref<boolean>(true)
235
-
236
- const onChangeNameAndNext = (name: string): void => {
237
- checkLocalChangeAndChangeStepStatus()
238
-
239
- vmForm.value.name = name
240
- onNext(true)
241
- }
242
-
243
- const onChangeStorageAndNext = (
244
- storage: UI_I_DatastoreTableItem | null
245
- ): void => {
246
- if (!storage) return
247
-
248
- const hasChanges = storage.id !== storageIdCash.value
249
- if (hasChanges) checkLocalChangeAndChangeStepStatus()
250
-
251
- vmForm.value.storage = storage
252
- storageIdCash.value = storage.id
253
-
254
- onNext(true)
255
- }
256
-
257
- const onChangeSelectOptionsAndNext = (options: string[]): void => {
258
- vmForm.value.options = options
259
-
260
- onNext(true)
261
- }
262
-
263
- const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
264
- const onChangeCustomizeHardware = (
265
- data: UI_I_SendDataCustomizeHardware
266
- ): void => {
267
- customizeHardware.value = data
268
- }
269
-
270
- const virtualHardwareHardDisksLocal = computed<
271
- UI_I_SendDataNewHardDisk[] | null
272
- >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
273
- const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
274
- () => customizeHardware.value?.virtualHardware?.networks || null
275
- )
276
- const virtualHardwareCdDvdDrivesLocal = computed<
277
- UI_I_SendDataNewCdDvdDrive[] | null
278
- >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
279
-
280
- const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
281
- () => customizeHardware.value?.virtualHardware?.cpu || null
282
- )
283
- const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
284
- () => customizeHardware.value?.virtualHardware?.memory || null
285
- )
286
- const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
287
- const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
288
- null
289
- )
290
- const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
291
- const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
292
- virtualHardwareHardDisks.value = data[0]
293
- virtualHardwareCdDvdDrives.value = data[1]
294
- virtualHardwareNetworks.value = data[2]
295
- }
296
-
297
- watch(
298
- () => props.vmNameInWizard,
299
- (newValue) => {
300
- vmForm.value.name = newValue
301
- }
302
- )
303
-
304
- const loading = ref<boolean>(false)
305
- const validateSendData = (): void => {
306
- loading.value = true
307
- props
308
- .validateSendDataFunc(
309
- vmForm.value,
310
- virtualHardwareCpu.value,
311
- virtualHardwareMemory.value,
312
- customizeHardware.value,
313
- virtualHardwareNetworks.value,
314
- virtualHardwareHardDisks.value,
315
- virtualHardwareCdDvdDrives.value,
316
- isPowerOnByDefault.value,
317
- localization.value
318
- )
319
- .then((data) => {
320
- loading.value = false
321
- if (!data) return
322
-
323
- selectedNavItem.value = data[0]
324
- data[1] !== null && (stepPosition.value = data[1])
325
- })
326
- }
327
- const onFinish = (): void => {
328
- loading.value = true
329
- props
330
- .finishFunc(
331
- vmForm.value,
332
- virtualHardwareCpu.value,
333
- virtualHardwareMemory.value,
334
- customizeHardware.value,
335
- virtualHardwareNetworks.value,
336
- virtualHardwareHardDisks.value,
337
- virtualHardwareCdDvdDrives.value,
338
- isPowerOnByDefault.value,
339
- localization.value
340
- )
341
- .then(() => {
342
- onHideModal()
343
- loading.value = false
344
- })
345
- }
346
-
347
- const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
348
-
349
- const nameFormSubmit = ref<number>(0)
350
- const storageSubmit = ref<number>(0)
351
- const selectOptionsSubmit = ref<number>(0)
352
- const customizeHardwareSubmit = ref<number>(0)
353
-
354
- const onNext = (force = false): void => {
355
- const isValid = checkSubmit(force)
356
- if (!isValid) {
357
- return
358
- }
359
-
360
- const isDisabled = stepItems.value[cashStep]?.disabled
361
- if (cashStep !== -1 && !isDisabled) {
362
- stepPosition.value = cashStep
363
- cashStep = -1
364
- return
365
- }
366
-
367
- stepItems.value[stepPosition.value].complete = true
368
- stepItems.value[stepPosition.value + 1].disabled = false
369
- stepPosition.value++
370
- }
371
- const checkLocalChangeAndChangeStepStatus = (): void => {
372
- stepItems.value = stepItems.value.map((step, index) => {
373
- if (index > stepPosition.value) {
374
- step.complete = false
375
- step.disabled = index > stepPosition.value + 1
376
- }
377
-
378
- return step
379
- })
380
- }
381
-
382
- const checkSubmit = (force = false): boolean => {
383
- if (stepPosition.value === 0 && !force) {
384
- nameFormSubmit.value++
385
- return false
386
- }
387
- if (stepPosition.value === 1 && !force) {
388
- storageSubmit.value++
389
- return false
390
- }
391
- if (stepPosition.value === 2 && !force) {
392
- selectOptionsSubmit.value++
393
- return false
394
- }
395
- if (stepPosition.value === 3 && !force) {
396
- customizeHardwareSubmit.value++
397
- return false
398
- }
399
- return true
400
- }
401
- const checkSubmitByManual = (step: number): boolean => {
402
- if (stepPosition.value === 0) {
403
- nameFormSubmit.value++
404
- return false
405
- }
406
- if (stepPosition.value === 1) {
407
- storageSubmit.value++
408
- return false
409
- }
410
- if (step === 3) {
411
- customizeHardwareSubmit.value++
412
- return false
413
- }
414
- return true
415
- }
416
- const onBack = (): void => {
417
- stepPosition.value--
418
- }
419
- let cashStep = -1
420
- const onChangeStep = (key: number): void => {
421
- const isValid = checkSubmitByManual(key)
422
- if (!isValid) {
423
- cashStep = key
424
- return
425
- }
426
-
427
- stepPosition.value = key
428
- }
429
-
430
- const compatibility = ref<UI_I_OptionItem[]>(capabilities.compatibility)
431
- const maxMemory = ref<number>(capabilities.maxMemory)
432
-
433
- const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
434
- const vmName = ref<string>(vmSettings.value?.name || '')
435
- watch(vmSettings, (newValue) => {
436
- vmName.value = newValue?.name || ''
437
- })
438
-
439
- const onHideModal = (): void => {
440
- emits('hide')
441
- }
442
- </script>
443
-
444
- <style scoped lang="scss">
445
- :deep(.has-solid.close-icon.clr-icon) {
446
- width: 20px;
447
- top: 0;
448
- }
449
- .vm-context {
450
- padding: 16px 15px 10px 10px;
451
- height: 100%;
452
- display: flex;
453
- flex-direction: column;
454
-
455
- .context-title-wrap {
456
- padding-bottom: 3px;
457
- border-bottom: 1px solid #a6a6a6;
458
-
459
- h4 {
460
- font-weight: 700;
461
- font-size: 13px;
462
- color: var(--vm-context-title);
463
- }
464
- p {
465
- font-weight: 400;
466
- font-size: 13px;
467
- color: var(--vm-context-sub-title);
468
- }
469
- }
470
-
471
- .finish-block {
472
- padding: 18px 24px 24px 24px;
473
-
474
- .add-hosts-ready-to-complete-mt-12 {
475
- margin-top: 12px;
476
-
477
- .add-hosts-ready-to-complete-bold {
478
- line-height: 18px;
479
- font-weight: 700;
480
- }
481
- }
482
- }
483
-
484
- .vm-hardware-version {
485
- align-self: flex-end;
486
- margin-top: auto;
487
- }
488
- }
489
-
490
- :deep(.modal .modal-dialog .modal-content .modal-footer) {
491
- flex: unset;
492
- height: unset;
493
- min-height: unset;
494
- }
495
- :deep(.wizard-modal-titlebar h3) {
496
- color: #000;
497
- font-size: 24px;
498
- font-weight: 200;
499
- line-height: 27px;
500
- margin: 0;
501
- padding: 0;
502
- }
503
- :deep(.clr-wizard-stepnav-item) {
504
- padding-left: 0;
505
- }
506
- :deep(.clr-wizard-stepnav
507
- .clr-wizard-stepnav-item
508
- button
509
- .clr-wizard-stepnav-link-title) {
510
- width: 189px;
511
- font-weight: 700;
512
- font-size: 13px;
513
- }
514
-
515
- #vm-wizard-notification {
516
- h3 {
517
- color: var(--global-font-color7);
518
- margin-top: 6px;
519
- }
520
- p {
521
- color: var(--global-font-color6);
522
- line-height: 16px;
523
- }
524
- }
525
-
526
- .power-on-by-default-wrap {
527
- display: flex;
528
- align-items: center;
529
-
530
- input {
531
- margin-right: 6px;
532
- }
533
- }
534
- </style>
535
-
536
- <style>
537
- :root {
538
- --vm-context-title: #333;
539
- --vm-context-sub-title: #000;
540
- }
541
- :root.dark-theme {
542
- --vm-context-title: #adbbc4;
543
- --vm-context-sub-title: #adbbc4;
544
- }
545
- </style>
1
+ <template>
2
+ <div class="clone-vm">
3
+ <atoms-wizard
4
+ show
5
+ :steps="wizard.steps"
6
+ :selected-scheme="selectedScheme"
7
+ :is-loading="wizard.wizardLoader.status"
8
+ :loader-messages="wizard.wizardLoader.messages"
9
+ :title="localization.cloneExistingVirtualMachine"
10
+ :was-completed="wasCompleted"
11
+ :localization="localization"
12
+ @change-steps="onChangeSteps"
13
+ @hide="onHideModal"
14
+ @submit="onFinish"
15
+ >
16
+ <template #modalBody="{ selectedStep }">
17
+ <common-vm-actions-common-select-name
18
+ v-show="selectedStep.id === 0"
19
+ :name-form-submit="nameFormSubmit"
20
+ :project="props.project"
21
+ @submit="onChangeName(...$event)"
22
+ @check-name="emits('check-name', $event)"
23
+ />
24
+ <common-vm-actions-common-select-storage
25
+ v-show="selectedStep.id === 1"
26
+ :storage-submit="storageSubmit"
27
+ :datastore="props.datastore"
28
+ :storage="vmSettings.storage"
29
+ :get-datastore-table-func="props.getDatastoreTableFunc"
30
+ @submit="onChangeStorage"
31
+ />
32
+ <common-vm-actions-clone-select-options
33
+ v-show="selectedStep.id === 2"
34
+ :select-options-submit="selectOptionsSubmit"
35
+ @submit="onChangeSelectOptions"
36
+ />
37
+ <common-vm-actions-common-customize-hardware-old
38
+ v-show="selectedStep.id === 3"
39
+ v-model:vm-name="vmName"
40
+ v-model:guest-machine-type="vmSettings.guestMachineType"
41
+ v-model:guest-os-family="vmSettings.guestOsFamily"
42
+ v-model:guest-os-version="vmSettings.guestOsVersion"
43
+ :storage="vmSettings.storage"
44
+ :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
45
+ :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
46
+ :networks-for-boot-options="virtualHardwareNetworksLocal"
47
+ :cd-dvd-drives="vmSettings.cdDvdDrives"
48
+ :hard-disks="vmSettings.hardDisks"
49
+ :networks="vmSettings.networks"
50
+ :customize-hardware-submit="customizeHardwareSubmit"
51
+ :max-cpus="vmSettings.maxCpus"
52
+ :max-memory="vmSettings.maxMemory"
53
+ :cpu-models="vmSettings.cpuModels"
54
+ :cpu="vmSettings.cpu"
55
+ :memory="vmSettings.memory"
56
+ :video-card="vmSettings.videoCard"
57
+ :usb-controller="vmSettings.usbController"
58
+ :pci-devices="vmSettings.pciDevices"
59
+ :selected-nav-item="selectedNavItem"
60
+ :hard-disks-for-edit="vmSettings.hardDisks"
61
+ :options="vmSettings.options"
62
+ :nodes="props.nodes"
63
+ :files="props.files"
64
+ :networks-table="props.networksTable"
65
+ :error-validation-fields="props.errorValidationFields"
66
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
67
+ :passthrough-devices="props.passthroughDevices"
68
+ :get-datastore-table-func="props.getDatastoreTableFunc"
69
+ :datastore="props.datastore"
70
+ is-clone
71
+ @change-boot-order="onChangeBootOrder"
72
+ @send-data="onChangeCustomizeHardware"
73
+ @get-storage="emits('get-storage', $event)"
74
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
75
+ @get-active-device-child="emits('get-active-device-child', $event)"
76
+ @show-datastore-child="emits('show-datastore-child', $event)"
77
+ @get-networks-table="emits('get-networks-table', $event)"
78
+ @get-pci-devices="emits('get-pci-devices')"
79
+ />
80
+ <common-vm-actions-common-ready-to-complete
81
+ v-show="selectedStep.id === 4"
82
+ :ready-complete-table-info="props.readyCompleteTableInfo"
83
+ />
84
+ </template>
85
+ </atoms-wizard>
86
+ </div>
87
+ </template>
88
+
89
+ <script setup lang="ts">
90
+ import type {
91
+ UI_I_DatastoreTableItem,
92
+ UI_I_FolderOrFileTreePayload,
93
+ } from '~/lib/models/store/storage/interfaces'
94
+ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
95
+ import type {
96
+ API_UI_I_Error,
97
+ UI_I_TablePayload,
98
+ } from '~/lib/models/store/interfaces'
99
+ import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
100
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
101
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
102
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
103
+ import type {
104
+ UI_I_SendDataCpu,
105
+ UI_I_SendDataMemory,
106
+ UI_I_SendDataNewCdDvdDrive,
107
+ UI_I_SendDataNewHardDisk,
108
+ UI_I_SendDataNewNetwork,
109
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
110
+ import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
111
+ import type {
112
+ UI_I_OptionItem,
113
+ UI_I_VerticalStepItem,
114
+ } from '~/components/atoms/lib/models/interfaces'
115
+ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
116
+ import type { UI_I_ConfigurePciDevicesTable } from '~/lib/models/store/host/interfaces'
117
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
118
+ import type { UI_T_Project } from '~/lib/models/types'
119
+ import type { UI_I_VmSettings } from '~/lib/models/store/vm/interfaces'
120
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/clone/lib/models/interfaces'
121
+ import {
122
+ UI_I_ValidationReturn,
123
+ UI_I_WizardStep,
124
+ } from '~/components/atoms/wizard/lib/models/interfaces'
125
+ import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
126
+ import {
127
+ stepsSchemeInitial,
128
+ stepsFunc,
129
+ } from '~/components/common/vm/actions/clone/lib/config/steps'
130
+ import Wizard from '~/components/atoms/wizard/lib/utils/utils'
131
+
132
+ const props = defineProps<{
133
+ project: UI_T_Project
134
+ vmSettings: UI_I_VmSettings | null
135
+ nodes: UI_I_FileTreeNode[]
136
+ files: UI_I_FileTreeNode[]
137
+ networksTable: UI_I_NetworkTableItem[]
138
+ datastore: UI_I_DatastoreTableItem[]
139
+ errorValidationFields: UI_I_ErrorValidationField[]
140
+ readyCompleteTableInfo: UI_I_TableInfoItem[]
141
+ vmCpuHelpTextSecond: string
142
+ finishFunc: any
143
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
144
+ validateSendDataFunc: any
145
+ passthroughDevices: UI_I_ConfigurePciDevicesTable | null
146
+ vmNameInWizard: string
147
+ }>()
148
+
149
+ const emits = defineEmits<{
150
+ (event: 'check-name', value: [string, (error: API_UI_I_Error) => void]): void
151
+ (event: 'get-storage', value: UI_I_TablePayload): void
152
+ (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
153
+ (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
154
+ (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
155
+ (event: 'remove-error-by-title', value: string): void
156
+ (event: 'get-networks-table', value: UI_I_TablePayload): void
157
+ (event: 'get-pci-devices'): void
158
+ (event: 'hide'): void
159
+ }>()
160
+
161
+ const localization = computed<UI_I_Localization>(() => useLocal())
162
+
163
+ const wizard: Wizard = new Wizard(
164
+ stepsFunc(localization.value),
165
+ stepsSchemeInitial
166
+ )
167
+ const wasCompleted = computed<boolean>(() => wizard.wasCompleted())
168
+ const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
169
+ const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
170
+
171
+ const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
172
+ wizard.changeSteps(value, validationFunc, validateSendData)
173
+ }
174
+
175
+ const validationFunc = async (
176
+ value: UI_I_WizardStep[],
177
+ currentStep: UI_I_WizardStep,
178
+ nextStep: UI_I_WizardStep
179
+ ): Promise<UI_I_ValidationReturn> => {
180
+ let stepHasError = false
181
+ let stepShouldStop = {
182
+ ifOnCurrentStep: false,
183
+ ifFromAnyStep: false,
184
+ stoppageStepId: -1,
185
+ }
186
+
187
+ wizard.setLoader(true)
188
+ if (wizard.isValidateForStep(0, currentStep.id, nextStep.id)) {
189
+ const nameValidation = await checkName(value)
190
+
191
+ value = nameValidation.newValue
192
+ stepHasError = stepHasError || nameValidation.stepHasError
193
+ } else if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
194
+ const storageValidation = await checkStorage(value)
195
+
196
+ value = storageValidation.newValue
197
+
198
+ stepHasError = stepHasError || storageValidation.stepHasError
199
+ } else if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
200
+ selectOptionsSubmit.value++
201
+ } else if (wizard.isValidateForStep(3, currentStep.id, nextStep.id)) {
202
+ const storageValidation = await checkCustomizeHardware(value)
203
+
204
+ value = storageValidation.newValue
205
+
206
+ stepHasError = stepHasError || storageValidation.stepHasError
207
+ }
208
+ wizard.setLoader(false)
209
+
210
+ return {
211
+ newValue: value,
212
+ stepHasError,
213
+ stepShouldStop,
214
+ }
215
+ }
216
+ const checkName = async (
217
+ value: UI_I_WizardStep[]
218
+ ): Promise<UI_I_ValidationReturn> => {
219
+ let stepHasError = false
220
+
221
+ return new Promise((resolve) => {
222
+ nameFormSubmit.value = (isValid: boolean) => {
223
+ if (!isValid) {
224
+ stepHasError = wizard.setValidation(0, 'name', {
225
+ fieldMessage: 'aaa',
226
+ alertMessage: 'aaa',
227
+ })
228
+ } else if (wizard.hasMessage(0, 'name')) {
229
+ value = wizard.removeValidation(0, 'name', value)
230
+ }
231
+
232
+ resolve({
233
+ stepHasError,
234
+ newValue: value,
235
+ })
236
+ nameFormSubmit.value = null
237
+ }
238
+ })
239
+ }
240
+ const checkStorage = async (
241
+ value: UI_I_WizardStep[]
242
+ ): Promise<UI_I_ValidationReturn> => {
243
+ let stepHasError = false
244
+
245
+ return new Promise((resolve) => {
246
+ storageSubmit.value = (isValid: boolean) => {
247
+ if (!isValid) {
248
+ stepHasError = wizard.setValidation(1, 'storage', {
249
+ fieldMessage: 'aaa',
250
+ alertMessage: 'aaa',
251
+ })
252
+ } else if (wizard.hasMessage(1, 'storage')) {
253
+ value = wizard.removeValidation(1, 'storage', value)
254
+ }
255
+
256
+ resolve({
257
+ stepHasError,
258
+ newValue: value,
259
+ })
260
+ storageSubmit.value = null
261
+ }
262
+ })
263
+ }
264
+ const checkCustomizeHardware = async (
265
+ value: UI_I_WizardStep[]
266
+ ): Promise<UI_I_ValidationReturn> => {
267
+ let stepHasError = false
268
+
269
+ return new Promise((resolve) => {
270
+ customizeHardwareSubmit.value = (isValid: boolean) => {
271
+ if (!isValid) {
272
+ stepHasError = wizard.setValidation(3, 'customizeHardware', {
273
+ fieldMessage: 'aaa',
274
+ alertMessage: 'aaa',
275
+ })
276
+ } else if (wizard.hasMessage(3, 'customizeHardware')) {
277
+ value = wizard.removeValidation(3, 'customizeHardware', value)
278
+ }
279
+
280
+ resolve({
281
+ stepHasError,
282
+ newValue: value,
283
+ })
284
+ storageSubmit.value = null
285
+ }
286
+ })
287
+ }
288
+
289
+ const storageIdCash = ref<string | null>(null)
290
+ const vmForm = ref<UI_I_VmForm>({
291
+ name: '',
292
+ storage: null,
293
+ options: [],
294
+ })
295
+ const onChangeName = (name: string): void => {
296
+ vmForm.value.name = name
297
+ }
298
+ const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
299
+ if (!storage) return
300
+
301
+ vmForm.value.storage = storage
302
+ storageIdCash.value = storage.id
303
+ }
304
+ const onChangeSelectOptions = (options: string[]): void => {
305
+ vmForm.value.options = options
306
+ }
307
+ const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
308
+ const onChangeCustomizeHardware = (
309
+ data: UI_I_SendDataCustomizeHardware
310
+ ): void => {
311
+ customizeHardware.value = data
312
+ }
313
+
314
+ const virtualHardwareHardDisksLocal = computed<
315
+ UI_I_SendDataNewHardDisk[] | null
316
+ >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
317
+ const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
318
+ () => customizeHardware.value?.virtualHardware?.networks || null
319
+ )
320
+ const virtualHardwareCdDvdDrivesLocal = computed<
321
+ UI_I_SendDataNewCdDvdDrive[] | null
322
+ >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
323
+
324
+ const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
325
+ () => customizeHardware.value?.virtualHardware?.cpu || null
326
+ )
327
+ const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
328
+ () => customizeHardware.value?.virtualHardware?.memory || null
329
+ )
330
+ const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
331
+ const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
332
+ null
333
+ )
334
+ const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
335
+ const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
336
+ virtualHardwareHardDisks.value = data[0]
337
+ virtualHardwareCdDvdDrives.value = data[1]
338
+ virtualHardwareNetworks.value = data[2]
339
+ }
340
+
341
+ const isPowerOnByDefault = ref<boolean>(true)
342
+
343
+ watch(
344
+ () => props.vmNameInWizard,
345
+ (newValue) => {
346
+ vmForm.value.name = newValue
347
+ }
348
+ )
349
+
350
+ const validateSendData = async (
351
+ value: UI_I_WizardStep[]
352
+ ): Promise<UI_I_ValidationReturn> => {
353
+ wizard.setLoader(true)
354
+ let stepHasError = false
355
+
356
+ const data = await props.validateSendDataFunc(
357
+ vmForm.value,
358
+ virtualHardwareCpu.value,
359
+ virtualHardwareMemory.value,
360
+ customizeHardware.value,
361
+ virtualHardwareNetworks.value,
362
+ virtualHardwareHardDisks.value,
363
+ virtualHardwareCdDvdDrives.value,
364
+ isPowerOnByDefault.value,
365
+ localization.value
366
+ )
367
+
368
+ wizard.setLoader(false)
369
+ if (data) {
370
+ stepHasError = true
371
+ selectedNavItem.value = data[0]
372
+ }
373
+
374
+ return {
375
+ stepHasError,
376
+ newValue: value,
377
+ }
378
+ }
379
+ const onFinish = (): void => {
380
+ wizard.setLoader(false)
381
+ props
382
+ .finishFunc(
383
+ vmForm.value,
384
+ virtualHardwareCpu.value,
385
+ virtualHardwareMemory.value,
386
+ customizeHardware.value,
387
+ virtualHardwareNetworks.value,
388
+ virtualHardwareHardDisks.value,
389
+ virtualHardwareCdDvdDrives.value,
390
+ isPowerOnByDefault.value,
391
+ localization.value
392
+ )
393
+ .then(() => {
394
+ onHideModal()
395
+ wizard.setLoader(false)
396
+ })
397
+ }
398
+
399
+ const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
400
+
401
+ const nameFormSubmit = ref<null | Function>(null)
402
+ const storageSubmit = ref<null | Function>(null)
403
+ const selectOptionsSubmit = ref<number>(0)
404
+ const customizeHardwareSubmit = ref<null | Function>(null)
405
+
406
+ const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
407
+ const vmName = ref<string>(vmSettings.value?.name || '')
408
+ watch(vmSettings, (newValue) => {
409
+ vmName.value = newValue?.name || ''
410
+ })
411
+
412
+ const onHideModal = (): void => {
413
+ emits('hide')
414
+ }
415
+
416
+ // const storageIdCash = ref<string | null>(null)
417
+ // const vmForm = ref<UI_I_VmForm>({
418
+ // name: '',
419
+ // storage: null,
420
+ // options: [],
421
+ // })
422
+ //
423
+ // const isPowerOnByDefault = ref<boolean>(true)
424
+ //
425
+ // const onChangeNameAndNext = (name: string): void => {
426
+ // checkLocalChangeAndChangeStepStatus()
427
+ //
428
+ // vmForm.value.name = name
429
+ // onNext(true)
430
+ // }
431
+ //
432
+ // const onChangeStorageAndNext = (
433
+ // storage: UI_I_DatastoreTableItem | null
434
+ // ): void => {
435
+ // if (!storage) return
436
+ //
437
+ // const hasChanges = storage.id !== storageIdCash.value
438
+ // if (hasChanges) checkLocalChangeAndChangeStepStatus()
439
+ //
440
+ // vmForm.value.storage = storage
441
+ // storageIdCash.value = storage.id
442
+ //
443
+ // onNext(true)
444
+ // }
445
+ //
446
+ // const onChangeSelectOptionsAndNext = (options: string[]): void => {
447
+ // vmForm.value.options = options
448
+ //
449
+ // onNext(true)
450
+ // }
451
+ //
452
+ // const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
453
+ // const onChangeCustomizeHardware = (
454
+ // data: UI_I_SendDataCustomizeHardware
455
+ // ): void => {
456
+ // customizeHardware.value = data
457
+ // }
458
+ //
459
+ // const virtualHardwareHardDisksLocal = computed<
460
+ // UI_I_SendDataNewHardDisk[] | null
461
+ // >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
462
+ // const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
463
+ // () => customizeHardware.value?.virtualHardware?.networks || null
464
+ // )
465
+ // const virtualHardwareCdDvdDrivesLocal = computed<
466
+ // UI_I_SendDataNewCdDvdDrive[] | null
467
+ // >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
468
+ //
469
+ // const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
470
+ // () => customizeHardware.value?.virtualHardware?.cpu || null
471
+ // )
472
+ // const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
473
+ // () => customizeHardware.value?.virtualHardware?.memory || null
474
+ // )
475
+ // const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
476
+ // const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
477
+ // null
478
+ // )
479
+ // const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
480
+ // const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
481
+ // virtualHardwareHardDisks.value = data[0]
482
+ // virtualHardwareCdDvdDrives.value = data[1]
483
+ // virtualHardwareNetworks.value = data[2]
484
+ // }
485
+ //
486
+ // watch(
487
+ // () => props.vmNameInWizard,
488
+ // (newValue) => {
489
+ // vmForm.value.name = newValue
490
+ // }
491
+ // )
492
+ //
493
+ // const loading = ref<boolean>(false)
494
+ // const validateSendData = (): void => {
495
+ // loading.value = true
496
+ // props
497
+ // .validateSendDataFunc(
498
+ // vmForm.value,
499
+ // virtualHardwareCpu.value,
500
+ // virtualHardwareMemory.value,
501
+ // customizeHardware.value,
502
+ // virtualHardwareNetworks.value,
503
+ // virtualHardwareHardDisks.value,
504
+ // virtualHardwareCdDvdDrives.value,
505
+ // isPowerOnByDefault.value,
506
+ // localization.value
507
+ // )
508
+ // .then((data) => {
509
+ // loading.value = false
510
+ // if (!data) return
511
+ //
512
+ // selectedNavItem.value = data[0]
513
+ // data[1] !== null && (stepPosition.value = data[1])
514
+ // })
515
+ // }
516
+ // const onFinish = (): void => {
517
+ // loading.value = true
518
+ // props
519
+ // .finishFunc(
520
+ // vmForm.value,
521
+ // virtualHardwareCpu.value,
522
+ // virtualHardwareMemory.value,
523
+ // customizeHardware.value,
524
+ // virtualHardwareNetworks.value,
525
+ // virtualHardwareHardDisks.value,
526
+ // virtualHardwareCdDvdDrives.value,
527
+ // isPowerOnByDefault.value,
528
+ // localization.value
529
+ // )
530
+ // .then(() => {
531
+ // onHideModal()
532
+ // loading.value = false
533
+ // })
534
+ // }
535
+ //
536
+ // const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
537
+ //
538
+ // const nameFormSubmit = ref<number>(0)
539
+ // const storageSubmit = ref<number>(0)
540
+ // const customizeHardwareSubmit = ref<number>(0)
541
+ //
542
+ // const onNext = (force = false): void => {
543
+ // const isValid = checkSubmit(force)
544
+ // if (!isValid) {
545
+ // return
546
+ // }
547
+ //
548
+ // const isDisabled = stepItems.value[cashStep]?.disabled
549
+ // if (cashStep !== -1 && !isDisabled) {
550
+ // stepPosition.value = cashStep
551
+ // cashStep = -1
552
+ // return
553
+ // }
554
+ //
555
+ // stepItems.value[stepPosition.value].complete = true
556
+ // stepItems.value[stepPosition.value + 1].disabled = false
557
+ // stepPosition.value++
558
+ // }
559
+ // const checkLocalChangeAndChangeStepStatus = (): void => {
560
+ // stepItems.value = stepItems.value.map((step, index) => {
561
+ // if (index > stepPosition.value) {
562
+ // step.complete = false
563
+ // step.disabled = index > stepPosition.value + 1
564
+ // }
565
+ //
566
+ // return step
567
+ // })
568
+ // }
569
+ //
570
+ // const checkSubmit = (force = false): boolean => {
571
+ // if (stepPosition.value === 0 && !force) {
572
+ // nameFormSubmit.value++
573
+ // return false
574
+ // }
575
+ // if (stepPosition.value === 1 && !force) {
576
+ // storageSubmit.value++
577
+ // return false
578
+ // }
579
+ // if (stepPosition.value === 2 && !force) {
580
+ // selectOptionsSubmit.value++
581
+ // return false
582
+ // }
583
+ // if (stepPosition.value === 3 && !force) {
584
+ // customizeHardwareSubmit.value++
585
+ // return false
586
+ // }
587
+ // return true
588
+ // }
589
+ // const checkSubmitByManual = (step: number): boolean => {
590
+ // if (stepPosition.value === 0) {
591
+ // nameFormSubmit.value++
592
+ // return false
593
+ // }
594
+ // if (stepPosition.value === 1) {
595
+ // storageSubmit.value++
596
+ // return false
597
+ // }
598
+ // if (step === 3) {
599
+ // customizeHardwareSubmit.value++
600
+ // return false
601
+ // }
602
+ // return true
603
+ // }
604
+ // const onBack = (): void => {
605
+ // stepPosition.value--
606
+ // }
607
+ // let cashStep = -1
608
+ // const onChangeStep = (key: number): void => {
609
+ // const isValid = checkSubmitByManual(key)
610
+ // if (!isValid) {
611
+ // cashStep = key
612
+ // return
613
+ // }
614
+ //
615
+ // stepPosition.value = key
616
+ // }
617
+ //
618
+ // const compatibility = ref<UI_I_OptionItem[]>(capabilities.compatibility)
619
+ // const maxMemory = ref<number>(capabilities.maxMemory)
620
+ //
621
+ // const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
622
+ // const vmName = ref<string>(vmSettings.value?.name || '')
623
+ // watch(vmSettings, (newValue) => {
624
+ // vmName.value = newValue?.name || ''
625
+ // })
626
+ //
627
+ // const onHideModal = (): void => {
628
+ // emits('hide')
629
+ // }
630
+ </script>
631
+
632
+ <style scoped lang="scss">
633
+ :deep(.has-solid.close-icon.clr-icon) {
634
+ width: 20px;
635
+ top: 0;
636
+ }
637
+ .vm-context {
638
+ padding: 16px 15px 10px 10px;
639
+ height: 100%;
640
+ display: flex;
641
+ flex-direction: column;
642
+
643
+ .context-title-wrap {
644
+ padding-bottom: 3px;
645
+ border-bottom: 1px solid #a6a6a6;
646
+
647
+ h4 {
648
+ font-weight: 700;
649
+ font-size: 13px;
650
+ color: var(--vm-context-title);
651
+ }
652
+ p {
653
+ font-weight: 400;
654
+ font-size: 13px;
655
+ color: var(--vm-context-sub-title);
656
+ }
657
+ }
658
+
659
+ .finish-block {
660
+ padding: 18px 24px 24px 24px;
661
+
662
+ .add-hosts-ready-to-complete-mt-12 {
663
+ margin-top: 12px;
664
+
665
+ .add-hosts-ready-to-complete-bold {
666
+ line-height: 18px;
667
+ font-weight: 700;
668
+ }
669
+ }
670
+ }
671
+
672
+ .vm-hardware-version {
673
+ align-self: flex-end;
674
+ margin-top: auto;
675
+ }
676
+ }
677
+
678
+ :deep(.modal .modal-dialog .modal-content .modal-footer) {
679
+ flex: unset;
680
+ height: unset;
681
+ min-height: unset;
682
+ }
683
+ :deep(.wizard-modal-titlebar h3) {
684
+ color: #000;
685
+ font-size: 24px;
686
+ font-weight: 200;
687
+ line-height: 27px;
688
+ margin: 0;
689
+ padding: 0;
690
+ }
691
+ :deep(.clr-wizard-stepnav-item) {
692
+ padding-left: 0;
693
+ }
694
+ :deep(.clr-wizard-stepnav
695
+ .clr-wizard-stepnav-item
696
+ button
697
+ .clr-wizard-stepnav-link-title) {
698
+ width: 189px;
699
+ font-weight: 700;
700
+ font-size: 13px;
701
+ }
702
+
703
+ #vm-wizard-notification {
704
+ h3 {
705
+ color: var(--global-font-color7);
706
+ margin-top: 6px;
707
+ }
708
+ p {
709
+ color: var(--global-font-color6);
710
+ line-height: 16px;
711
+ }
712
+ }
713
+
714
+ .power-on-by-default-wrap {
715
+ display: flex;
716
+ align-items: center;
717
+
718
+ input {
719
+ margin-right: 6px;
720
+ }
721
+ }
722
+ </style>
723
+
724
+ <style>
725
+ :root {
726
+ --vm-context-title: #333;
727
+ --vm-context-sub-title: #000;
728
+ }
729
+ :root.dark-theme {
730
+ --vm-context-title: #adbbc4;
731
+ --vm-context-sub-title: #adbbc4;
732
+ }
733
+ </style>