bfg-common 1.5.580 → 1.5.581

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/components/common/vm/actions/add/Add.vue +120 -46
  2. package/components/common/vm/actions/add/New.vue +54 -16
  3. package/components/common/vm/actions/add/Old.vue +55 -16
  4. package/components/common/vm/actions/clone/Clone.vue +116 -44
  5. package/components/common/vm/actions/clone/new/New.vue +50 -14
  6. package/components/common/vm/actions/clone/old/Old.vue +52 -16
  7. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +81 -14
  8. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +56 -7
  9. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +56 -8
  10. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +206 -211
  11. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +120 -225
  12. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +118 -220
  13. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +53 -66
  14. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +159 -139
  15. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +15 -8
  16. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuOld.vue +13 -8
  17. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +75 -62
  18. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +149 -241
  19. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +4 -3
  20. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +3 -2
  21. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +100 -62
  22. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +17 -6
  23. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +3 -6
  24. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerOld.vue +3 -6
  25. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +39 -17
  26. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +5 -6
  27. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +5 -6
  28. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options.ts +4 -4
  29. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +93 -6
  30. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +60 -8
  31. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +58 -8
  32. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +69 -5
  33. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +32 -12
  34. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsOld.vue +33 -12
  35. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +132 -114
  36. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +6 -41
  37. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderOld.vue +6 -44
  38. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +23 -8
  39. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +31 -21
  40. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +34 -26
  41. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +34 -28
  42. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/Old.vue +30 -24
  43. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +112 -8
  44. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +3 -3
  45. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{New.vue → KeymapNew.vue} +6 -6
  46. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{Old.vue → KeymapOld.vue} +5 -5
  47. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +7 -6
  48. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +27 -9
  49. package/components/common/vm/actions/common/lib/models/interfaces.ts +25 -58
  50. package/components/common/vm/actions/editSettings/EditSettings.vue +90 -32
  51. package/components/common/vm/actions/editSettings/EditSettingsOld.vue +41 -14
  52. package/components/common/vm/actions/editSettings/new/New.vue +41 -14
  53. package/components/common/vm/actions/lib/models/interfaces.ts +29 -4
  54. package/components/common/vm/actions/lib/utils.ts +36 -64
  55. package/package.json +1 -1
  56. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{New.vue → PasswordNew.vue} +0 -0
  57. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{Old.vue → PasswordOld.vue} +0 -0
@@ -1,11 +1,13 @@
1
1
  <template>
2
2
  <common-vm-actions-clone-new
3
3
  v-if="isNewView"
4
- v-model="model"
4
+ v-model:vm-form="vmForm"
5
5
  v-model:scheduler-task-form="schedulerTaskForm"
6
+ v-model:vm-name="vmName"
6
7
  v-model:compute-resource="vmForm.computeResource"
7
8
  v-model:location="location"
8
9
  :project="props.project"
10
+ :vm-settings="vmSettings"
9
11
  :nodes="props.nodes"
10
12
  :files="props.files"
11
13
  :networks-table="props.networksTable"
@@ -33,6 +35,9 @@
33
35
  :is-sphere="isSphere"
34
36
  :location-description="locationDescription"
35
37
  :name-test-ids="nameTestIds"
38
+ :virtual-hardware-hard-disks-local="virtualHardwareHardDisksLocal"
39
+ :virtual-hardware-networks-local="virtualHardwareNetworksLocal"
40
+ :virtual-hardware-cd-dvd-drives-local="virtualHardwareCdDvdDrivesLocal"
36
41
  :guest-os-families="guestOsFamilies"
37
42
  :guest-os-versions="guestOsVersions"
38
43
  :machine-types="machineTypes"
@@ -40,13 +45,13 @@
40
45
  :is-loading-compute-tree="isLoadingComputeTree"
41
46
  :compute-resource-alert="computeResourceAlert"
42
47
  :compatibility-text="compatibilityText"
43
- :max-memory="maxMemory"
44
- :cpu-models="cpuModels"
45
48
  @get-folders-or-files="emits('get-folders-or-files', $event)"
46
49
  @change-name="onChangeName"
47
50
  @change-storage="onChangeStorage"
