bfg-common 1.5.574 → 1.5.575

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 (163) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  4. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  5. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  6. package/components/atoms/TheIcon3.vue +50 -50
  7. package/components/atoms/collapse/CollapseNav.vue +170 -170
  8. package/components/atoms/perPage/PerPage.vue +58 -58
  9. package/components/atoms/table/dataGrid/DataGrid.vue +1718 -1718
  10. package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
  11. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  12. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  13. package/components/common/backup/storage/actions/add/Add.vue +3 -2
  14. package/components/common/backup/storage/actions/add/New.vue +3 -2
  15. package/components/common/backup/storage/actions/add/Old.vue +5 -4
  16. package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
  17. package/components/common/backup/storage/actions/add/steps/readyComplete/ReadyComplete.vue +45 -45
  18. package/components/common/backup/storage/actions/add/steps/readyComplete/lib/config/propertiesDetails.ts +7 -7
  19. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  20. package/components/common/diagramMain/modals/lib/config/portModal.ts +251 -251
  21. package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
  22. package/components/common/diagramMain/port/Port.vue +580 -580
  23. package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
  24. package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
  25. package/components/common/pages/backups/DetailView.vue +52 -52
  26. package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
  27. package/components/common/pages/backups/modals/Modals.vue +243 -243
  28. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  29. package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
  30. package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
  31. package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
  32. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
  33. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  34. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  35. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  36. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  37. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  38. package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
  39. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  40. package/components/common/select/radio/RadioGroup.vue +137 -137
  41. package/components/common/spiceConsole/Drawer.vue +420 -420
  42. package/components/common/spiceConsole/SpiceConsole.vue +184 -184
  43. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  44. package/components/common/tools/Actions.vue +207 -207
  45. package/components/common/treeView/TreeView.vue +52 -52
  46. package/components/common/vm/actions/add/Add.vue +120 -46
  47. package/components/common/vm/actions/add/New.vue +54 -16
  48. package/components/common/vm/actions/add/Old.vue +55 -16
  49. package/components/common/vm/actions/add/lib/config/steps.ts +347 -347
  50. package/components/common/vm/actions/clone/Clone.vue +115 -43
  51. package/components/common/vm/actions/clone/new/New.vue +50 -14
  52. package/components/common/vm/actions/clone/old/Old.vue +52 -16
  53. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +81 -14
  54. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +56 -7
  55. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +56 -8
  56. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +206 -211
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +120 -225
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +118 -220
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +53 -66
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +159 -139
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +15 -8
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuOld.vue +13 -8
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +75 -62
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryNew.vue +158 -158
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryOld.vue +155 -155
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +149 -241
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +4 -3
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +3 -2
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +100 -62
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +17 -6
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +3 -6
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerOld.vue +3 -6
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +39 -17
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +5 -6
  81. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +5 -6
  82. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options.ts +4 -4
  83. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
  84. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +93 -6
  85. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +60 -8
  86. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +58 -8
  87. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +69 -5
  88. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +32 -12
  89. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsOld.vue +33 -12
  90. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  91. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  92. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +132 -114
  93. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +6 -41
  94. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderOld.vue +6 -44
  95. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +23 -8
  96. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +31 -21
  97. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +34 -26
  98. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +34 -28
  99. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/Old.vue +30 -24
  100. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +112 -8
  101. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +3 -3
  102. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{New.vue → KeymapNew.vue} +6 -6
  103. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{Old.vue → KeymapOld.vue} +5 -5
  104. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +7 -6
  105. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  106. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +60 -42
  107. package/components/common/vm/actions/common/lib/models/interfaces.ts +25 -58
  108. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  109. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  110. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  111. package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
  112. package/components/common/vm/actions/common/select/storage/Storage.vue +178 -178
  113. package/components/common/vm/actions/common/select/storage/new/New.vue +311 -311
  114. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  115. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  116. package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
  117. package/components/common/vm/actions/editSettings/EditSettings.vue +90 -32
  118. package/components/common/vm/actions/editSettings/EditSettingsOld.vue +41 -14
  119. package/components/common/vm/actions/editSettings/new/New.vue +41 -14
  120. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  121. package/components/common/vm/actions/lib/models/interfaces.ts +29 -4
  122. package/components/common/vm/actions/lib/utils.ts +36 -64
  123. package/components/common/vm/actions/register/Register.vue +352 -352
  124. package/components/common/vm/actions/register/lib/config/steps.ts +86 -86
  125. package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
  126. package/components/common/wizards/common/compatibility/New.vue +99 -99
  127. package/components/common/wizards/common/compatibility/Old.vue +53 -53
  128. package/components/common/wizards/common/steps/computeResource/ComputeResource.vue +86 -86
  129. package/components/common/wizards/common/steps/computeResource/New.vue +93 -93
  130. package/components/common/wizards/common/steps/computeResource/Old.vue +103 -103
  131. package/components/common/wizards/common/steps/name/Name.vue +178 -178
  132. package/components/common/wizards/common/steps/name/New.vue +221 -221
  133. package/components/common/wizards/common/steps/name/Old.vue +121 -121
  134. package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
  135. package/components/common/wizards/common/steps/name/location/Location.vue +85 -85
  136. package/components/common/wizards/common/steps/name/location/New.vue +40 -40
  137. package/components/common/wizards/datastore/add/Add.vue +228 -228
  138. package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
  139. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  140. package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +205 -205
  141. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  142. package/composables/useAppVersion.ts +21 -21
  143. package/composables/useLocal.ts +6 -6
  144. package/composables/useLocalCommon.ts +39 -39
  145. package/package.json +1 -1
  146. package/plugins/console.ts +21 -21
  147. package/plugins/date.ts +233 -233
  148. package/plugins/mouse.ts +21 -21
  149. package/plugins/panelStates.ts +70 -70
  150. package/plugins/text.ts +59 -59
  151. package/public/spice-console/application/clientgui.js +854 -854
  152. package/public/spice-console/application/packetfactory.js +211 -211
  153. package/public/spice-console/application/virtualmouse.js +147 -147
  154. package/public/spice-console/lib/images/bitmap.js +203 -203
  155. package/public/spice-console/network/spicechannel.js +440 -440
  156. package/public/spice-console/process/cursorprocess.js +121 -121
  157. package/public/spice-console/process/inputprocess.js +227 -227
  158. package/public/spice-console/process/mainprocess.js +210 -210
  159. package/public/spice-console/run.js +210 -210
  160. package/store/main/mutations.ts +7 -7
  161. package/store/main/state.ts +7 -7
  162. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{New.vue → PasswordNew.vue} +0 -0
  163. /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,12 +45,12 @@
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"
52
+ @change-boot-order="onChangeBootOrder"
53
+ @change-customize-hardware="onChangeCustomizeHardware"
49
54
  @get-storage="emits('get-storage', $event)"
