bfg-common 1.3.239 → 1.3.240

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 (185) hide show
  1. package/components/atoms/switch/Switch.vue +111 -111
  2. package/components/atoms/table/compact/Compact.vue +526 -526
  3. package/components/common/BadBrowser.vue +16 -12
  4. package/components/common/accordion/Accordion.vue +1 -0
  5. package/components/common/accordion/Recursion.vue +2 -0
  6. package/components/common/accordion/lib/models/interfaces.ts +1 -0
  7. package/components/common/adapterManager/AddAdapterModal.vue +8 -5
  8. package/components/common/adapterManager/AddAdapterWarningModal.vue +1 -0
  9. package/components/common/adapterManager/ui/actions/AddAdapterButton.vue +2 -0
  10. package/components/common/adapterManager/ui/actions/MoveDownAdapterButton.vue +2 -0
  11. package/components/common/adapterManager/ui/actions/MoveUpAdapterButton.vue +2 -0
  12. package/components/common/adapterManager/ui/actions/RemoveAdapterButton.vue +2 -0
  13. package/components/common/adapterManager/ui/table/Adapters.vue +14 -13
  14. package/components/common/adapterManager/ui/table/Header.vue +6 -4
  15. package/components/common/adapterManager/ui/table/Table.vue +13 -4
  16. package/components/common/browse/Browse.vue +5 -1
  17. package/components/common/browse/blocks/Container.vue +3 -0
  18. package/components/common/browse/blocks/contents/Files.vue +1 -0
  19. package/components/common/context/ContextRecursion.vue +6 -1
  20. package/components/common/details/DetailsItem.vue +3 -0
  21. package/components/common/diagramMain/Header.vue +4 -0
  22. package/components/common/diagramMain/adapter/AdapterItem.vue +2 -0
  23. package/components/common/diagramMain/adapter/Contents.vue +2 -0
  24. package/components/common/diagramMain/lib/models/interfaces.ts +1 -0
  25. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +1 -0
  26. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +13 -27
  27. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +1 -0
  28. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +3 -0
  29. package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +8 -0
  30. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +6 -0
  31. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +2 -0
  32. package/components/common/diagramMain/modals/lib/config/networkModal.ts +4 -0
  33. package/components/common/diagramMain/modals/lib/config/portModal.ts +7 -2
  34. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +19 -13
  35. package/components/common/diagramMain/modals/remove/RemoveModal.vue +5 -0
  36. package/components/common/diagramMain/modals/viewSettings/ViewSettings.vue +11 -7
  37. package/components/common/diagramMain/network/Contents.vue +5 -4
  38. package/components/common/diagramMain/port/Port.vue +1 -0
  39. package/components/common/feedback/Buttons.vue +2 -0
  40. package/components/common/feedback/Feedback.vue +9 -2
  41. package/components/common/feedback/Message.vue +9 -0
  42. package/components/common/feedback/VisitPortal.vue +11 -2
  43. package/components/common/help/navbar/left/Left.vue +1 -0
  44. package/components/common/help/navbar/right/Right.vue +12 -2
  45. package/components/common/help/navbar/right/lib/models/interfaces.ts +1 -0
  46. package/components/common/home/alertsTable/AlertsTable.vue +1 -0
  47. package/components/common/modals/Confirmation.vue +10 -2
  48. package/components/common/modals/Rename.vue +1 -0
  49. package/components/common/monitor/advanced/tools/Tools.vue +10 -1
  50. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/Actions.vue +7 -1
  51. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/saveOptionsModal/SaveOptionsModal.vue +6 -1
  52. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/Form.vue +14 -1
  53. package/components/common/monitor/overview/filters/Filters.vue +12 -5
  54. package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +4 -0
  55. package/components/common/pages/Tasks.vue +120 -120
  56. package/components/common/perPage/PerPage.vue +1 -0
  57. package/components/common/recursionTree/RecursionTree.vue +205 -203
  58. package/components/common/recursionTree/lib/models/interfaces.ts +4 -2
  59. package/components/common/select/button/ButtonDropdown.vue +2 -0
  60. package/components/common/select/button/lib/models/interfaces.ts +1 -0
  61. package/components/common/select/input/Input.vue +1 -0
  62. package/components/common/select/radio/RadioGroup.vue +2 -0
  63. package/components/common/select/radio/lib/models/interfaces.ts +1 -0
  64. package/components/common/shortcuts/Block.vue +2 -0
  65. package/components/common/shortcuts/Category.vue +1 -0
  66. package/components/common/shortcuts/lib/models/interfaces.ts +1 -0
  67. package/components/common/spiceConsole/Drawer.vue +4 -0
  68. package/components/common/spiceConsole/keyboard/Keyboard.vue +1 -0
  69. package/components/common/spiceConsole/keyboard/lib/config/keyboardRows.ts +81 -6
  70. package/components/common/spiceConsole/keyboard/lib/models/interfaces.ts +1 -0
  71. package/components/common/split/horizontal/Horizontal.vue +1 -0
  72. package/components/common/vm/actions/add/Add.vue +576 -575
  73. package/components/common/vm/actions/clone/Clone.vue +518 -518
  74. package/components/common/vm/actions/clone/select/options/Options.vue +9 -3
  75. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +269 -269
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +693 -693
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +5 -1
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +7 -2
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +2 -0
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +1 -0
  81. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuHotPlug.vue +1 -0
  82. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuModel.vue +225 -220
  83. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Hv.vue +2 -0
  84. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Iommu.vue +1 -0
  85. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Pc.vue +1 -0
  86. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Sa.vue +2 -0
  87. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +5 -1
  88. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/Tooltip.vue +1 -0
  89. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +59 -59
  90. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +2 -1
  91. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +1 -0
  92. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryHotPlug.vue +1 -0
  93. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/Location.vue +6 -6
  94. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +5 -6
  95. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +1 -0
  96. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +1 -0
  97. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/Mode.vue +1 -0
  98. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +1 -0
  99. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/Sharing.vue +1 -0
  100. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/Location.vue +2 -0
  101. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +295 -294
  102. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +1 -0
  103. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +12 -4
  104. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +165 -165
  105. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +5 -1
  106. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +2 -1
  107. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelection.vue +2 -1
  108. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +1 -0
  109. package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/Reservation.vue +3 -1
  110. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/Graphics.vue +6 -1
  111. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/TotalVideoMemory.vue +2 -1
  112. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +1 -0
  113. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/Model.vue +1 -0
  114. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +1 -0
  115. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/Menu.vue +6 -1
  116. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/Secure.vue +6 -1
  117. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +5 -1
  118. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +1 -0
  119. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +5 -1
  120. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/lib/models/interfaces.ts +1 -0
  121. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +4 -1
  122. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/CopyPaste.vue +1 -0
  123. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/FileTransfer.vue +1 -0
  124. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/FolderSharing.vue +1 -0
  125. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/PlaybackCompression.vue +1 -0
  126. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/PowerControl.vue +1 -0
  127. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/ImgCompression.vue +1 -0
  128. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/JpegCompression.vue +1 -0
  129. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +2 -1
  130. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/MouseMode.vue +6 -1
  131. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +7 -1
  132. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/SharePolicy.vue +5 -1
  133. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +1 -0
  134. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/type/Type.vue +1 -0
  135. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +2 -1
  136. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/ZlibCompression.vue +1 -0
  137. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +6 -1
  138. package/components/common/vm/actions/common/select/compatibility/Compatibility.vue +31 -27
  139. package/components/common/vm/actions/common/select/name/Name.vue +7 -1
  140. package/components/common/vm/actions/common/select/os/os.vue +7 -1
  141. package/components/common/vm/actions/common/select/storage/lib/config/config.ts +166 -166
  142. package/components/common/vm/actions/editSettings/EditSettings.vue +313 -313
  143. package/components/common/weekSelect/WeekSelect.vue +143 -112
  144. package/components/common/weekSelect/lib/config/options.ts +10 -10
  145. package/components/common/weekSelect/lib/models/interfaces.ts +1 -0
  146. package/components/common/wizards/datastore/add/local/createName/CreateName.vue +1 -0
  147. package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +8 -7
  148. package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +9 -1
  149. package/components/common/wizards/datastore/add/nfs/configuration/serversList/DeletePopover.vue +6 -3
  150. package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +1 -0
  151. package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/lib/config/radioOptions.ts +3 -0
  152. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/DeviceSelection.vue +2 -0
  153. package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +2 -0
  154. package/components/common/wizards/datastore/add/types/Types.vue +1 -0
  155. package/components/common/wizards/network/add/modals/SelectNetwork.vue +16 -3
  156. package/components/common/wizards/network/add/modals/SelectStandardSwitch.vue +10 -2
  157. package/components/common/wizards/network/add/modals/SelectSwitch.vue +10 -2
  158. package/components/common/wizards/network/add/steps/ConnectionSettings.vue +5 -1
  159. package/components/common/wizards/network/add/steps/IpFourSettings.vue +12 -2
  160. package/components/common/wizards/network/add/steps/PortProperties.vue +16 -3
  161. package/components/common/wizards/network/add/steps/SelectConnectionType.vue +6 -3
  162. package/components/common/wizards/network/add/steps/SelectedTargetDevice.vue +11 -0
  163. package/components/common/wizards/vm/common/tooltip/Tooltip.vue +2 -0
  164. package/components/common/wizards/vm/migrate/select/network/Network.vue +1 -0
  165. package/components/common/wizards/vm/migrate/select/network/table/network/Network.vue +1 -0
  166. package/components/common/wizards/vm/migrate/select/storage/Storage.vue +5 -1
  167. package/components/common/wizards/vm/migrate/select/storage/configure/disk/Disk.vue +1 -0
  168. package/components/common/wizards/vm/migrate/select/storage/diskFormat/DiskFormat.vue +1 -0
  169. package/components/common/wizards/vm/migrate/select/storage/policy/Policy.vue +1 -0
  170. package/components/common/wizards/vm/migrate/select/storage/selectedPerDisk/SelectedPerDisk.vue +1 -0
  171. package/components/common/wizards/vm/migrate/select/targetServer/new/New.vue +9 -1
  172. package/composables/useAppVersion.ts +21 -21
  173. package/composables/useEnvLanguage.ts +20 -20
  174. package/lib/utils/sendTask.ts +72 -72
  175. package/minify.js +146 -146
  176. package/package.json +1 -1
  177. package/public/spice-console/application/codec.js +257 -257
  178. package/public/spice-console/lib/rasterEngine.js +907 -907
  179. package/public/spice-console/network/spicechannel.js +369 -369
  180. package/store/main/lib/interfaces.ts +9 -9
  181. package/store/tasks/actions.ts +133 -133
  182. package/store/tasks/getters.ts +25 -25
  183. package/store/tasks/lib/models/interfaces.ts +18 -18
  184. package/store/tasks/mutations.ts +58 -58
  185. package/store/tasks/state.ts +16 -16