48
51
  @change-select-options="onChangeSelectOptions"
49
52
  @change-clone-count="cloneCount = $event"
53
+ @change-boot-order="onChangeBootOrder"
54
+ @change-customize-hardware="onChangeCustomizeHardware"
50
55
  @get-storage="emits('get-storage', $event)"
51
56
  @get-active-device-child="emits('get-active-device-child', $event)"
52
57
  @show-datastore-child="emits('show-datastore-child', $event)"
@@ -59,11 +64,13 @@
59
64
  />
60
65
  <common-vm-actions-clone-old
61
66
  v-else
62
- v-model="model"
67
+ v-model:vm-form="vmForm"
63
68
  v-model:scheduler-task-form="schedulerTaskForm"
69
+ v-model:vm-name="vmName"
64
70
  v-model:compute-resource="vmForm.computeResource"
65
71
  v-model:location="location"
66
72
  :project="props.project"
73
+ :vm-settings="vmSettings"
67
74
  :nodes="props.nodes"
68
75
  :files="props.files"
69
76
  :networks-table="props.networksTable"
@@ -92,6 +99,9 @@
92
99
  :is-sphere="isSphere"
93
100
  :location-description="locationDescription"
94
101
  :name-test-ids="nameTestIds"
102
+ :virtual-hardware-hard-disks-local="virtualHardwareHardDisksLocal"
103
+ :virtual-hardware-networks-local="virtualHardwareNetworksLocal"
104
+ :virtual-hardware-cd-dvd-drives-local="virtualHardwareCdDvdDrivesLocal"
95
105
  :guest-os-families="guestOsFamilies"
96
106
  :guest-os-versions="guestOsVersions"
97
107
  :machine-types="machineTypes"
@@ -99,13 +109,13 @@
99
109
  :is-loading-compute-tree="isLoadingComputeTree"
100
110
  :compute-resource-alert="computeResourceAlert"
101
111
  :compatibility-text="compatibilityText"
102
- :max-memory="maxMemory"
103
- :cpu-models="cpuModels"
104
112
  @get-folders-or-files="emits('get-folders-or-files', $event)"
105
113
  @change-name="onChangeName"
106
114
  @change-storage="onChangeStorage"
107
115
  @change-select-options="onChangeSelectOptions"
108
116
  @change-clone-count="cloneCount = $event"
117
+ @change-boot-order="onChangeBootOrder"
118
+ @change-customize-hardware="onChangeCustomizeHardware"
109
119
  @get-storage="emits('get-storage', $event)"
110
120
  @get-active-device-child="emits('get-active-device-child', $event)"
111
121
  @show-datastore-child="emits('show-datastore-child', $event)"
@@ -135,15 +145,25 @@ import type {
135
145
  UI_I_ArbitraryObject,
136
146
  UI_I_Localization,
137
147
  } from '~/lib/models/interfaces'