50
55
  @get-active-device-child="emits('get-active-device-child', $event)"
51
56
  @show-datastore-child="emits('show-datastore-child', $event)"
@@ -58,11 +63,13 @@
58
63
  />
59
64
  <common-vm-actions-clone-old
60
65
  v-else
61
- v-model="model"
66
+ v-model:vm-form="vmForm"
62
67
  v-model:scheduler-task-form="schedulerTaskForm"
68
+ v-model:vm-name="vmName"
63
69
  v-model:compute-resource="vmForm.computeResource"
64
70
  v-model:location="location"
65
71
  :project="props.project"
72
+ :vm-settings="vmSettings"
66
73
  :nodes="props.nodes"
67
74
  :files="props.files"
68
75
  :networks-table="props.networksTable"
@@ -91,6 +98,9 @@
91
98
  :is-sphere="isSphere"
92
99
  :location-description="locationDescription"
93
100
  :name-test-ids="nameTestIds"
101
+ :virtual-hardware-hard-disks-local="virtualHardwareHardDisksLocal"
102
+ :virtual-hardware-networks-local="virtualHardwareNetworksLocal"
103
+ :virtual-hardware-cd-dvd-drives-local="virtualHardwareCdDvdDrivesLocal"
94
104
  :guest-os-families="guestOsFamilies"
95
105
  :guest-os-versions="guestOsVersions"
96
106
  :machine-types="machineTypes"