@@ -1,518 +1,518 @@
1
- <template>
2
- <div class="clone-vm">
3
- <atoms-wizard
4
- show
5
- :steps="wizard.steps"
6
- :selected-scheme="selectedScheme"
7
- :is-loading="wizard.wizardLoader.status"
8
- :loader-messages="wizard.wizardLoader.messages"
9
- :title="localization.cloneExistingVirtualMachine"
10
- :was-completed="wasCompleted"
11
- :localization="localization"
12
- @change-steps="onChangeSteps"
13
- @hide="onHideModal"
14
- @submit="onFinish"
15
- >
16
- <template #modalBody="{ selectedStep }">
17
- <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
- :show="selectedStep.id === 0"
22
- :name-form-submit="nameFormSubmit"
23
- :project="props.project"
24
- @submit="onChangeName(...$event)"
25
- @check-name="emits('check-name', $event)"
26
- />
27
- <common-vm-actions-common-select-storage
28
- v-show="selectedStep.id === 1"
29
- :storage-submit="storageSubmit"
30
- :datastore="props.datastore"
31
- :storage="vmSettings.storage"
32
- :get-datastore-table-func="props.getDatastoreTableFunc"
33
- @submit="onChangeStorage"
34
- />
35
- <common-vm-actions-clone-select-options
36
- v-show="selectedStep.id === 2"
37
- :select-options-submit="selectOptionsSubmit"
38
- @submit="onChangeSelectOptions"
39
- />
40
- <common-vm-actions-common-customize-hardware
41
- v-show="selectedStep.id === 3"
42
- v-model:vm-name="vmName"
43
- v-model:guest-machine-type="vmSettings.guestMachineType"
44
- v-model:guest-os-family="vmSettings.guestOsFamily"
45
- v-model:guest-os-version="vmSettings.guestOsVersion"
46
- :storage="vmSettings.storage"
47
- :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
48
- :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
49
- :networks-for-boot-options="virtualHardwareNetworksLocal"
50
- :cd-dvd-drives="vmSettings.cdDvdDrives"
51
- :hard-disks="vmSettings.hardDisks"
52
- :networks="vmSettings.networks"
53
- :customize-hardware-submit="customizeHardwareSubmit"
54
- :max-cpus="vmSettings.maxCpus"
55
- :max-memory="vmSettings.maxMemory"
56
- :cpu-models="vmSettings.cpuModels"
57
- :cpu="vmSettings.cpu"
58
- :memory="vmSettings.memory"
59
- :video-card="vmSettings.videoCard"
60
- :usb-controller="vmSettings.usbController"
61
- :pci-devices="vmSettings.pciDevices"
62
- :selected-nav-item="selectedNavItem"
63
- :hard-disks-for-edit="vmSettings.hardDisks"
64
- :options="vmSettings.options"
65
- :nodes="props.nodes"
66
- :files="props.files"
67
- :networks-table="props.networksTable"
68
- :error-validation-fields="props.errorValidationFields"
69
- :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
70
- :passthrough-devices="props.passthroughDevices"
71
- :get-datastore-table-func="props.getDatastoreTableFunc"
72
- :datastore="props.datastore"
73
- is-clone
74
- @change-boot-order="onChangeBootOrder"
75
- @send-data="onChangeCustomizeHardware"
76
- @get-storage="emits('get-storage', $event)"
77
- @get-folders-or-files="emits('get-folders-or-files', $event)"
78
- @get-active-device-child="emits('get-active-device-child', $event)"
79
- @show-datastore-child="emits('show-datastore-child', $event)"
80
- @get-networks-table="emits('get-networks-table', $event)"
81
- @get-pci-devices="emits('get-pci-devices')"
82
- />
83
- <common-vm-actions-common-ready-to-complete
84
- v-show="selectedStep.id === 4"
85
- :ready-complete-table-info="props.readyCompleteTableInfo"
86
- />
87
- </div>
88
- </template>
89
- </atoms-wizard>
90
- </div>
91
- </template>
92
-
93
- <script setup lang="ts">
94
- import type {
95
- UI_I_DatastoreTableItem,
96
- UI_I_FolderOrFileTreePayload,
97
- } from '~/lib/models/store/storage/interfaces'
98
- import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
99
- import type {
100
- API_UI_I_Error,
101
- } from '~/lib/models/store/interfaces'
102
- import type {
103
- UI_I_TablePayload,
104
- } from '~/lib/models/table/interfaces'
105
- import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
106
- import type { UI_I_Localization } from '~/lib/models/interfaces'
107
- import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
108
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
109
- import type {
110
- UI_I_SendDataCpu,
111
- UI_I_SendDataMemory,
112
- UI_I_SendDataNewCdDvdDrive,
113
- UI_I_SendDataNewHardDisk,
114
- UI_I_SendDataNewNetwork,
115
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
116
- import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
117
- import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
118
- import type { UI_I_ConfigurePciDevicesTable } from '~/lib/models/store/host/interfaces'
119
- import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
120
- import type { UI_T_Project } from '~/lib/models/types'
121
- import type { UI_I_VmSettings } from '~/lib/models/store/vm/interfaces'
122
- import type { UI_I_VmForm } from '~/components/common/vm/actions/clone/lib/models/interfaces'
123
- import {
124
- UI_I_ValidationReturn,
125
- UI_I_WizardStep,
126
- } from '~/components/atoms/wizard/lib/models/interfaces'
127
- import {
128
- stepsSchemeInitial,
129
- stepsFunc,
130
- } from '~/components/common/vm/actions/clone/lib/config/steps'
131
- import Wizard from '~/components/atoms/wizard/lib/utils/utils'
132
-
133
- const props = defineProps<{
134
- project: UI_T_Project
135
- vmSettings: UI_I_VmSettings | null
136
- nodes: UI_I_FileTreeNode[]
137
- files: UI_I_FileTreeNode[]
138
- networksTable: UI_I_NetworkTableItem[]
139
- datastore: UI_I_DatastoreTableItem[]
140
- errorValidationFields: UI_I_ErrorValidationField[]
141
- readyCompleteTableInfo: UI_I_TableInfoItem[]
142
- vmCpuHelpTextSecond: string
143
- finishFunc: any
144
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
145
- validateSendDataFunc: any
146
- passthroughDevices: UI_I_ConfigurePciDevicesTable | null
147
- vmNameInWizard: string
148
- }>()
149
-
150
- const emits = defineEmits<{
151
- (event: 'check-name', value: [string, (error: API_UI_I_Error) => void]): void
152
- (event: 'get-storage', value: UI_I_TablePayload): void
153
- (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
154
- (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
155
- (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
156
- (event: 'remove-error-by-title', value: string): void
157
- (event: 'get-networks-table', value: UI_I_TablePayload): void
158
- (event: 'get-pci-devices'): void
159
- (event: 'hide'): void
160
- }>()
161
-
162
- const localization = computed<UI_I_Localization>(() => useLocal())
163
-
164
- const wizard: Wizard = new Wizard(
165
- stepsFunc(localization.value),
166
- stepsSchemeInitial
167
- )
168
- const wasCompleted = computed<boolean>(() => wizard.wasCompleted())
169
- const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
170
-
171
- const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
172
- wizard.changeSteps(value, validationFunc, validateSendData)
173
- }
174
-
175
- const validationFunc = async (
176
- value: UI_I_WizardStep[],
177
- currentStep: UI_I_WizardStep,
178
- nextStep: UI_I_WizardStep
179
- ): Promise<UI_I_ValidationReturn> => {
180
- let stepHasError = false
181
- let stepShouldStop = {
182
- ifOnCurrentStep: false,
183
- ifFromAnyStep: false,
184
- stoppageStepId: -1,
185
- }
186
-
187
- wizard.setLoader(true)
188
- if (wizard.isValidateForStep(0, currentStep.id, nextStep.id)) {
189
- const nameValidation = await checkName(value)
190
-
191
- value = nameValidation.newValue
192
- stepHasError = stepHasError || nameValidation.stepHasError
193
- } else if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
194
- const storageValidation = await checkStorage(value)
195
-
196
- value = storageValidation.newValue
197
-
198
- stepHasError = stepHasError || storageValidation.stepHasError
199
- } else if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
200
- selectOptionsSubmit.value++
201
- } else if (wizard.isValidateForStep(3, currentStep.id, nextStep.id)) {
202
- const storageValidation = await checkCustomizeHardware(value)
203
-
204
- value = storageValidation.newValue
205
-
206
- stepHasError = stepHasError || storageValidation.stepHasError
207
- }
208
- wizard.setLoader(false)
209
-
210
- return {
211
- newValue: value,
212
- stepHasError,
213
- stepShouldStop,
214
- }
215
- }
216
- const checkName = async (
217
- value: UI_I_WizardStep[]
218
- ): Promise<UI_I_ValidationReturn> => {
219
- let stepHasError = false
220
-
221
- return new Promise((resolve) => {
222
- nameFormSubmit.value = (isValid: boolean) => {
223
- if (!isValid) {
224
- stepHasError = wizard.setValidation(0, 'name', {
225
- fieldMessage: 'aaa',
226
- alertMessage: 'aaa',
227
- })
228
- } else if (wizard.hasMessage(0, 'name')) {
229
- value = wizard.removeValidation(0, 'name', value)
230
- }
231
-
232
- resolve({
233
- stepHasError,
234
- newValue: value,
235
- })
236
- nameFormSubmit.value = null
237
- }
238
- })
239
- }
240
- const checkStorage = async (
241
- value: UI_I_WizardStep[]
242
- ): Promise<UI_I_ValidationReturn> => {
243
- let stepHasError = false
244
-
245
- return new Promise((resolve) => {
246
- storageSubmit.value = (isValid: boolean) => {
247
- if (!isValid) {
248
- stepHasError = wizard.setValidation(1, 'storage', {
249
- fieldMessage: 'aaa',
250
- alertMessage: 'aaa',
251
- })
252
- } else if (wizard.hasMessage(1, 'storage')) {
253
- value = wizard.removeValidation(1, 'storage', value)
254
- }
255
-
256
- resolve({
257
- stepHasError,
258
- newValue: value,
259
- })
260
- storageSubmit.value = null
261
- }
262
- })
263
- }
264
- const checkCustomizeHardware = async (
265
- value: UI_I_WizardStep[]
266
- ): Promise<UI_I_ValidationReturn> => {
267
- let stepHasError = false
268
-
269
- return new Promise((resolve) => {
270
- customizeHardwareSubmit.value = (isValid: boolean) => {
271
- if (!isValid) {
272
- stepHasError = wizard.setValidation(3, 'customizeHardware', {
273
- fieldMessage: 'aaa',
274
- alertMessage: 'aaa',
275
- })
276
- } else if (wizard.hasMessage(3, 'customizeHardware')) {
277
- value = wizard.removeValidation(3, 'customizeHardware', value)
278
- }
279
-
280
- resolve({
281
- stepHasError,
282
- newValue: value,
283
- })
284
- storageSubmit.value = null
285
- }
286
- })
287
- }
288
-
289
- const storageIdCash = ref<string | null>(null)
290
- const vmForm = ref<UI_I_VmForm>({
291
- name: '',
292
- storage: null,
293
- options: [],
294
- })
295
- const onChangeName = (name: string): void => {
296
- vmForm.value.name = name
297
- }
298
- const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
299
- if (!storage) return
300
-
301
- vmForm.value.storage = storage
302
- storageIdCash.value = storage.id
303
- }
304
- const onChangeSelectOptions = (options: string[]): void => {
305
- vmForm.value.options = options
306
- }
307
- const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
308
- const onChangeCustomizeHardware = (
309
- data: UI_I_SendDataCustomizeHardware
310
- ): void => {
311
- customizeHardware.value = data
312
- }
313
-
314
- const virtualHardwareHardDisksLocal = computed<
315
- UI_I_SendDataNewHardDisk[] | null
316
- >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
317
- const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
318
- () => customizeHardware.value?.virtualHardware?.networks || null
319
- )
320
- const virtualHardwareCdDvdDrivesLocal = computed<
321
- UI_I_SendDataNewCdDvdDrive[] | null
322
- >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
323
-
324
- const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
325
- () => customizeHardware.value?.virtualHardware?.cpu || null
326
- )
327
- const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
328
- () => customizeHardware.value?.virtualHardware?.memory || null
329
- )
330
- const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
331
- const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
332
- null
333
- )
334
- const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
335
- const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
336
- virtualHardwareHardDisks.value = data[0]
337
- virtualHardwareCdDvdDrives.value = data[1]
338
- virtualHardwareNetworks.value = data[2]
339
- }
340
-
341
- const isPowerOnByDefault = ref<boolean>(true)
342
-
343
- watch(
344
- () => props.vmNameInWizard,
345
- (newValue) => {
346
- vmForm.value.name = newValue
347
- }
348
- )
349
-
350
- const validateSendData = async (
351
- value: UI_I_WizardStep[]
352
- ): Promise<UI_I_ValidationReturn> => {
353
- wizard.setLoader(true)
354
- let stepHasError = false
355
-
356
- const data = await props.validateSendDataFunc(
357
- vmForm.value,
358
- virtualHardwareCpu.value,
359
- virtualHardwareMemory.value,
360
- customizeHardware.value,
361
- virtualHardwareNetworks.value,
362
- virtualHardwareHardDisks.value,
363
- virtualHardwareCdDvdDrives.value,
364
- isPowerOnByDefault.value,
365
- localization.value
366
- )
367
-
368
- wizard.setLoader(false)
369
- if (data) {
370
- stepHasError = true
371
- selectedNavItem.value = data[0]
372
- }
373
-
374
- return {
375
- stepHasError,
376
- newValue: value,
377
- }
378
- }
379
- const onFinish = (): void => {
380
- wizard.setLoader(false)
381
- props
382
- .finishFunc(
383
- vmForm.value,
384
- virtualHardwareCpu.value,
385
- virtualHardwareMemory.value,
386
- customizeHardware.value,
387
- virtualHardwareNetworks.value,
388
- virtualHardwareHardDisks.value,
389
- virtualHardwareCdDvdDrives.value,
390
- isPowerOnByDefault.value,
391
- localization.value
392
- )
393
- .then(() => {
394
- onHideModal()
395
- wizard.setLoader(false)
396
- })
397
- }
398
-
399
- const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
400
-
401
- const nameFormSubmit = ref<null | Function>(null)
402
- const storageSubmit = ref<null | Function>(null)
403
- const selectOptionsSubmit = ref<number>(0)
404
- const customizeHardwareSubmit = ref<null | Function>(null)
405
-
406
- const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
407
- const vmName = ref<string>(vmSettings.value?.name || '')
408
- watch(vmSettings, (newValue) => {
409
- vmName.value = newValue?.name || ''
410
- })
411
-
412
- const onHideModal = (): void => {
413
- emits('hide')
414
- }
415
- </script>
416
-
417
- <style scoped lang="scss">
418
- :deep(.has-solid.close-icon.clr-icon) {
419
- width: 20px;
420
- top: 0;
421
- }
422
- .vm-context {
423
- padding: 16px 15px 10px 10px;
424
- height: 100%;
425
- display: flex;
426
- flex-direction: column;
427
-
428
- .context-title-wrap {
429
- padding-bottom: 3px;
430
- border-bottom: 1px solid #a6a6a6;
431
-
432
- h4 {
433
- font-weight: 700;
434
- font-size: 13px;
435
- color: var(--vm-context-title);
436
- }
437
- p {
438
- font-weight: 400;
439
- font-size: 13px;
440
- color: var(--vm-context-sub-title);
441
- }
442
- }
443
-
444
- .finish-block {
445
- padding: 18px 24px 24px 24px;
446
-
447
- .add-hosts-ready-to-complete-mt-12 {
448
- margin-top: 12px;
449
-
450
- .add-hosts-ready-to-complete-bold {
451
- line-height: 18px;
452
- font-weight: 700;
453
- }
454
- }
455
- }
456
-
457
- .vm-hardware-version {
458
- align-self: flex-end;
459
- margin-top: auto;
460
- }
461
- }
462
-
463
- :deep(.modal .modal-dialog .modal-content .modal-footer) {
464
- flex: unset;
465
- height: unset;
466
- min-height: unset;
467
- }
468
- :deep(.wizard-modal-titlebar h3) {
469
- color: #000;
470
- font-size: 24px;
471
- font-weight: 200;
472
- line-height: 27px;
473
- margin: 0;
474
- padding: 0;
475
- }
476
- :deep(.clr-wizard-stepnav-item) {
477
- padding-left: 0;
478
- }
479
- :deep(.clr-wizard-stepnav
480
- .clr-wizard-stepnav-item
481
- button
482
- .clr-wizard-stepnav-link-title) {
483
- width: 189px;
484
- font-weight: 700;
485
- font-size: 13px;
486
- }
487
-
488
- #vm-wizard-notification {
489
- h3 {
490
- color: var(--global-font-color7);
491
- margin-top: 6px;
492
- }
493
- p {
494
- color: var(--global-font-color6);
495
- line-height: 16px;
496
- }
497
- }
498
-
499
- .power-on-by-default-wrap {
500
- display: flex;
501
- align-items: center;
502
-
503
- input {
504
- margin-right: 6px;
505
- }
506
- }
507
- </style>
508
-
509
- <style>
510
- :root {
511
- --vm-context-title: #333;
512
- --vm-context-sub-title: #000;
513
- }
514
- :root.dark-theme {
515
- --vm-context-title: #adbbc4;
516
- --vm-context-sub-title: #adbbc4;
517
- }
518
- </style>
1
+ <template>
2
+ <div class="clone-vm">
3
+ <atoms-wizard
4
+ show
5
+ :steps="wizard.steps"
6
+ :selected-scheme="selectedScheme"
7
+ :is-loading="wizard.wizardLoader.status"
8
+ :loader-messages="wizard.wizardLoader.messages"
9
+ :title="localization.cloneExistingVirtualMachine"
10
+ :was-completed="wasCompleted"
11
+ :localization="localization"
12
+ @change-steps="onChangeSteps"
13
+ @hide="onHideModal"
14
+ @submit="onFinish"
15
+ >
16
+ <template #modalBody="{ selectedStep }">
17
+ <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
+ :show="selectedStep.id === 0"
22
+ :name-form-submit="nameFormSubmit"
23
+ :project="props.project"
24
+ @submit="onChangeName(...$event)"
25
+ @check-name="emits('check-name', $event)"
26
+ />
27
+ <common-vm-actions-common-select-storage
28
+ v-show="selectedStep.id === 1"
29
+ :storage-submit="storageSubmit"
30
+ :datastore="props.datastore"
31
+ :storage="vmSettings.storage"
32
+ :get-datastore-table-func="props.getDatastoreTableFunc"
33
+ @submit="onChangeStorage"
34
+ />
35
+ <common-vm-actions-clone-select-options
36
+ v-show="selectedStep.id === 2"
37
+ :select-options-submit="selectOptionsSubmit"
38
+ @submit="onChangeSelectOptions"
39
+ />
40
+ <common-vm-actions-common-customize-hardware
41
+ v-show="selectedStep.id === 3"
42
+ v-model:vm-name="vmName"
43
+ v-model:guest-machine-type="vmSettings.guestMachineType"
44
+ v-model:guest-os-family="vmSettings.guestOsFamily"
45
+ v-model:guest-os-version="vmSettings.guestOsVersion"
46
+ :storage="vmSettings.storage"
47
+ :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
48
+ :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
49
+ :networks-for-boot-options="virtualHardwareNetworksLocal"
50
+ :cd-dvd-drives="vmSettings.cdDvdDrives"
51
+ :hard-disks="vmSettings.hardDisks"
52
+ :networks="vmSettings.networks"
53
+ :customize-hardware-submit="customizeHardwareSubmit"
54
+ :max-cpus="vmSettings.maxCpus"
55
+ :max-memory="vmSettings.maxMemory"
56
+ :cpu-models="vmSettings.cpuModels"
57
+ :cpu="vmSettings.cpu"
58
+ :memory="vmSettings.memory"
59
+ :video-card="vmSettings.videoCard"
60
+ :usb-controller="vmSettings.usbController"
61
+ :pci-devices="vmSettings.pciDevices"
62
+ :selected-nav-item="selectedNavItem"
63
+ :hard-disks-for-edit="vmSettings.hardDisks"
64
+ :options="vmSettings.options"
65
+ :nodes="props.nodes"
66
+ :files="props.files"
67
+ :networks-table="props.networksTable"
68
+ :error-validation-fields="props.errorValidationFields"
69
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
70
+ :passthrough-devices="props.passthroughDevices"
71
+ :get-datastore-table-func="props.getDatastoreTableFunc"
72
+ :datastore="props.datastore"
73
+ is-clone
74
+ @change-boot-order="onChangeBootOrder"
75
+ @send-data="onChangeCustomizeHardware"
76
+ @get-storage="emits('get-storage', $event)"
77
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
78
+ @get-active-device-child="emits('get-active-device-child', $event)"
79
+ @show-datastore-child="emits('show-datastore-child', $event)"
80
+ @get-networks-table="emits('get-networks-table', $event)"
81
+ @get-pci-devices="emits('get-pci-devices')"
82
+ />
83
+ <common-vm-actions-common-ready-to-complete
84
+ v-show="selectedStep.id === 4"
85
+ :ready-complete-table-info="props.readyCompleteTableInfo"
86
+ />
87
+ </div>
88
+ </template>
89
+ </atoms-wizard>
90
+ </div>
91
+ </template>
92
+
93
+ <script setup lang="ts">
94
+ import type {
95
+ UI_I_DatastoreTableItem,
96
+ UI_I_FolderOrFileTreePayload,
97
+ } from '~/lib/models/store/storage/interfaces'
98
+ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
99
+ import type {
100
+ API_UI_I_Error,
101
+ } from '~/lib/models/store/interfaces'
102
+ import type {
103
+ UI_I_TablePayload,
104
+ } from '~/lib/models/table/interfaces'
105
+ import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
106
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
107
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
108
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
109
+ import type {
110
+ UI_I_SendDataCpu,
111
+ UI_I_SendDataMemory,
112
+ UI_I_SendDataNewCdDvdDrive,
113
+ UI_I_SendDataNewHardDisk,
114
+ UI_I_SendDataNewNetwork,
115
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
116
+ import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
117
+ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
118
+ import type { UI_I_ConfigurePciDevicesTable } from '~/lib/models/store/host/interfaces'
119
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
120
+ import type { UI_T_Project } from '~/lib/models/types'
121
+ import type { UI_I_VmSettings } from '~/lib/models/store/vm/interfaces'
122
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/clone/lib/models/interfaces'
123
+ import {
124
+ UI_I_ValidationReturn,
125
+ UI_I_WizardStep,
126
+ } from '~/components/atoms/wizard/lib/models/interfaces'
127
+ import {
128
+ stepsSchemeInitial,
129
+ stepsFunc,
130
+ } from '~/components/common/vm/actions/clone/lib/config/steps'
131
+ import Wizard from '~/components/atoms/wizard/lib/utils/utils'
132
+
133
+ const props = defineProps<{
134
+ project: UI_T_Project
135
+ vmSettings: UI_I_VmSettings | null
136
+ nodes: UI_I_FileTreeNode[]
137
+ files: UI_I_FileTreeNode[]
138
+ networksTable: UI_I_NetworkTableItem[]
139
+ datastore: UI_I_DatastoreTableItem[]
140
+ errorValidationFields: UI_I_ErrorValidationField[]
141
+ readyCompleteTableInfo: UI_I_TableInfoItem[]
142
+ vmCpuHelpTextSecond: string
143
+ finishFunc: any
144
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
145
+ validateSendDataFunc: any
146
+ passthroughDevices: UI_I_ConfigurePciDevicesTable | null
147
+ vmNameInWizard: string
148
+ }>()
149
+
150
+ const emits = defineEmits<{
151
+ (event: 'check-name', value: [string, (error: API_UI_I_Error) => void]): void
152
+ (event: 'get-storage', value: UI_I_TablePayload): void
153
+ (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
154
+ (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
155
+ (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
156
+ (event: 'remove-error-by-title', value: string): void
157
+ (event: 'get-networks-table', value: UI_I_TablePayload): void
158
+ (event: 'get-pci-devices'): void
159
+ (event: 'hide'): void
160
+ }>()
161
+
162
+ const localization = computed<UI_I_Localization>(() => useLocal())
163
+
164
+ const wizard: Wizard = new Wizard(
165
+ stepsFunc(localization.value),
166
+ stepsSchemeInitial
167
+ )
168
+ const wasCompleted = computed<boolean>(() => wizard.wasCompleted())
169
+ const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
170
+
171
+ const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
172
+ wizard.changeSteps(value, validationFunc, validateSendData)
173
+ }
174
+
175
+ const validationFunc = async (
176
+ value: UI_I_WizardStep[],
177
+ currentStep: UI_I_WizardStep,
178
+ nextStep: UI_I_WizardStep
179
+ ): Promise<UI_I_ValidationReturn> => {
180
+ let stepHasError = false
181
+ let stepShouldStop = {
182
+ ifOnCurrentStep: false,
183
+ ifFromAnyStep: false,
184
+ stoppageStepId: -1,
185
+ }
186
+
187
+ wizard.setLoader(true)
188
+ if (wizard.isValidateForStep(0, currentStep.id, nextStep.id)) {
189
+ const nameValidation = await checkName(value)
190
+
191
+ value = nameValidation.newValue
192
+ stepHasError = stepHasError || nameValidation.stepHasError
193
+ } else if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
194
+ const storageValidation = await checkStorage(value)
195
+
196
+ value = storageValidation.newValue
197
+
198
+ stepHasError = stepHasError || storageValidation.stepHasError
199
+ } else if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
200
+ selectOptionsSubmit.value++
201
+ } else if (wizard.isValidateForStep(3, currentStep.id, nextStep.id)) {
202
+ const storageValidation = await checkCustomizeHardware(value)
203
+
204
+ value = storageValidation.newValue
205
+
206
+ stepHasError = stepHasError || storageValidation.stepHasError
207
+ }
208
+ wizard.setLoader(false)
209
+
210
+ return {
211
+ newValue: value,
212
+ stepHasError,
213
+ stepShouldStop,
214
+ }
215
+ }
216
+ const checkName = async (
217
+ value: UI_I_WizardStep[]
218
+ ): Promise<UI_I_ValidationReturn> => {
219
+ let stepHasError = false
220
+
221
+ return new Promise((resolve) => {
222
+ nameFormSubmit.value = (isValid: boolean) => {
223
+ if (!isValid) {
224
+ stepHasError = wizard.setValidation(0, 'name', {
225
+ fieldMessage: 'aaa',
226
+ alertMessage: 'aaa',
227
+ })
228
+ } else if (wizard.hasMessage(0, 'name')) {
229
+ value = wizard.removeValidation(0, 'name', value)
230
+ }
231
+
232
+ resolve({
233
+ stepHasError,
234
+ newValue: value,
235
+ })
236
+ nameFormSubmit.value = null
237
+ }
238
+ })
239
+ }
240
+ const checkStorage = async (
241
+ value: UI_I_WizardStep[]
242
+ ): Promise<UI_I_ValidationReturn> => {
243
+ let stepHasError = false
244
+
245
+ return new Promise((resolve) => {
246
+ storageSubmit.value = (isValid: boolean) => {
247
+ if (!isValid) {
248
+ stepHasError = wizard.setValidation(1, 'storage', {
249
+ fieldMessage: 'aaa',
250
+ alertMessage: 'aaa',
251
+ })
252
+ } else if (wizard.hasMessage(1, 'storage')) {
253
+ value = wizard.removeValidation(1, 'storage', value)
254
+ }
255
+
256
+ resolve({
257
+ stepHasError,
258
+ newValue: value,
259
+ })
260
+ storageSubmit.value = null
261
+ }
262
+ })
263
+ }
264
+ const checkCustomizeHardware = async (
265
+ value: UI_I_WizardStep[]
266
+ ): Promise<UI_I_ValidationReturn> => {
267
+ let stepHasError = false
268
+
269
+ return new Promise((resolve) => {
270
+ customizeHardwareSubmit.value = (isValid: boolean) => {
271
+ if (!isValid) {
272
+ stepHasError = wizard.setValidation(3, 'customizeHardware', {
273
+ fieldMessage: 'aaa',
274
+ alertMessage: 'aaa',
275
+ })
276
+ } else if (wizard.hasMessage(3, 'customizeHardware')) {
277
+ value = wizard.removeValidation(3, 'customizeHardware', value)
278
+ }
279
+
280
+ resolve({
281
+ stepHasError,
282
+ newValue: value,
283
+ })
284
+ storageSubmit.value = null
285
+ }
286
+ })
287
+ }
288
+
289
+ const storageIdCash = ref<string | null>(null)
290
+ const vmForm = ref<UI_I_VmForm>({
291
+ name: '',
292
+ storage: null,
293
+ options: [],
294
+ })
295
+ const onChangeName = (name: string): void => {
296
+ vmForm.value.name = name
297
+ }
298
+ const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
299
+ if (!storage) return
300
+
301
+ vmForm.value.storage = storage
302
+ storageIdCash.value = storage.id
303
+ }
304
+ const onChangeSelectOptions = (options: string[]): void => {
305
+ vmForm.value.options = options
306
+ }
307
+ const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
308
+ const onChangeCustomizeHardware = (
309
+ data: UI_I_SendDataCustomizeHardware
310
+ ): void => {
311
+ customizeHardware.value = data
312
+ }
313
+
314
+ const virtualHardwareHardDisksLocal = computed<
315
+ UI_I_SendDataNewHardDisk[] | null
316
+ >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
317
+ const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
318
+ () => customizeHardware.value?.virtualHardware?.networks || null
319
+ )
320
+ const virtualHardwareCdDvdDrivesLocal = computed<
321
+ UI_I_SendDataNewCdDvdDrive[] | null
322
+ >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
323
+
324
+ const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
325
+ () => customizeHardware.value?.virtualHardware?.cpu || null
326
+ )
327
+ const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
328
+ () => customizeHardware.value?.virtualHardware?.memory || null
329
+ )
330
+ const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
331
+ const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
332
+ null
333
+ )
334
+ const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
335
+ const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
336
+ virtualHardwareHardDisks.value = data[0]
337
+ virtualHardwareCdDvdDrives.value = data[1]
338
+ virtualHardwareNetworks.value = data[2]
339
+ }
340
+
341
+ const isPowerOnByDefault = ref<boolean>(true)
342
+
343
+ watch(
344
+ () => props.vmNameInWizard,
345
+ (newValue) => {
346
+ vmForm.value.name = newValue
347
+ }
348
+ )
349
+
350
+ const validateSendData = async (
351
+ value: UI_I_WizardStep[]
352
+ ): Promise<UI_I_ValidationReturn> => {
353
+ wizard.setLoader(true)
354
+ let stepHasError = false
355
+
356
+ const data = await props.validateSendDataFunc(
357
+ vmForm.value,
358
+ virtualHardwareCpu.value,
359
+ virtualHardwareMemory.value,
360
+ customizeHardware.value,
361
+ virtualHardwareNetworks.value,
362
+ virtualHardwareHardDisks.value,
363
+ virtualHardwareCdDvdDrives.value,
364
+ isPowerOnByDefault.value,
365
+ localization.value
366
+ )
367
+
368
+ wizard.setLoader(false)
369
+ if (data) {
370
+ stepHasError = true
371
+ selectedNavItem.value = data[0]
372
+ }
373
+
374
+ return {
375
+ stepHasError,
376
+ newValue: value,
377
+ }
378
+ }
379
+ const onFinish = (): void => {
380
+ wizard.setLoader(false)
381
+ props
382
+ .finishFunc(
383
+ vmForm.value,
384
+ virtualHardwareCpu.value,
385
+ virtualHardwareMemory.value,
386
+ customizeHardware.value,
387
+ virtualHardwareNetworks.value,
388
+ virtualHardwareHardDisks.value,
389
+ virtualHardwareCdDvdDrives.value,
390
+ isPowerOnByDefault.value,
391
+ localization.value
392
+ )
393
+ .then(() => {
394
+ onHideModal()
395
+ wizard.setLoader(false)
396
+ })
397
+ }
398
+
399
+ const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
400
+
401
+ const nameFormSubmit = ref<null | Function>(null)
402
+ const storageSubmit = ref<null | Function>(null)
403
+ const selectOptionsSubmit = ref<number>(0)
404
+ const customizeHardwareSubmit = ref<null | Function>(null)
405
+
406
+ const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
407
+ const vmName = ref<string>(vmSettings.value?.name || '')
408
+ watch(vmSettings, (newValue) => {
409
+ vmName.value = newValue?.name || ''
410
+ })
411
+
412
+ const onHideModal = (): void => {
413
+ emits('hide')
414
+ }
415
+ </script>
416
+
417
+ <style scoped lang="scss">
418
+ :deep(.has-solid.close-icon.clr-icon) {
419
+ width: 20px;
420
+ top: 0;
421
+ }
422
+ .vm-context {
423
+ padding: 16px 15px 10px 10px;
424
+ height: 100%;
425
+ display: flex;
426
+ flex-direction: column;
427
+
428
+ .context-title-wrap {
429
+ padding-bottom: 3px;
430
+ border-bottom: 1px solid #a6a6a6;
431
+
432
+ h4 {
433
+ font-weight: 700;
434
+ font-size: 13px;
435
+ color: var(--vm-context-title);
436
+ }
437
+ p {
438
+ font-weight: 400;
439
+ font-size: 13px;
440
+ color: var(--vm-context-sub-title);
441
+ }
442
+ }
443
+
444
+ .finish-block {
445
+ padding: 18px 24px 24px 24px;
446
+
447
+ .add-hosts-ready-to-complete-mt-12 {
448
+ margin-top: 12px;
449
+
450
+ .add-hosts-ready-to-complete-bold {
451
+ line-height: 18px;
452
+ font-weight: 700;
453
+ }
454
+ }
455
+ }
456
+
457
+ .vm-hardware-version {
458
+ align-self: flex-end;
459
+ margin-top: auto;
460
+ }
461
+ }
462
+
463
+ :deep(.modal .modal-dialog .modal-content .modal-footer) {
464
+ flex: unset;
465
+ height: unset;
466
+ min-height: unset;
467
+ }
468
+ :deep(.wizard-modal-titlebar h3) {
469
+ color: #000;
470
+ font-size: 24px;
471
+ font-weight: 200;
472
+ line-height: 27px;
473
+ margin: 0;
474
+ padding: 0;
475
+ }
476
+ :deep(.clr-wizard-stepnav-item) {
477
+ padding-left: 0;
478
+ }
479
+ :deep(.clr-wizard-stepnav
480
+ .clr-wizard-stepnav-item
481
+ button
482
+ .clr-wizard-stepnav-link-title) {
483
+ width: 189px;
484
+ font-weight: 700;
485
+ font-size: 13px;
486
+ }
487
+
488
+ #vm-wizard-notification {
489
+ h3 {
490
+ color: var(--global-font-color7);
491
+ margin-top: 6px;
492
+ }
493
+ p {
494
+ color: var(--global-font-color6);
495
+ line-height: 16px;
496
+ }
497
+ }
498
+
499
+ .power-on-by-default-wrap {
500
+ display: flex;
501
+ align-items: center;
502
+
503
+ input {
504
+ margin-right: 6px;
505
+ }
506
+ }
507
+ </style>
508
+
509
+ <style>
510
+ :root {
511
+ --vm-context-title: #333;
512
+ --vm-context-sub-title: #000;
513
+ }
514
+ :root.dark-theme {
515
+ --vm-context-title: #adbbc4;
516
+ --vm-context-sub-title: #adbbc4;
517
+ }
518
+ </style>