bfg-common 1.3.29 → 1.3.31

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.
@@ -14,73 +14,76 @@
14
14
  @submit="onFinish"
15
15
  >
16
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
- />
17
+ <atoms-loader v-show="!vmSettings" id="loader" />
18
+ <div v-if="vmSettings" class="vm-context">
19
+ <common-vm-actions-common-select-name
20
+ v-show="selectedStep.id === 0"
21
+ :name-form-submit="nameFormSubmit"
22
+ :project="props.project"
23
+ @submit="onChangeName(...$event)"
24
+ @check-name="emits('check-name', $event)"
25
+ />
26
+ <common-vm-actions-common-select-storage
27
+ v-show="selectedStep.id === 1"
28
+ :storage-submit="storageSubmit"
29
+ :datastore="props.datastore"
30
+ :storage="vmSettings.storage"
31
+ :get-datastore-table-func="props.getDatastoreTableFunc"
32
+ @submit="onChangeStorage"
33
+ />
34
+ <common-vm-actions-clone-select-options
35
+ v-show="selectedStep.id === 2"
36
+ :select-options-submit="selectOptionsSubmit"
37
+ @submit="onChangeSelectOptions"
38
+ />
39
+ <common-vm-actions-common-customize-hardware
40
+ v-show="selectedStep.id === 3"
41
+ v-model:vm-name="vmName"
42
+ v-model:guest-machine-type="vmSettings.guestMachineType"
43
+ v-model:guest-os-family="vmSettings.guestOsFamily"
44
+ v-model:guest-os-version="vmSettings.guestOsVersion"
45
+ :storage="vmSettings.storage"
46
+ :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
47
+ :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
48
+ :networks-for-boot-options="virtualHardwareNetworksLocal"
49
+ :cd-dvd-drives="vmSettings.cdDvdDrives"
50
+ :hard-disks="vmSettings.hardDisks"
51
+ :networks="vmSettings.networks"
52
+ :customize-hardware-submit="customizeHardwareSubmit"
53
+ :max-cpus="vmSettings.maxCpus"
54
+ :max-memory="vmSettings.maxMemory"
55
+ :cpu-models="vmSettings.cpuModels"
56
+ :cpu="vmSettings.cpu"
57
+ :memory="vmSettings.memory"
58
+ :video-card="vmSettings.videoCard"
59
+ :usb-controller="vmSettings.usbController"
60
+ :pci-devices="vmSettings.pciDevices"
61
+ :selected-nav-item="selectedNavItem"
62
+ :hard-disks-for-edit="vmSettings.hardDisks"
63
+ :options="vmSettings.options"
64
+ :nodes="props.nodes"
65
+ :files="props.files"
66
+ :networks-table="props.networksTable"
67
+ :error-validation-fields="props.errorValidationFields"
68
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
69
+ :passthrough-devices="props.passthroughDevices"
70
+ :get-datastore-table-func="props.getDatastoreTableFunc"
71
+ :datastore="props.datastore"
72
+ is-clone
73
+ @change-boot-order="onChangeBootOrder"
74
+ @send-data="onChangeCustomizeHardware"
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
+ />
82
+ <common-vm-actions-common-ready-to-complete
83
+ v-show="selectedStep.id === 4"
84
+ :ready-complete-table-info="props.readyCompleteTableInfo"
85
+ />
86
+ </div>
84
87
  </template>
85
88
  </atoms-wizard>
86
89
  </div>
@@ -108,10 +111,6 @@ import type {
108
111
  UI_I_SendDataNewNetwork,
109
112
  } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
110
113
  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
114
  import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
116
115
  import type { UI_I_ConfigurePciDevicesTable } from '~/lib/models/store/host/interfaces'
117
116
  import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
@@ -122,7 +121,6 @@ import {
122
121
  UI_I_ValidationReturn,
123
122
  UI_I_WizardStep,
124
123
  } from '~/components/atoms/wizard/lib/models/interfaces'
125
- import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
126
124
  import {
127
125
  stepsSchemeInitial,
128
126
  stepsFunc,
@@ -166,7 +164,7 @@ const wizard: Wizard = new Wizard(
166
164
  )
167
165
  const wasCompleted = computed<boolean>(() => wizard.wasCompleted())
168
166
  const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
169
- const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
167
+ // const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
170
168
 
171
169
  const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
172
170
  wizard.changeSteps(value, validationFunc, validateSendData)
@@ -412,221 +410,6 @@ watch(vmSettings, (newValue) => {
412
410
  const onHideModal = (): void => {
413
411
  emits('hide')
414
412
  }
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
413
  </script>
631
414
 
632
415
  <style scoped lang="scss">
@@ -11,7 +11,7 @@ export const stepsFunc = (
11
11
  stepName: '',
12
12
  title: localization.selectName,
13
13
  subTitle: localization.specifyUniqueName,
14
- status: UI_E_WIZARD_STATUS.INACTIVE,
14
+ status: UI_E_WIZARD_STATUS.SELECTED,
15
15
  isValid: true,
16
16
  fields: {
17
17
  name: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.29",
4
+ "version": "1.3.31",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",