@@ -98,12 +108,12 @@
98
108
  :is-loading-compute-tree="isLoadingComputeTree"
99
109
  :compute-resource-alert="computeResourceAlert"
100
110
  :compatibility-text="compatibilityText"
101
- :max-memory="maxMemory"
102
- :cpu-models="cpuModels"
103
111
  @get-folders-or-files="emits('get-folders-or-files', $event)"
104
112
  @change-name="onChangeName"
105
113
  @change-storage="onChangeStorage"
106
114
  @change-select-options="onChangeSelectOptions"
115
+ @change-boot-order="onChangeBootOrder"
116
+ @change-customize-hardware="onChangeCustomizeHardware"
107
117
  @get-storage="emits('get-storage', $event)"
108
118
  @get-active-device-child="emits('get-active-device-child', $event)"
109
119
  @show-datastore-child="emits('show-datastore-child', $event)"
@@ -133,15 +143,25 @@ import type {
133
143
  UI_I_ArbitraryObject,
134
144
  UI_I_Localization,
135
145
  } from '~/lib/models/interfaces'
146
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
136
147
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
148
+ import type {
149
+ UI_I_SendDataCpu,
150
+ UI_I_SendDataMemory,
151
+ UI_I_SendDataNewCdDvdDrive,
152
+ UI_I_SendDataNewHardDisk,
153
+ UI_I_SendDataNewNetwork,
154
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
137
155
  import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
138
156
  import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
157
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
139
158
  import type { UI_T_Project } from '~/lib/models/types'
140
159
  import type {
141
160
  UI_I_MediatedDevice,
142
161
  UI_I_PciDevice,
162
+ UI_I_VmSettings,
143
163
  } from '~/lib/models/store/vm/interfaces'
144
- import type {UI_I_CreateVmData, UI_I_VmForm} from '~/components/common/vm/actions/common/lib/models/interfaces'
164
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/common/lib/models/interfaces'
145
165
  import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
146
166
  import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
147
167
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
@@ -157,11 +177,10 @@ import { mapCapabilities } from '~/components/common/vm/actions/common/lib/utils
157
177
  import { scheduledTaskDefaultFormFunc } from '~/components/common/pages/scheduledTasks/modals/lib/config/createScheduledTask'
158
178
  import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
159
179
 
160
- const model = defineModel<UI_I_CreateVmData>({ required: true })
161
-
162
180
  const props = withDefaults(
163
181
  defineProps<{
164
182
  project: UI_T_Project
183
+ vmSettings: UI_I_VmSettings | null
165
184
  nodes: UI_I_FileTreeNode[]
166
185
  files: UI_I_FileTreeNode[]
167
186
  networksTable: UI_I_NetworkTableItem[]
@@ -258,9 +277,6 @@ watch(
258
277
  { deep: true, immediate: true }
259
278
  )
260
279
 
261
- const cpuModels = ref<UI_I_OptionItem[]>(capabilities.value.cpuModels)
262
- const maxMemory = ref<number>(capabilities.value.maxMemory)
263
-
264
280
  const wizard: Wizard = new Wizard(
265
281
  stepsFunc(localization.value),
266
282
  stepsSchemeInitial
@@ -561,14 +577,23 @@ const checkCustomizeHardware = async (
561
577
  }
562
578
 
563
579
  const vmForm = ref<UI_I_VmForm>({
580
+ name: '',
581
+ compatibility: '',
582
+ guestMachineType: null,
583
+ guestOsFamily: null,
584
+ guestOsVersion: null,
585
+ computeResource: props.computeResource,
586
+ storage: null,
564
587
  locationPath: '',
565
588
  dataCenter: null,
589
+ options: [],
566
590
  })
567
591
 
568
592
  const isLoadingComputeTree = ref<boolean>(false)
569
593
  const onChangeName = (data: [string, UI_I_TreeNode | null]): void => {
570
- const [_name, node] = data
571
- // vmForm.value.name = name
594
+ const [name, node] = data
595
+
596
+ vmForm.value.name = name
572
597
  if (isSphere.value) {
573
598
  vmForm.value.locationPath = node.id
574
599
  vmForm.value.dataCenter = $recursion.findParentByValue(
@@ -589,11 +614,10 @@ const onChangeName = (data: [string, UI_I_TreeNode | null]): void => {
589
614
  const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
590
615
  if (!storage) return
591
616
 
592
- // vmForm.value.storage = storage
593
- model.value.storage = storage
617
+ vmForm.value.storage = storage
594
618
  }
595
619
  const onChangeSelectOptions = (options: string[]): void => {
596
- // vmForm.value.options = options
620
+ vmForm.value.options = options
597
621
  if (
598
622
  options.includes('customize-os') &&
599
623
  options.includes('customize-hardware')
@@ -618,13 +642,46 @@ const onChangeSelectOptions = (options: string[]): void => {
618
642
  // Change power on by default
619
643
  isPowerOnByDefault.value = options.includes('power-on')
620
644
  }
645
+ const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
646
+ const onChangeCustomizeHardware = (
647
+ data: UI_I_SendDataCustomizeHardware
648
+ ): void => {
649
+ customizeHardware.value = data
650
+ }
651
+
652
+ const virtualHardwareHardDisksLocal = computed<
653
+ UI_I_SendDataNewHardDisk[] | null
654
+ >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
655
+ const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
656
+ () => customizeHardware.value?.virtualHardware?.networks || null
657
+ )
658
+ const virtualHardwareCdDvdDrivesLocal = computed<
659
+ UI_I_SendDataNewCdDvdDrive[] | null
660
+ >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
661
+
662
+ const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
663
+ () => customizeHardware.value?.virtualHardware?.cpu || null
664
+ )
665
+ const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
666
+ () => customizeHardware.value?.virtualHardware?.memory || null
667
+ )
668
+ const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
669
+ const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
670
+ null
671
+ )
672
+ const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
673
+ const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
674
+ virtualHardwareHardDisks.value = data[0]
675
+ virtualHardwareCdDvdDrives.value = data[1]
676
+ virtualHardwareNetworks.value = data[2]
677
+ }
678
+
621
679
  const isPowerOnByDefault = ref<boolean>(false)
622
680
 
623
681
  watch(
624
682
  () => props.vmNameInWizard,
625
683
  (newValue) => {
626
- // vmForm.value.name = newValue
627
- model.value.name = newValue
684
+ vmForm.value.name = newValue
628
685
  }
629
686
  )
630
687
 
@@ -635,12 +692,18 @@ const validateSendData = async (
635
692
  let stepHasError = false
636
693
 
637
694
  const data = await props.validateSendDataFunc(
638
- model.value,
695
+ vmForm.value,
696
+ virtualHardwareCpu.value,
697
+ virtualHardwareMemory.value,
698
+ customizeHardware.value,
699
+ virtualHardwareNetworks.value,
700
+ virtualHardwareHardDisks.value,
701
+ virtualHardwareCdDvdDrives.value,
639
702
  isPowerOnByDefault.value,
640
703
  localization.value,
641
704
  vmForm.value.locationPath, // для сферы
642
705
  // computeResourcePath.value // для сферы
643
- model.value.host_id // для сферы // TODO rollback
706
+ vmSettings.value.host_id // для сферы // TODO rollback
644
707
  )
645
708
 
646
709
  wizard.setLoader(false)
@@ -661,12 +724,18 @@ const onFinish = (): void => {
661
724
  wizard.setLoader(false)
662
725
  props
663
726
  .finishFunc(
664
- model.value,
727
+ vmForm.value,
728
+ virtualHardwareCpu.value,
729
+ virtualHardwareMemory.value,
730
+ customizeHardware.value,
731
+ virtualHardwareNetworks.value,
732
+ virtualHardwareHardDisks.value,
733
+ virtualHardwareCdDvdDrives.value,
665
734
  isPowerOnByDefault.value,
666
735
  localization.value,
667
736
  vmForm.value.locationPath, // для сферы
668
737
  // computeResourcePath.value, // для сферы
669
- model.value.host_id, // для сферы // TODO rollback
738
+ vmSettings.value.host_id, // для сферы // TODO rollback
670
739
  false,
671
740
  schedulerTaskForm.value,
672
741
  props.schedulerTask
@@ -684,6 +753,9 @@ const nameFormSubmit = ref<null | Function>(null)
684
753
  const storageSubmit = ref<null | Function>(null)
685
754
  const customizeHardwareSubmit = ref<null | Function>(null)
686
755
 
756
+ const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
757
+ const vmName = ref<string>(vmSettings.value?.name || '')
758
+
687
759
  const guestOsFamilies = ref<UI_I_OptionItem[]>(
688
760
  capabilities.value.guestOsFamilies
689
761
  )
@@ -708,26 +780,26 @@ watch(
708
780
  { deep: true, immediate: true }
709
781
  )
710
782
 
711
- // watch(vmSettings, (newValue) => {
712
- // vmName.value = newValue?.name || ''
713
- //
714
- // if (newValue?.guestOsFamily)
715
- // vmForm.value.guestOsFamily = newValue.guestOsFamily
716
- // if (newValue?.guestMachineType)
717
- // vmForm.value.guestMachineType = newValue.guestMachineType
718
- // if (newValue?.guestOsVersion)
719
- // vmForm.value.guestOsVersion = newValue.guestOsVersion
720
- //
721
- // if (newValue?.compatibility)
722
- // vmForm.value.compatibility = newValue.compatibility
723
- //
724
- // if (newValue?.storage) {
725
- // const datastore = props.datastore.find(
726
- // (item) => item.id === newValue.storage.id
727
- // )
728
- // if (datastore) vmForm.value.storage = datastore
729
- // }
730
- // })
783
+ watch(vmSettings, (newValue) => {
784
+ vmName.value = newValue?.name || ''
785
+
786
+ if (newValue?.guestOsFamily)
787
+ vmForm.value.guestOsFamily = newValue.guestOsFamily
788
+ if (newValue?.guestMachineType)
789
+ vmForm.value.guestMachineType = newValue.guestMachineType
790
+ if (newValue?.guestOsVersion)
791
+ vmForm.value.guestOsVersion = newValue.guestOsVersion
792
+
793
+ if (newValue?.compatibility)
794
+ vmForm.value.compatibility = newValue.compatibility
795
+
796
+ if (newValue?.storage) {
797
+ const datastore = props.datastore.find(
798
+ (item) => item.id === newValue.storage.id
799
+ )
800
+ if (datastore) vmForm.value.storage = datastore
801
+ }
802
+ })
731
803
 
732
804
  const onHideModal = (): void => {
733
805
  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)"
@@ -146,9 +146,9 @@
146
146
  </template>
147
147
  <template #content>
148
148
  <common-vm-actions-common-select-os
149
- v-model:guest-os-family="model.guest_os_family"
150
- v-model:guest-os-version="model.guest_os_version"
151
- v-model:machine-type="model.machine_type"
149
+ v-model:machine-type="vmForm.guestMachineType"
150
+ v-model:guest-os-family="vmForm.guestOsFamily"
151
+ v-model:guest-os-version="vmForm.guestOsVersion"
152
152
  :families-options="props.guestOsFamilies"
153
153
  :versions-options="props.guestOsVersions"
154
154
  :machine-types-options="props.machineTypes"
@@ -163,12 +163,31 @@
163
163
  >
164
164
  <template #content>
165
165
  <common-vm-actions-common-customize-hardware
166
- v-model="model"
167
- :storage="model.storage"
166
+ v-model:vm-name="vmName"
167
+ v-model:guest-machine-type="props.vmSettings.guestMachineType"
168
+ v-model:guest-os-family="props.vmSettings.guestOsFamily"
169
+ v-model:guest-os-version="props.vmSettings.guestOsVersion"
170
+ :storage="vmForm.storage"
171
+ :hard-disks-for-boot-options="props.virtualHardwareHardDisksLocal"
172
+ :cd-dvd-drives-for-boot-options="
173
+ props.virtualHardwareCdDvdDrivesLocal
174
+ "
175
+ :networks-for-boot-options="props.virtualHardwareNetworksLocal"
176
+ :cd-dvd-drives="props.vmSettings.cdDvdDrives"
177
+ :hard-disks="props.vmSettings.hardDisks"
178
+ :networks="props.vmSettings.networks"
168
179
  :customize-hardware-submit="props.customizeHardwareSubmit"
169
- :max-memory="props.maxMemory"
170
- :cpu-models="props.cpuModels"
180
+ :max-cpus="props.vmSettings.maxCpus"
181
+ :max-memory="props.vmSettings.maxMemory"
182
+ :cpu-models="props.vmSettings.cpuModels"
183
+ :cpu="props.vmSettings.cpu"
184
+ :memory="props.vmSettings.memory"
185
+ :video-card="props.vmSettings.videoCard"
186
+ :usb-controller="props.vmSettings.usbController"
187
+ :pci-devices="props.vmSettings.pciDevices"
171
188
  :selected-nav-item="props.selectedNavItem"
189
+ :hard-disks-for-edit="props.vmSettings.hardDisks"
190
+ :options="props.vmSettings.options"
172
191
  :nodes="props.nodes"
173
192
  :files="props.files"
174
193
  :networks-table="props.networksTable"
@@ -181,6 +200,8 @@
181
200
  :is-datastore-loading="props.isDatastoreLoading"
182
201
  :project="props.project"
183
202
  is-clone
203
+ @change-boot-order="emits('change-boot-order', $event)"
204
+ @send-data="emits('change-customize-hardware', $event)"
184
205
  @get-storage="emits('get-storage', $event)"
185
206
  @get-folders-or-files="emits('get-folders-or-files', $event)"
186
207
  @get-active-device-child="emits('get-active-device-child', $event)"
@@ -271,12 +292,19 @@ import type {
271
292
  UI_I_ArbitraryObject,
272
293
  UI_I_Localization,
273
294
  } from '~/lib/models/interfaces'
295
+ import type {
296
+ UI_I_SendDataNewCdDvdDrive,
297
+ UI_I_SendDataNewHardDisk,
298
+ UI_I_SendDataNewNetwork,
299
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
300
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
274
301
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
302
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
275
303
  import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
276
304
  import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
277
305
  import type { UI_I_NameTestIds } from '~/components/common/wizards/common/steps/name/lib/models/interfaces'
278
306
  import type { UI_T_Project } from '~/lib/models/types'
279
- import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
307
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/common/lib/models/interfaces'
280
308
  import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
281
309
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
282
310
  import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
@@ -285,6 +313,7 @@ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interface
285
313
  import type {
286
314
  UI_I_MediatedDevice,
287
315
  UI_I_PciDevice,
316
+ UI_I_VmSettings,
288
317
  } from '~/lib/models/store/vm/interfaces'
289
318
  import type {
290
319
  UI_I_DatastoreTableItem,
@@ -293,11 +322,11 @@ import type {
293
322
  import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
294
323
  import type { UI_T_CompatibilityStatus } from '~/components/common/wizards/common/compatibility/lib/models/types'
295
324
 
296
- const model = defineModel<UI_I_CreateVmData>({ required: true })
297
-
325
+ const vmForm = defineModel<UI_I_VmForm>('vm-form')
298
326
  const schedulerTaskForm = defineModel<UI_I_ScheduleNewTasksForm>(
299
327
  'scheduler-task-form'
300
328
  )
329
+ const vmName = defineModel<string>('vm-name')
301
330
  const computeResource = defineModel<UI_I_TreeNode | undefined>(
302
331
  'compute-resource'
303
332
  )
@@ -305,6 +334,7 @@ const location = defineModel<UI_I_TreeNode | null>('location')
305
334
  const props = withDefaults(
306
335
  defineProps<{
307
336
  project: UI_T_Project
337
+ vmSettings: UI_I_VmSettings | null
308
338
  nodes: UI_I_FileTreeNode[]
309
339
  files: UI_I_FileTreeNode[]
310
340
  networksTable: UI_I_NetworkTableItem[]
@@ -332,11 +362,12 @@ const props = withDefaults(
332
362
  isSphere: boolean
333
363
  locationDescription: string
334
364
  nameTestIds: UI_I_NameTestIds
365
+ virtualHardwareHardDisksLocal: UI_I_SendDataNewHardDisk[] | null
366
+ virtualHardwareNetworksLocal: UI_I_SendDataNewNetwork[] | null
367
+ virtualHardwareCdDvdDrivesLocal: UI_I_SendDataNewCdDvdDrive[] | null
335
368
  guestOsFamilies: UI_I_OptionItem[]
336
369
  guestOsVersions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
337
370
  machineTypes: UI_I_OptionItem[]
338
- maxMemory: number
339
- cpuModels: UI_I_OptionItem[]
340
371
  dynamicSteps: UI_I_ArbitraryObject<number>
341
372
  isLoadingComputeTree?: boolean // для сферы
342
373
  computeResourceAlert?: string[] // для сферы
@@ -361,6 +392,11 @@ const emits = defineEmits<{
361
392
  (event: 'change-name', value: [string, UI_I_TreeNode | null]): void
362
393
  (event: 'change-storage', value: UI_I_DatastoreTableItem | null): void
363
394
  (event: 'change-select-options', value: string[]): void
395
+ (event: 'change-boot-order', value: UI_T_ChangeBootOrder): void
396
+ (
397
+ event: 'change-customize-hardware',
398
+ value: UI_I_SendDataCustomizeHardware
399
+ ): void
364
400
  (event: 'hide'): void
365
401
  (event: 'finish'): void
366
402
  }>()
@@ -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
  />
@@ -78,9 +78,9 @@
78
78
  v-show="
79
79
  selectedStep.id === props.dynamicSteps.selectGuestOSMachineType
80
80
  "
81
- v-model:guest-os-family="model.guest_os_family"
82
- v-model:guest-os-version="model.guest_os_version"
83
- v-model:machine-type="model.machine_type"
81
+ v-model:machine-type="vmForm.guestMachineType"
82
+ v-model:guest-os-family="vmForm.guestOsFamily"
83
+ v-model:guest-os-version="vmForm.guestOsVersion"
84
84
  :families-options="props.guestOsFamilies"
85
85
  :versions-options="props.guestOsVersions"
86
86
  :machine-types-options="props.machineTypes"
@@ -89,12 +89,31 @@
89
89
  />
90
90
  <common-vm-actions-common-customize-hardware
91
91
  v-show="selectedStep.id === props.dynamicSteps.customizeHardware"
92
- v-model="model"
93
- :storage="model.storage"
92
+ v-model:vm-name="vmName"
93
+ v-model:guest-machine-type="props.vmSettings.guestMachineType"
94
+ v-model:guest-os-family="props.vmSettings.guestOsFamily"
95
+ v-model:guest-os-version="props.vmSettings.guestOsVersion"
96
+ :storage="vmForm.storage"
97
+ :hard-disks-for-boot-options="props.virtualHardwareHardDisksLocal"
98
+ :cd-dvd-drives-for-boot-options="
99
+ props.virtualHardwareCdDvdDrivesLocal
100
+ "
101
+ :networks-for-boot-options="props.virtualHardwareNetworksLocal"
102
+ :cd-dvd-drives="props.vmSettings.cdDvdDrives"
103
+ :hard-disks="props.vmSettings.hardDisks"
104
+ :networks="props.vmSettings.networks"
94
105
  :customize-hardware-submit="props.customizeHardwareSubmit"
95
- :max-memory="props.maxMemory"
96
- :cpu-models="props.cpuModels"
106
+ :max-cpus="props.vmSettings.maxCpus"
107
+ :max-memory="props.vmSettings.maxMemory"
108
+ :cpu-models="props.vmSettings.cpuModels"
109
+ :cpu="props.vmSettings.cpu"
110
+ :memory="props.vmSettings.memory"
111
+ :video-card="props.vmSettings.videoCard"
112
+ :usb-controller="props.vmSettings.usbController"
113
+ :pci-devices="props.vmSettings.pciDevices"
97
114
  :selected-nav-item="props.selectedNavItem"
115
+ :hard-disks-for-edit="props.vmSettings.hardDisks"
116
+ :options="props.vmSettings.options"
98
117
  :nodes="props.nodes"
99
118
  :files="props.files"
100
119
  :networks-table="props.networksTable"
@@ -107,6 +126,8 @@
107
126
  :is-datastore-loading="props.isDatastoreLoading"
108
127
  :project="props.project"
109
128
  is-clone
129
+ @change-boot-order="emits('change-boot-order', $event)"
130
+ @send-data="emits('change-customize-hardware', $event)"
110
131
  @get-storage="emits('get-storage', $event)"
111
132
  @get-folders-or-files="emits('get-folders-or-files', $event)"
112
133
  @get-active-device-child="emits('get-active-device-child', $event)"
@@ -138,26 +159,34 @@ import type {
138
159
  UI_I_ArbitraryObject,
139
160
  UI_I_Localization,
140
161
  } from '~/lib/models/interfaces'
162
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
141
163
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
164
+ import type {
165
+ UI_I_SendDataNewCdDvdDrive,
166
+ UI_I_SendDataNewHardDisk,
167
+ UI_I_SendDataNewNetwork,
168
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
142
169
  import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
143
170
  import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
171
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
144
172
  import type { UI_T_Project } from '~/lib/models/types'
145
173
  import type {
146
174
  UI_I_MediatedDevice,
147
175
  UI_I_PciDevice,
176
+ UI_I_VmSettings,
148
177
  } from '~/lib/models/store/vm/interfaces'
149
178
  import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
150
179
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
151
180
  import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
152
181
  import type { UI_I_NameTestIds } from '~/components/common/wizards/common/steps/name/lib/models/interfaces'
153
- import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
182
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/common/lib/models/interfaces'
154
183
  import type { UI_T_CompatibilityStatus } from '~/components/common/wizards/common/compatibility/lib/models/types'
155
184
 
156
- const model = defineModel<UI_I_CreateVmData>({ required: true })
157
-
185
+ const vmForm = defineModel<UI_I_VmForm>('vm-form')
158
186
  const schedulerTaskForm = defineModel<UI_I_ScheduleNewTasksForm>(
159
187
  'scheduler-task-form'
160
188
  )
189
+ const vmName = defineModel<string>('vm-name')
161
190
  const computeResource = defineModel<UI_I_TreeNode | undefined>(
162
191
  'compute-resource'
163
192
  )
@@ -165,6 +194,7 @@ const location = defineModel<UI_I_TreeNode | null>('location')
165
194
  const props = withDefaults(
166
195
  defineProps<{
167
196
  project: UI_T_Project
197
+ vmSettings: UI_I_VmSettings | null
168
198
  nodes: UI_I_FileTreeNode[]
169
199
  files: UI_I_FileTreeNode[]
170
200
  networksTable: UI_I_NetworkTableItem[]
@@ -192,11 +222,12 @@ const props = withDefaults(
192
222
  isSphere: boolean
193
223
  locationDescription: string
194
224
  nameTestIds: UI_I_NameTestIds
225
+ virtualHardwareHardDisksLocal: UI_I_SendDataNewHardDisk[] | null
226
+ virtualHardwareNetworksLocal: UI_I_SendDataNewNetwork[] | null
227
+ virtualHardwareCdDvdDrivesLocal: UI_I_SendDataNewCdDvdDrive[] | null
195
228
  guestOsFamilies: UI_I_OptionItem[]
196
229
  guestOsVersions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
197
230
  machineTypes: UI_I_OptionItem[]
198
- maxMemory: number
199
- cpuModels: UI_I_OptionItem[]
200
231
  dynamicSteps: UI_I_ArbitraryObject<number>
201
232
  isLoading: boolean
202
233
  isLoadingComputeTree?: boolean // для сферы
@@ -222,6 +253,11 @@ const emits = defineEmits<{
222
253
  (event: 'change-name', value: [string, UI_I_TreeNode | null]): void
223
254
  (event: 'change-storage', value: UI_I_DatastoreTableItem | null): void
224
255
  (event: 'change-select-options', value: string[]): void
256
+ (event: 'change-boot-order', value: UI_T_ChangeBootOrder): void
257
+ (
258
+ event: 'change-customize-hardware',
259
+ value: UI_I_SendDataCustomizeHardware
260
+ ): void
225
261
  (event: 'hide'): void
226
262
  (event: 'finish'): void
227
263
  }>()