148
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
138
149
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
150
+ import type {
151
+ UI_I_SendDataCpu,
152
+ UI_I_SendDataMemory,
153
+ UI_I_SendDataNewCdDvdDrive,
154
+ UI_I_SendDataNewHardDisk,
155
+ UI_I_SendDataNewNetwork,
156
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
139
157
  import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
140
158
  import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
159
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
141
160
  import type { UI_T_Project } from '~/lib/models/types'
142
161
  import type {
143
162
  UI_I_MediatedDevice,
144
163
  UI_I_PciDevice,
164
+ UI_I_VmSettings,
145
165
  } from '~/lib/models/store/vm/interfaces'
146
- import type {UI_I_CreateVmData, UI_I_VmForm} from '~/components/common/vm/actions/common/lib/models/interfaces'
166
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/common/lib/models/interfaces'
147
167
  import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
148
168
  import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
149
169
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
@@ -159,11 +179,10 @@ import { mapCapabilities } from '~/components/common/vm/actions/common/lib/utils
159
179
  import { scheduledTaskDefaultFormFunc } from '~/components/common/pages/scheduledTasks/modals/lib/config/createScheduledTask'
160
180
  import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
161
181
 
162
- const model = defineModel<UI_I_CreateVmData>({ required: true })
163
-
164
182
  const props = withDefaults(
165
183
  defineProps<{
166
184
  project: UI_T_Project
185
+ vmSettings: UI_I_VmSettings | null
167
186
  nodes: UI_I_FileTreeNode[]
168
187
  files: UI_I_FileTreeNode[]
169
188
  networksTable: UI_I_NetworkTableItem[]
@@ -260,9 +279,6 @@ watch(
260
279
  { deep: true, immediate: true }
261
280
  )
262
281
 
263
- const cpuModels = ref<UI_I_OptionItem[]>(capabilities.value.cpuModels)
264
- const maxMemory = ref<number>(capabilities.value.maxMemory)
265
-
266
282
  const wizard: Wizard = new Wizard(
267
283
  stepsFunc(localization.value),
268
284
  stepsSchemeInitial
@@ -563,14 +579,23 @@ const checkCustomizeHardware = async (
563
579
  }
564
580
 
565
581
  const vmForm = ref<UI_I_VmForm>({
582
+ name: '',
583
+ compatibility: '',
584
+ guestMachineType: null,
585
+ guestOsFamily: null,
586
+ guestOsVersion: null,
587
+ computeResource: props.computeResource,
588
+ storage: null,
566
589
  locationPath: '',
567
590
  dataCenter: null,
591
+ options: [],
568
592
  })
569
593
 
570
594
  const isLoadingComputeTree = ref<boolean>(false)
571
595
  const onChangeName = (data: [string, UI_I_TreeNode | null]): void => {
572
- const [_name, node] = data
573
- // vmForm.value.name = name
596
+ const [name, node] = data
597
+
598
+ vmForm.value.name = name
574
599
  if (isSphere.value) {
575
600
  vmForm.value.locationPath = node.id
576
601
  vmForm.value.dataCenter = $recursion.findParentByValue(
@@ -591,11 +616,10 @@ const onChangeName = (data: [string, UI_I_TreeNode | null]): void => {
591
616
  const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
592
617
  if (!storage) return
593
618
 
594
- // vmForm.value.storage = storage
595
- model.value.storage = storage
619
+ vmForm.value.storage = storage
596
620
  }
597
621
  const onChangeSelectOptions = (options: string[]): void => {
598
- // vmForm.value.options = options
622
+ vmForm.value.options = options
599
623
  if (
600
624
  options.includes('customize-os') &&
601
625
  options.includes('customize-hardware')
@@ -621,15 +645,48 @@ const onChangeSelectOptions = (options: string[]): void => {
621
645
  isPowerOnByDefault.value = options.includes('power-on')
622
646
  isCreateLinkedClone.value = options.includes('create-linked-clone')
623
647
  }
648
+ const cloneCount = ref<number>(1)
649
+ const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
650
+ const onChangeCustomizeHardware = (
651
+ data: UI_I_SendDataCustomizeHardware
652
+ ): void => {
653
+ customizeHardware.value = data
654
+ }
655
+
656
+ const virtualHardwareHardDisksLocal = computed<
657
+ UI_I_SendDataNewHardDisk[] | null
658
+ >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
659
+ const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
660
+ () => customizeHardware.value?.virtualHardware?.networks || null
661
+ )
662
+ const virtualHardwareCdDvdDrivesLocal = computed<
663
+ UI_I_SendDataNewCdDvdDrive[] | null
664
+ >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
665
+
666
+ const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
667
+ () => customizeHardware.value?.virtualHardware?.cpu || null
668
+ )
669
+ const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
670
+ () => customizeHardware.value?.virtualHardware?.memory || null
671
+ )
672
+ const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
673
+ const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
674
+ null
675
+ )
676
+ const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
677
+ const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
678
+ virtualHardwareHardDisks.value = data[0]
679
+ virtualHardwareCdDvdDrives.value = data[1]
680
+ virtualHardwareNetworks.value = data[2]
681
+ }
682
+
624
683
  const isPowerOnByDefault = ref<boolean>(false)
625
684
  const isCreateLinkedClone = ref<boolean>(false)
626
- const cloneCount = ref<number>(0)
627
685
 
628
686
  watch(
629
687
  () => props.vmNameInWizard,
630
688
  (newValue) => {
631
- // vmForm.value.name = newValue
632
- model.value.name = newValue
689
+ vmForm.value.name = newValue
633
690
  }
634
691
  )
635
692
 
@@ -640,12 +697,18 @@ const validateSendData = async (
640
697
  let stepHasError = false
641
698
 
642
699
  const data = await props.validateSendDataFunc(
643
- model.value,
700
+ vmForm.value,
701
+ virtualHardwareCpu.value,
702
+ virtualHardwareMemory.value,
703
+ customizeHardware.value,
704
+ virtualHardwareNetworks.value,
705
+ virtualHardwareHardDisks.value,
706
+ virtualHardwareCdDvdDrives.value,
644
707
  isPowerOnByDefault.value,
645
708
  localization.value,
646
709
  vmForm.value.locationPath, // для сферы
647
710
  // computeResourcePath.value // для сферы
648
- model.value.host_id // для сферы // TODO rollback
711
+ vmSettings.value.host_id // для сферы // TODO rollback
649
712
  )
650
713
 
651
714
  wizard.setLoader(false)
@@ -666,12 +729,18 @@ const onFinish = (): void => {
666
729
  wizard.setLoader(false)
667
730
  props
668
731
  .finishFunc(
669
- model.value,
732
+ vmForm.value,
733
+ virtualHardwareCpu.value,
734
+ virtualHardwareMemory.value,
735
+ customizeHardware.value,
736
+ virtualHardwareNetworks.value,
737
+ virtualHardwareHardDisks.value,
738
+ virtualHardwareCdDvdDrives.value,
670
739
  isPowerOnByDefault.value,
671
740
  localization.value,
672
741
  vmForm.value.locationPath, // для сферы
673
742
  // computeResourcePath.value, // для сферы
674
- model.value.host_id, // для сферы // TODO rollback
743
+ vmSettings.value.host_id, // для сферы // TODO rollback
675
744
  false,
676
745
  schedulerTaskForm.value,
677
746
  props.schedulerTask,
@@ -691,6 +760,9 @@ const nameFormSubmit = ref<null | Function>(null)
691
760
  const storageSubmit = ref<null | Function>(null)
692
761
  const customizeHardwareSubmit = ref<null | Function>(null)
693
762
 
763
+ const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
764
+ const vmName = ref<string>(vmSettings.value?.name || '')
765
+
694
766
  const guestOsFamilies = ref<UI_I_OptionItem[]>(
695
767
  capabilities.value.guestOsFamilies
696
768
  )
@@ -715,26 +787,26 @@ watch(
715
787
  { deep: true, immediate: true }
716
788
  )
717
789
 
718
- // watch(vmSettings, (newValue) => {
719
- // vmName.value = newValue?.name || ''
720
- //
721
- // if (newValue?.guestOsFamily)
722
- // vmForm.value.guestOsFamily = newValue.guestOsFamily
723
- // if (newValue?.guestMachineType)
724
- // vmForm.value.guestMachineType = newValue.guestMachineType
725
- // if (newValue?.guestOsVersion)
726
- // vmForm.value.guestOsVersion = newValue.guestOsVersion
727
- //
728
- // if (newValue?.compatibility)
729
- // vmForm.value.compatibility = newValue.compatibility
730
- //
731
- // if (newValue?.storage) {
732
- // const datastore = props.datastore.find(
733
- // (item) => item.id === newValue.storage.id
734
- // )
735
- // if (datastore) vmForm.value.storage = datastore
736
- // }
737
- // })
790
+ watch(vmSettings, (newValue) => {
791
+ vmName.value = newValue?.name || ''
792
+
793
+ if (newValue?.guestOsFamily)
794
+ vmForm.value.guestOsFamily = newValue.guestOsFamily
795
+ if (newValue?.guestMachineType)
796
+ vmForm.value.guestMachineType = newValue.guestMachineType
797
+ if (newValue?.guestOsVersion)
798
+ vmForm.value.guestOsVersion = newValue.guestOsVersion
799
+
800
+ if (newValue?.compatibility)
801
+ vmForm.value.compatibility = newValue.compatibility
802
+
803
+ if (newValue?.storage) {
804
+ const datastore = props.datastore.find(
805
+ (item) => item.id === newValue.storage.id
806
+ )
807
+ if (datastore) vmForm.value.storage = datastore
808
+ }
809
+ })
738
810
 
739
811
  const onHideModal = (): void => {
740
812
  emits('hide')
@@ -54,7 +54,7 @@
54
54
  </template>
55
55
  <template #content>
56
56
  <common-wizards-common-steps-name
57
- v-model:name="model.name"
57
+ v-model:name="vmForm.name"
58
58
  v-model:location="location"
59
59
  :show="
60
60
  selectedStep.id === props.dynamicSteps.selectName ||
@@ -99,7 +99,7 @@
99
99
  :storage-submit="props.storageSubmit"
100
100
  :datastore="props.datastore"
101
101
  :is-datastore-loading="props.isDatastoreLoading"
102
- :storage="model.storage"
102
+ :storage="vmForm.storage"
103
103
  :get-datastore-table-func="props.getDatastoreTableFunc"
104
104
  hide-alert
105
105
  @change-storage="emits('change-storage', $event)"
@@ -147,9 +147,9 @@
147
147
  </template>
148
148
  <template #content>
149
149
  <common-vm-actions-common-select-os
150
- v-model:guest-os-family="model.guest_os_family"
151
- v-model:guest-os-version="model.guest_os_version"
152
- v-model:machine-type="model.machine_type"
150
+ v-model:machine-type="vmForm.guestMachineType"
151
+ v-model:guest-os-family="vmForm.guestOsFamily"
152
+ v-model:guest-os-version="vmForm.guestOsVersion"
153
153
  :families-options="props.guestOsFamilies"
154
154
  :versions-options="props.guestOsVersions"
155
155
  :machine-types-options="props.machineTypes"
@@ -164,12 +164,31 @@
164
164
  >
165
165
  <template #content>
166
166
  <common-vm-actions-common-customize-hardware
167
- v-model="model"
168
- :storage="model.storage"
167
+ v-model:vm-name="vmName"
168
+ v-model:guest-machine-type="props.vmSettings.guestMachineType"
169
+ v-model:guest-os-family="props.vmSettings.guestOsFamily"
170
+ v-model:guest-os-version="props.vmSettings.guestOsVersion"
171
+ :storage="vmForm.storage"
172
+ :hard-disks-for-boot-options="props.virtualHardwareHardDisksLocal"
173
+ :cd-dvd-drives-for-boot-options="
174
+ props.virtualHardwareCdDvdDrivesLocal
175
+ "
176
+ :networks-for-boot-options="props.virtualHardwareNetworksLocal"
177
+ :cd-dvd-drives="props.vmSettings.cdDvdDrives"
178
+ :hard-disks="props.vmSettings.hardDisks"
179
+ :networks="props.vmSettings.networks"
169
180
  :customize-hardware-submit="props.customizeHardwareSubmit"
170
- :max-memory="props.maxMemory"
171
- :cpu-models="props.cpuModels"
181
+ :max-cpus="props.vmSettings.maxCpus"
182
+ :max-memory="props.vmSettings.maxMemory"
183
+ :cpu-models="props.vmSettings.cpuModels"
184
+ :cpu="props.vmSettings.cpu"
185
+ :memory="props.vmSettings.memory"
186
+ :video-card="props.vmSettings.videoCard"
187
+ :usb-controller="props.vmSettings.usbController"
188
+ :pci-devices="props.vmSettings.pciDevices"
172
189
  :selected-nav-item="props.selectedNavItem"
190
+ :hard-disks-for-edit="props.vmSettings.hardDisks"
191
+ :options="props.vmSettings.options"
173
192
  :nodes="props.nodes"
174
193
  :files="props.files"
175
194
  :networks-table="props.networksTable"
@@ -182,6 +201,8 @@
182
201
  :is-datastore-loading="props.isDatastoreLoading"
183
202
  :project="props.project"
184
203
  is-clone
204
+ @change-boot-order="emits('change-boot-order', $event)"
205
+ @send-data="emits('change-customize-hardware', $event)"
185
206
  @get-storage="emits('get-storage', $event)"
186
207
  @get-folders-or-files="emits('get-folders-or-files', $event)"
187
208
  @get-active-device-child="emits('get-active-device-child', $event)"
@@ -272,12 +293,19 @@ import type {
272
293
  UI_I_ArbitraryObject,
273
294
  UI_I_Localization,
274
295
  } from '~/lib/models/interfaces'
296
+ import type {
297
+ UI_I_SendDataNewCdDvdDrive,
298
+ UI_I_SendDataNewHardDisk,
299
+ UI_I_SendDataNewNetwork,
300
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
301
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
275
302
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
303
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
276
304
  import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
277
305
  import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
278
306
  import type { UI_I_NameTestIds } from '~/components/common/wizards/common/steps/name/lib/models/interfaces'
279
307
  import type { UI_T_Project } from '~/lib/models/types'
280
- import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
308
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/common/lib/models/interfaces'
281
309
  import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
282
310
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
283
311
  import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
@@ -286,6 +314,7 @@ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interface
286
314
  import type {
287
315
  UI_I_MediatedDevice,
288
316
  UI_I_PciDevice,
317
+ UI_I_VmSettings,
289
318
  } from '~/lib/models/store/vm/interfaces'
290
319
  import type {
291
320
  UI_I_DatastoreTableItem,
@@ -294,11 +323,11 @@ import type {
294
323
  import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
295
324
  import type { UI_T_CompatibilityStatus } from '~/components/common/wizards/common/compatibility/lib/models/types'
296
325
 
297
- const model = defineModel<UI_I_CreateVmData>({ required: true })
298
-
326
+ const vmForm = defineModel<UI_I_VmForm>('vm-form')
299
327
  const schedulerTaskForm = defineModel<UI_I_ScheduleNewTasksForm>(
300
328
  'scheduler-task-form'
301
329
  )
330
+ const vmName = defineModel<string>('vm-name')
302
331
  const computeResource = defineModel<UI_I_TreeNode | undefined>(
303
332
  'compute-resource'
304
333
  )
@@ -306,6 +335,7 @@ const location = defineModel<UI_I_TreeNode | null>('location')
306
335
  const props = withDefaults(
307
336
  defineProps<{
308
337
  project: UI_T_Project
338
+ vmSettings: UI_I_VmSettings | null
309
339
  nodes: UI_I_FileTreeNode[]
310
340
  files: UI_I_FileTreeNode[]
311
341
  networksTable: UI_I_NetworkTableItem[]
@@ -333,11 +363,12 @@ const props = withDefaults(
333
363
  isSphere: boolean
334
364
  locationDescription: string
335
365
  nameTestIds: UI_I_NameTestIds
366
+ virtualHardwareHardDisksLocal: UI_I_SendDataNewHardDisk[] | null
367
+ virtualHardwareNetworksLocal: UI_I_SendDataNewNetwork[] | null
368
+ virtualHardwareCdDvdDrivesLocal: UI_I_SendDataNewCdDvdDrive[] | null
336
369
  guestOsFamilies: UI_I_OptionItem[]
337
370
  guestOsVersions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
338
371
  machineTypes: UI_I_OptionItem[]
339
- maxMemory: number
340
- cpuModels: UI_I_OptionItem[]
341
372
  dynamicSteps: UI_I_ArbitraryObject<number>
342
373
  isLoadingComputeTree?: boolean // для сферы
343
374
  computeResourceAlert?: string[] // для сферы
@@ -363,6 +394,11 @@ const emits = defineEmits<{
363
394
  (event: 'change-storage', value: UI_I_DatastoreTableItem | null): void
364
395
  (event: 'change-select-options', value: string[]): void
365
396
  (event: 'change-clone-count', value: number): void
397
+ (event: 'change-boot-order', value: UI_T_ChangeBootOrder): void
398
+ (
399
+ event: 'change-customize-hardware',
400
+ value: UI_I_SendDataCustomizeHardware
401
+ ): void
366
402
  (event: 'hide'): void
367
403
  (event: 'finish'): void
368
404
  }>()
@@ -12,11 +12,11 @@
12
12
  >
13
13
  <template #modalBody="{ selectedStep }">
14
14
  <atoms-loader
15
- v-show="!model || props.isLoading"
15
+ v-show="!props.vmSettings || props.isLoading"
16
16
  id="loader"
17
17
  test-id="clone-vm-loader"
18
18
  />
19
- <div v-if="model" class="vm-context">
19
+ <div v-if="props.vmSettings" class="vm-context">
20
20
  <common-pages-scheduled-tasks-modals-common-new-task-form
21
21
  v-show="selectedStep.id === props.dynamicSteps.scheduledTasks"
22
22
  v-model="schedulerTaskForm"
@@ -28,7 +28,7 @@
28
28
  selectedStep.id === props.dynamicSteps.selectName ||
29
29
  selectedStep.id === props.dynamicSteps.selectNameFolder
30
30
  "
31
- v-model:name="model.name"
31
+ v-model:name="vmForm.name"
32
32
  v-model:location="location"
33
33
  :show="
34
34
  selectedStep.id === props.dynamicSteps.selectName ||
@@ -65,7 +65,7 @@
65
65
  :storage-submit="props.storageSubmit"
66
66
  :datastore="props.datastore"
67
67
  :is-datastore-loading="props.isDatastoreLoading"
68
- :storage="model.storage"
68
+ :storage="vmForm.storage"
69
69
  :get-datastore-table-func="props.getDatastoreTableFunc"
70
70
  @submit="emits('change-storage', $event)"
71
71
  />
@@ -79,9 +79,9 @@
79
79
  v-show="
80
80
  selectedStep.id === props.dynamicSteps.selectGuestOSMachineType
81
81
  "
82
- v-model:guest-os-family="model.guest_os_family"
83
- v-model:guest-os-version="model.guest_os_version"
84
- v-model:machine-type="model.machine_type"
82
+ v-model:machine-type="vmForm.guestMachineType"
83
+ v-model:guest-os-family="vmForm.guestOsFamily"
84
+ v-model:guest-os-version="vmForm.guestOsVersion"
85
85
  :families-options="props.guestOsFamilies"
86
86
  :versions-options="props.guestOsVersions"
87
87
  :machine-types-options="props.machineTypes"
@@ -90,12 +90,31 @@
90
90
  />
91
91
  <common-vm-actions-common-customize-hardware
92
92
  v-show="selectedStep.id === props.dynamicSteps.customizeHardware"
93
- v-model="model"
94
- :storage="model.storage"
93
+ v-model:vm-name="vmName"
94
+ v-model:guest-machine-type="props.vmSettings.guestMachineType"
95
+ v-model:guest-os-family="props.vmSettings.guestOsFamily"
96
+ v-model:guest-os-version="props.vmSettings.guestOsVersion"
97
+ :storage="vmForm.storage"
98
+ :hard-disks-for-boot-options="props.virtualHardwareHardDisksLocal"
99
+ :cd-dvd-drives-for-boot-options="
100
+ props.virtualHardwareCdDvdDrivesLocal
101
+ "
102
+ :networks-for-boot-options="props.virtualHardwareNetworksLocal"
103
+ :cd-dvd-drives="props.vmSettings.cdDvdDrives"
104
+ :hard-disks="props.vmSettings.hardDisks"
105
+ :networks="props.vmSettings.networks"
95
106
  :customize-hardware-submit="props.customizeHardwareSubmit"
96
- :max-memory="props.maxMemory"
97
- :cpu-models="props.cpuModels"
107
+ :max-cpus="props.vmSettings.maxCpus"
108
+ :max-memory="props.vmSettings.maxMemory"
109
+ :cpu-models="props.vmSettings.cpuModels"
110
+ :cpu="props.vmSettings.cpu"
111
+ :memory="props.vmSettings.memory"
112
+ :video-card="props.vmSettings.videoCard"
113
+ :usb-controller="props.vmSettings.usbController"
114
+ :pci-devices="props.vmSettings.pciDevices"
98
115
  :selected-nav-item="props.selectedNavItem"
116
+ :hard-disks-for-edit="props.vmSettings.hardDisks"
117
+ :options="props.vmSettings.options"
99
118
  :nodes="props.nodes"
100
119
  :files="props.files"
101
120
  :networks-table="props.networksTable"
@@ -108,6 +127,8 @@
108
127
  :is-datastore-loading="props.isDatastoreLoading"
109
128
  :project="props.project"
110
129
  is-clone
130
+ @change-boot-order="emits('change-boot-order', $event)"
131
+ @send-data="emits('change-customize-hardware', $event)"
111
132
  @get-storage="emits('get-storage', $event)"
112
133
  @get-folders-or-files="emits('get-folders-or-files', $event)"
113
134
  @get-active-device-child="emits('get-active-device-child', $event)"
@@ -139,26 +160,34 @@ import type {
139
160
  UI_I_ArbitraryObject,
140
161
  UI_I_Localization,
141
162
  } from '~/lib/models/interfaces'
163
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
142
164
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
165
+ import type {
166
+ UI_I_SendDataNewCdDvdDrive,
167
+ UI_I_SendDataNewHardDisk,
168
+ UI_I_SendDataNewNetwork,
169
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
143
170
  import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
144
171
  import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
172
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
145
173
  import type { UI_T_Project } from '~/lib/models/types'
146
174
  import type {
147
175
  UI_I_MediatedDevice,
148
176
  UI_I_PciDevice,
177
+ UI_I_VmSettings,
149
178
  } from '~/lib/models/store/vm/interfaces'
150
179
  import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
151
180
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
152
181
  import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
153
182
  import type { UI_I_NameTestIds } from '~/components/common/wizards/common/steps/name/lib/models/interfaces'
154
- import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
183
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/common/lib/models/interfaces'
155
184
  import type { UI_T_CompatibilityStatus } from '~/components/common/wizards/common/compatibility/lib/models/types'
156
185
 
157
- const model = defineModel<UI_I_CreateVmData>({ required: true })
158
-
186
+ const vmForm = defineModel<UI_I_VmForm>('vm-form')
159
187
  const schedulerTaskForm = defineModel<UI_I_ScheduleNewTasksForm>(
160
188
  'scheduler-task-form'
161
189
  )
190
+ const vmName = defineModel<string>('vm-name')
162
191
  const computeResource = defineModel<UI_I_TreeNode | undefined>(
163
192
  'compute-resource'
164
193
  )
@@ -166,6 +195,7 @@ const location = defineModel<UI_I_TreeNode | null>('location')
166
195
  const props = withDefaults(
167
196
  defineProps<{
168
197
  project: UI_T_Project
198
+ vmSettings: UI_I_VmSettings | null
169
199
  nodes: UI_I_FileTreeNode[]
170
200
  files: UI_I_FileTreeNode[]
171
201
  networksTable: UI_I_NetworkTableItem[]
@@ -193,11 +223,12 @@ const props = withDefaults(
193
223
  isSphere: boolean
194
224
  locationDescription: string
195
225
  nameTestIds: UI_I_NameTestIds
226
+ virtualHardwareHardDisksLocal: UI_I_SendDataNewHardDisk[] | null
227
+ virtualHardwareNetworksLocal: UI_I_SendDataNewNetwork[] | null
228
+ virtualHardwareCdDvdDrivesLocal: UI_I_SendDataNewCdDvdDrive[] | null
196
229
  guestOsFamilies: UI_I_OptionItem[]
197
230
  guestOsVersions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
198
231
  machineTypes: UI_I_OptionItem[]
199
- maxMemory: number
200
- cpuModels: UI_I_OptionItem[]
201
232
  dynamicSteps: UI_I_ArbitraryObject<number>
202
233
  isLoading: boolean
203
234
  isLoadingComputeTree?: boolean // для сферы
@@ -224,6 +255,11 @@ const emits = defineEmits<{
224
255
  (event: 'change-storage', value: UI_I_DatastoreTableItem | null): void
225
256
  (event: 'change-select-options', value: string[]): void
226
257
  (event: 'change-clone-count', value: number): void
258
+ (event: 'change-boot-order', value: UI_T_ChangeBootOrder): void
259
+ (
260
+ event: 'change-customize-hardware',
261
+ value: UI_I_SendDataCustomizeHardware
262
+ ): void
227
263
  (event: 'hide'): void
228
264
  (event: 'finish'): void
229
265
  }>()