bfg-common 1.2.45 → 1.2.47

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 (203) hide show
  1. package/components/atoms/alert/Notification.vue +167 -167
  2. package/components/atoms/autocomplete/Autocomplete.vue +236 -236
  3. package/components/atoms/datepicker/Datepicker.vue +612 -612
  4. package/components/atoms/list/SelectList.vue +62 -62
  5. package/components/atoms/nav/NavBar.vue +116 -116
  6. package/components/atoms/nav/VerticalNavBar.vue +89 -89
  7. package/components/atoms/notificationBar/NotificationBar.vue +175 -175
  8. package/components/atoms/perPage/PerPage.vue +52 -52
  9. package/components/atoms/popup/SimplePopup.vue +90 -90
  10. package/components/atoms/step/VerticalStep.vue +104 -104
  11. package/components/atoms/switch/Switch.vue +107 -107
  12. package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +206 -206
  13. package/components/atoms/table/dataGrid/DataGridPage.vue +189 -189
  14. package/components/atoms/tabs/Tabs.vue +189 -189
  15. package/components/atoms/tooltip/Signpost.vue +224 -224
  16. package/components/common/BadBrowser.vue +114 -114
  17. package/components/common/adapterManager/AddAdapterWarningModal.vue +82 -82
  18. package/components/common/adapterManager/NoActiveAdaptersModal.vue +62 -62
  19. package/components/common/adapterManager/NoConnectedActiveAdaptersModal.vue +62 -62
  20. package/components/common/browse/Browse.vue +182 -182
  21. package/components/common/browse/blocks/Title.vue +66 -66
  22. package/components/common/diagramMain/Diagram.vue +186 -186
  23. package/components/common/diagramMain/DiagramMain.vue +986 -986
  24. package/components/common/diagramMain/adapter/AdapterItem.vue +227 -227
  25. package/components/common/diagramMain/adapter/AdapterItems.vue +57 -57
  26. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +339 -339
  27. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +202 -202
  28. package/components/common/diagramMain/modals/remove/RemoveModal.vue +226 -226
  29. package/components/common/diagramMain/network/Contents.vue +238 -238
  30. package/components/common/feedback/Buttons.vue +232 -232
  31. package/components/common/feedback/Message.vue +468 -468
  32. package/components/common/feedback/VisitPortal.vue +54 -54
  33. package/components/common/help/navbar/left/Left.vue +159 -159
  34. package/components/common/help/navbar/left/utils/constructAccordion.ts +27 -27
  35. package/components/common/mainNavigationPanel/MainNavigationPanel.vue +359 -359
  36. package/components/common/modals/Rename.vue +165 -165
  37. package/components/common/perPage/PerPage.vue +51 -51
  38. package/components/common/recursionTree/RecursionTree.vue +201 -201
  39. package/components/common/vm/actions/add/Add.vue +14 -14
  40. package/components/common/vm/actions/add/utils.ts +2 -2
  41. package/components/common/vm/actions/clone/Clone.vue +544 -545
  42. package/components/common/vm/actions/clone/select/options/Options.vue +65 -65
  43. package/components/common/vm/actions/clone/utils.ts +43 -43
  44. package/components/common/vm/actions/{add → common}/config/capabilities.ts +338 -338
  45. package/components/common/vm/actions/{add → common}/customizeHardware/CustomizeHardware.vue +7 -7
  46. package/components/common/vm/actions/{add → common}/customizeHardware/models/interfaces.ts +2 -2
  47. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/VirtualHardware.vue +657 -657
  48. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/browseView/BrowseView.vue +1 -1
  49. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/bus/Bus.vue +1 -1
  50. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +8 -8
  51. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +109 -109
  52. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/Cpu.vue +383 -383
  53. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/shares/Shares.vue +1 -1
  54. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/limit/Limit.vue +234 -234
  55. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/limit/config/options.ts +28 -28
  56. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/memory/Memory.vue +316 -316
  57. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/memory/config/memoryOptions.ts +35 -35
  58. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/Location.vue +1 -1
  59. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +445 -445
  60. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +1 -1
  61. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +1 -1
  62. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/mode/Mode.vue +1 -1
  63. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +1 -1
  64. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/sharing/Sharing.vue +1 -1
  65. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +288 -288
  66. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +1 -1
  67. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +1 -1
  68. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +8 -8
  69. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +1 -1
  70. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +1 -1
  71. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/other/Other.vue +1 -1
  72. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/reservation/Reservation.vue +235 -235
  73. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/videoCard/VideoCard.vue +177 -177
  74. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/videoCard/model/Model.vue +1 -1
  75. package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +1 -1
  76. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/Vmoptions.vue +6 -6
  77. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/bootOptions/BootOptions.vue +7 -7
  78. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +1 -1
  79. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +1 -1
  80. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/bootOptions/order/Order.vue +197 -197
  81. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +181 -181
  82. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/CopyPaste.vue +51 -51
  83. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +253 -253
  84. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/ImgCompression.vue +1 -1
  85. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/JpegCompression.vue +1 -1
  86. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +55 -55
  87. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/MouseMode.vue +1 -1
  88. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +2 -2
  89. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/SharePolicy.vue +1 -1
  90. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +1 -1
  91. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/type/Type.vue +1 -1
  92. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +1 -1
  93. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/ZlibCompression.vue +1 -1
  94. package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/tools/Tools.vue +1 -1
  95. package/components/common/vm/actions/{add → common}/models/interfaces.ts +2 -2
  96. package/components/common/vm/actions/{add → common}/models/types.ts +3 -3
  97. package/components/common/vm/actions/{add → common}/select/computeResource/ComputeResource.vue +1 -1
  98. package/components/common/vm/actions/{add → common}/select/createType/CreateType.vue +1 -1
  99. package/components/common/vm/actions/{add → common}/select/models/types.ts +2 -0
  100. package/components/common/vm/actions/{add → common}/select/os/os.vue +1 -1
  101. package/components/common/vm/actions/{add → common}/select/storage/Storage.vue +1 -1
  102. package/components/common/vm/actions/{add → common}/select/storage/config/config.ts +154 -154
  103. package/components/common/vm/actions/editSettings/EditSettings.vue +4 -4
  104. package/components/common/vm/actions/editSettings/models/types.ts +2 -2
  105. package/components/common/vm/actions/editSettings/utils.ts +2 -5
  106. package/components/common/vm/actions/models/interfaces.ts +1 -1
  107. package/components/common/vm/actions/models/types.ts +1 -1
  108. package/components/common/vm/actions/utils.ts +5 -5
  109. package/components/common/wizards/datastore/add/nfs/Nfs.vue +94 -94
  110. package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +377 -377
  111. package/components/common/wizards/datastore/add/nfs/configuration/serversList/ServersList.vue +123 -123
  112. package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +54 -54
  113. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/HostTable.vue +131 -131
  114. package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +230 -230
  115. package/composables/useLocal.ts +38 -38
  116. package/minify.js +146 -146
  117. package/models/store/interfaces.ts +37 -37
  118. package/models/store/storage/interfaces.ts +32 -32
  119. package/models/store/types.ts +32 -32
  120. package/models/store/vm/interfaces.ts +2 -2
  121. package/modules/fixContentBuild/utils/methods.ts +114 -114
  122. package/package.json +1 -1
  123. package/public/spice-console/application/codec.js +257 -257
  124. package/public/spice-console/lib/rasterEngine.js +907 -907
  125. package/public/spice-console/network/spicechannel.js +369 -369
  126. package/utils/contentBuild.ts +34 -34
  127. package/components/common/vm/actions/clone/readyToComplete/ReadyToComplete.vue +0 -15
  128. /package/components/common/vm/actions/{add → common}/customizeHardware/config/navItems.ts +0 -0
  129. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/browseView/models/interfaces.ts +0 -0
  130. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/bus/config/options.ts +0 -0
  131. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cdDvdDrive/config/fileTypes.ts +0 -0
  132. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cdDvdDrive/config/options.ts +0 -0
  133. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +0 -0
  134. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cdDvdDrive/models/types.ts +0 -0
  135. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/config/binaryOptions.ts +0 -0
  136. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/config/dropdownItems.ts +0 -0
  137. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/CpuHotPlug.vue +0 -0
  138. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/CpuModel.vue +0 -0
  139. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/Hv.vue +0 -0
  140. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/Iommu.vue +0 -0
  141. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/MaxCpu.vue +0 -0
  142. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/Pc.vue +0 -0
  143. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/Sa.vue +0 -0
  144. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/config/cpuOptions.ts +0 -0
  145. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/shares/config/options.ts +0 -0
  146. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/cpu/tooltip/Tooltip.vue +0 -0
  147. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/memory/MemoryHotPlug.vue +0 -0
  148. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/models/interfaces.ts +0 -0
  149. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/models/types.ts +0 -0
  150. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/DiskFile.vue +0 -0
  151. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/MaximumSize.vue +0 -0
  152. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/cache/config/options.ts +0 -0
  153. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/limitIops/config/options.ts +0 -0
  154. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/mode/config/options.ts +0 -0
  155. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/provisioning/config/options.ts +0 -0
  156. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newHardDisk/sharing/config/options.ts +0 -0
  157. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newNetwork/Location.vue +0 -0
  158. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newNetwork/adapterType/config/options.ts +0 -0
  159. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newNetwork/macAddress/config/options.ts +0 -0
  160. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newPciDevice/config/options.ts +0 -0
  161. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +0 -0
  162. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/config/options.ts +0 -0
  163. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +0 -0
  164. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +0 -0
  165. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelection.vue +0 -0
  166. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/newUsbController/config/options.ts +0 -0
  167. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/other/InputDevices.vue +0 -0
  168. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/reservation/config/options.ts +0 -0
  169. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/videoCard/Graphics.vue +0 -0
  170. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/videoCard/TotalVideoMemory.vue +0 -0
  171. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/videoCard/config/options.ts +0 -0
  172. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/videoCard/model/config/options.ts +0 -0
  173. /package/components/common/vm/actions/{add → common}/customizeHardware/virtualHardware/videoCard/numberDisplays/config/options.ts +0 -0
  174. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/bootOptions/Menu.vue +0 -0
  175. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/bootOptions/Secure.vue +0 -0
  176. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/bootOptions/delay/config/config.ts +0 -0
  177. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/bootOptions/firmware/config/config.ts +0 -0
  178. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/bootOptions/order/models/interfaces.ts +0 -0
  179. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/models/interfaces.ts +0 -0
  180. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/FileTransfer.vue +0 -0
  181. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/FolderSharing.vue +0 -0
  182. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/PlaybackCompression.vue +0 -0
  183. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/PowerControl.vue +0 -0
  184. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/config/config.ts +0 -0
  185. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/config/config.ts +0 -0
  186. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/keymap/config/config.ts +0 -0
  187. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/config/config.ts +0 -0
  188. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/password/models/interfaces.ts +0 -0
  189. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/password/utils.ts +0 -0
  190. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/config/config.ts +0 -0
  191. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/config/config.ts +0 -0
  192. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/type/config/config.ts +0 -0
  193. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/config/config.ts +0 -0
  194. /package/components/common/vm/actions/{add → common}/customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/config/config.ts +0 -0
  195. /package/components/common/vm/actions/{add → common}/models/enums.ts +0 -0
  196. /package/components/common/vm/actions/{add → common}/readyToComplete/ReadyToComplete.vue +0 -0
  197. /package/components/common/vm/actions/{add → common}/select/compatibility/Compatibility.vue +0 -0
  198. /package/components/common/vm/actions/{add → common}/select/computeResource/ComputeResource.spec.ts +0 -0
  199. /package/components/common/vm/actions/{add → common}/select/computeResource/TreeView.vue +0 -0
  200. /package/components/common/vm/actions/{add → common}/select/createType/config/items.ts +0 -0
  201. /package/components/common/vm/actions/{add → common}/select/models/interfaces.ts +0 -0
  202. /package/components/common/vm/actions/{add → common}/select/name/Name.vue +0 -0
  203. /package/components/common/vm/actions/{add → common}/select/storage/models/types.ts +0 -0
@@ -1,545 +1,544 @@
1
- <template>
2
- <div class="clone-vm">
3
- <atoms-modal-by-steps
4
- test-id="clone-vm-wizard"
5
- :show="true"
6
- :title="localization.cloneExistingVirtualMachine"
7
- :step-items="stepItems"
8
- :step-position="stepPosition"
9
- :loading="loading"
10
- @change-step="onChangeStep"
11
- @hide="onHideModal"
12
- >
13
- <template #modalBody>
14
- <atoms-loader v-show="!vmSettings || loading" id="loader" />
15
- <div v-if="vmSettings" class="vm-context">
16
- <div class="context-title-wrap">
17
- <p>{{ stepSubTitle }}</p>
18
- </div>
19
-
20
- <common-vm-actions-add-select-name
21
- v-show="stepPosition === 0"
22
- :show="stepPosition === 0"
23
- :name-form-submit="nameFormSubmit"
24
- :project="props.project"
25
- @submit="onChangeNameAndNext(...$event)"
26
- @check-name="emits('check-name', $event)"
27
- @loading="loading = $event"
28
- />
29
- <common-vm-actions-add-select-storage
30
- v-show="stepPosition === 1"
31
- :storage-submit="storageSubmit"
32
- :datastore="props.datastore"
33
- :get-datastore-table-func="props.getDatastoreTableFunc"
34
- @submit="onChangeStorageAndNext"
35
- />
36
- <common-vm-actions-clone-select-options
37
- v-show="stepPosition === 2"
38
- :select-options-submit="selectOptionsSubmit"
39
- @submit="onChangeSelectOptionsAndNext"
40
- />
41
- <common-vm-actions-add-customize-hardware
42
- v-show="stepPosition === 3"
43
- v-model:vm-name="vmName"
44
- v-model:guest-machine-type="vmSettings.guestMachineType"
45
- v-model:guest-os-family="vmSettings.guestOsFamily"
46
- v-model:guest-os-version="vmSettings.guestOsVersion"
47
- :storage="vmSettings.storage"
48
- :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
49
- :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
50
- :networks-for-boot-options="virtualHardwareNetworksLocal"
51
- :cd-dvd-drives="vmSettings.cdDvdDrives"
52
- :hard-disks="vmSettings.hardDisks"
53
- :networks="vmSettings.networks"
54
- :customize-hardware-submit="customizeHardwareSubmit"
55
- :max-cpus="vmSettings.maxCpus"
56
- :max-memory="vmSettings.maxMemory"
57
- :cpu-models="vmSettings.cpuModels"
58
- :cpu="vmSettings.cpu"
59
- :memory="vmSettings.memory"
60
- :video-card="vmSettings.videoCard"
61
- :usb-controller="vmSettings.usbController"
62
- :pci-devices="vmSettings.pciDevices"
63
- :selected-nav-item="selectedNavItem"
64
- :hard-disks-for-edit="vmSettings.hardDisks"
65
- :options="vmSettings.options"
66
- :nodes="props.nodes"
67
- :files="props.files"
68
- :networks-table="props.networksTable"
69
- :error-validation-fields="props.errorValidationFields"
70
- :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
71
- :passthrough-devices="props.passthroughDevices"
72
- :get-datastore-table-func="props.getDatastoreTableFunc"
73
- :datastore="props.datastore"
74
- is-clone
75
- @change-boot-order="onChangeBootOrder"
76
- @send-data="onChangeCustomizeHardware"
77
- @get-storage="emits('get-storage', $event)"
78
- @get-folders-or-files="emits('get-folders-or-files', $event)"
79
- @get-active-device-child="emits('get-active-device-child', $event)"
80
- @show-datastore-child="emits('show-datastore-child', $event)"
81
- @get-networks-table="emits('get-networks-table', $event)"
82
- @get-pci-devices="emits('get-pci-devices')"
83
- @next="onNext(true)"
84
- />
85
- <common-vm-actions-clone-ready-to-complete
86
- v-if="stepPosition === 4"
87
- :ready-complete-table-info="props.readyCompleteTableInfo"
88
- />
89
- </div>
90
- </template>
91
-
92
- <template #modalFooter>
93
- <div class="flex-align-center flex-space-between w-100">
94
- <div class="power-on-by-default-wrap">
95
- <template v-if="stepPosition === 4">
96
- <input
97
- id="power-on-by-default"
98
- v-model="isPowerOnByDefault"
99
- type="checkbox"
100
- />
101
- <label for="power-on-by-default" class="label-text-normal">{{
102
- localization.powerOnByDefault
103
- }}</label>
104
- </template>
105
- </div>
106
- <div class="flex-align-center">
107
- <button
108
- id="vm-wizard-cancel-button"
109
- class="btn btn-link"
110
- @click="onHideModal"
111
- >
112
- {{ localization.cancel }}
113
- </button>
114
- <button
115
- v-show="stepPosition > 0"
116
- id="vm-wizard-back-button"
117
- class="btn btn-outline"
118
- @click="onBack"
119
- >
120
- {{ localization.back }}
121
- </button>
122
- <button
123
- v-if="stepPosition === stepItems.length - 1"
124
- id="vm-wizard-finish-button"
125
- class="btn btn-success"
126
- @click="onFinish"
127
- >
128
- {{ localization.finish }}
129
- </button>
130
- <button
131
- v-else
132
- id="vm-wizard-next-button"
133
- class="btn btn-primary"
134
- @click="onNext(false)"
135
- >
136
- {{ localization.next }}
137
- </button>
138
- </div>
139
- </div>
140
- </template>
141
- </atoms-modal-by-steps>
142
- </div>
143
- </template>
144
-
145
- <script setup lang="ts">
146
- import type {
147
- UI_I_DatastoreTableItem,
148
- UI_I_FolderOrFileTreePayload,
149
- } from '~/models/store/storage/interfaces'
150
- import type { UI_I_NetworkTableItem } from '~/models/store/network/interfaces'
151
- import type {
152
- API_UI_I_Error,
153
- UI_I_TablePayload,
154
- } from '~/models/store/interfaces'
155
- import type { UI_I_FileTreeNode } from '~/components/models/interfaces'
156
- import type { UI_I_Localization } from '~/models/interfaces'
157
- import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/add/customizeHardware/models/interfaces'
158
- import type { UI_I_ErrorValidationField } from '~/models/store/interfaces'
159
- import type {
160
- UI_I_SendDataCpu,
161
- UI_I_SendDataMemory,
162
- UI_I_SendDataNewCdDvdDrive,
163
- UI_I_SendDataNewHardDisk,
164
- UI_I_SendDataNewNetwork,
165
- } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/interfaces'
166
- import type {
167
- UI_T_AddVmFinishFunc,
168
- UI_T_SelectedNavItem,
169
- } from '~/components/common/vm/actions/add/models/types'
170
- import type {
171
- UI_I_OptionItem,
172
- UI_I_VerticalStepItem,
173
- } from '~/components/atoms/models/interfaces'
174
- import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
175
- import type { UI_I_ConfigurePciDevicesTable } from '~/models/store/host/interfaces'
176
- import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/models/types'
177
- import type { UI_T_Project } from '~/models/types'
178
- import type { UI_I_VmSettings } from '~/models/store/vm/interfaces'
179
- import type { UI_I_VmForm } from '~/components/common/vm/actions/clone/models/interfaces'
180
- import { capabilities } from '~/components/common/vm/actions/add/config/capabilities'
181
- import {
182
- stepItemsFunc,
183
- subTitleFunc,
184
- } from '~/components/common/vm/actions/clone/utils'
185
-
186
- const props = defineProps<{
187
- project: UI_T_Project
188
- vmSettings: UI_I_VmSettings | null
189
- nodes: UI_I_FileTreeNode[]
190
- files: UI_I_FileTreeNode[]
191
- networksTable: UI_I_NetworkTableItem[]
192
- datastore: UI_I_DatastoreTableItem[]
193
- errorValidationFields: UI_I_ErrorValidationField[]
194
- readyCompleteTableInfo: UI_I_TableInfoItem[]
195
- vmCpuHelpTextSecond: string
196
- finishFunc: any
197
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
198
- validateSendDataFunc: any
199
- passthroughDevices: UI_I_ConfigurePciDevicesTable | null
200
- vmNameInWizard: string
201
- }>()
202
-
203
- const emits = defineEmits<{
204
- (event: 'check-name', value: [string, (error: API_UI_I_Error) => void]): void
205
- (event: 'get-storage', value: UI_I_TablePayload): void
206
- (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
207
- (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
208
- (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
209
- (event: 'remove-error-by-title', value: string): void
210
- (event: 'get-networks-table', value: UI_I_TablePayload): void
211
- (event: 'get-pci-devices'): void
212
- (event: 'hide'): void
213
- }>()
214
-
215
- const localization = computed<UI_I_Localization>(() => useLocal())
216
-
217
- const stepPosition = ref<number>(0)
218
- watch(stepPosition, (newValue) => {
219
- if (newValue === 4) validateSendData()
220
- })
221
- const stepItems = ref<UI_I_VerticalStepItem[]>([])
222
- stepItems.value = stepItemsFunc(localization.value, props.project)
223
-
224
- const subTitle: string[] = subTitleFunc(localization.value, props.project)
225
- const stepSubTitle = computed<string>(() => subTitle[stepPosition.value])
226
-
227
- const storageIdCash = ref<string | null>(null)
228
- const vmForm = ref<UI_I_VmForm>({
229
- name: '',
230
- storage: null,
231
- options: [],
232
- })
233
-
234
- const isPowerOnByDefault = ref<boolean>(true)
235
-
236
- const onChangeNameAndNext = (name: string): void => {
237
- checkLocalChangeAndChangeStepStatus()
238
-
239
- vmForm.value.name = name
240
- onNext(true)
241
- }
242
-
243
- const onChangeStorageAndNext = (
244
- storage: UI_I_DatastoreTableItem | null
245
- ): void => {
246
- if (!storage) return
247
-
248
- const hasChanges = storage.id !== storageIdCash.value
249
- if (hasChanges) checkLocalChangeAndChangeStepStatus()
250
-
251
- vmForm.value.storage = storage
252
- storageIdCash.value = storage.id
253
-
254
- onNext(true)
255
- }
256
-
257
- const onChangeSelectOptionsAndNext = (options: string[]): void => {
258
- vmForm.value.options = options
259
-
260
- onNext(true)
261
- }
262
-
263
- const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
264
- const onChangeCustomizeHardware = (
265
- data: UI_I_SendDataCustomizeHardware
266
- ): void => {
267
- customizeHardware.value = data
268
- }
269
-
270
- const virtualHardwareHardDisksLocal = computed<
271
- UI_I_SendDataNewHardDisk[] | null
272
- >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
273
- const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
274
- () => customizeHardware.value?.virtualHardware?.networks || null
275
- )
276
- const virtualHardwareCdDvdDrivesLocal = computed<
277
- UI_I_SendDataNewCdDvdDrive[] | null
278
- >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
279
-
280
- const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
281
- () => customizeHardware.value?.virtualHardware?.cpu || null
282
- )
283
- const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
284
- () => customizeHardware.value?.virtualHardware?.memory || null
285
- )
286
- const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
287
- const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
288
- null
289
- )
290
- const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
291
- const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
292
- virtualHardwareHardDisks.value = data[0]
293
- virtualHardwareCdDvdDrives.value = data[1]
294
- virtualHardwareNetworks.value = data[2]
295
- }
296
-
297
- watch(
298
- () => props.vmNameInWizard,
299
- (newValue) => {
300
- vmForm.value.name = newValue
301
- }
302
- )
303
-
304
- const loading = ref<boolean>(false)
305
- const validateSendData = (): void => {
306
- loading.value = true
307
- props
308
- .validateSendDataFunc(
309
- vmForm.value,
310
- virtualHardwareCpu.value,
311
- virtualHardwareMemory.value,
312
- customizeHardware.value,
313
- virtualHardwareNetworks.value,
314
- virtualHardwareHardDisks.value,
315
- virtualHardwareCdDvdDrives.value,
316
- isPowerOnByDefault.value,
317
- localization.value
318
- )
319
- .then((data) => {
320
- loading.value = false
321
- if (!data) return
322
-
323
- selectedNavItem.value = data[0]
324
- data[1] !== null && (stepPosition.value = data[1])
325
- })
326
- }
327
- const onFinish = (): void => {
328
- loading.value = true
329
- props
330
- .finishFunc(
331
- vmForm.value,
332
- virtualHardwareCpu.value,
333
- virtualHardwareMemory.value,
334
- customizeHardware.value,
335
- virtualHardwareNetworks.value,
336
- virtualHardwareHardDisks.value,
337
- virtualHardwareCdDvdDrives.value,
338
- isPowerOnByDefault.value,
339
- localization.value
340
- )
341
- .then(() => {
342
- onHideModal()
343
- loading.value = false
344
- })
345
- }
346
-
347
- const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
348
-
349
- const nameFormSubmit = ref<number>(0)
350
- const storageSubmit = ref<number>(0)
351
- const selectOptionsSubmit = ref<number>(0)
352
- const customizeHardwareSubmit = ref<number>(0)
353
-
354
- const onNext = (force = false): void => {
355
- const isValid = checkSubmit(force)
356
- if (!isValid) {
357
- return
358
- }
359
-
360
- const isDisabled = stepItems.value[cashStep]?.disabled
361
- if (cashStep !== -1 && !isDisabled) {
362
- stepPosition.value = cashStep
363
- cashStep = -1
364
- return
365
- }
366
-
367
- stepItems.value[stepPosition.value].complete = true
368
- stepItems.value[stepPosition.value + 1].disabled = false
369
- stepPosition.value++
370
- }
371
- const checkLocalChangeAndChangeStepStatus = (): void => {
372
- stepItems.value = stepItems.value.map((step, index) => {
373
- if (index > stepPosition.value) {
374
- step.complete = false
375
- step.disabled = index > stepPosition.value + 1
376
- }
377
-
378
- return step
379
- })
380
- }
381
-
382
- const checkSubmit = (force = false): boolean => {
383
- if (stepPosition.value === 0 && !force) {
384
- nameFormSubmit.value++
385
- return false
386
- }
387
- if (stepPosition.value === 1 && !force) {
388
- storageSubmit.value++
389
- return false
390
- }
391
- if (stepPosition.value === 2 && !force) {
392
- selectOptionsSubmit.value++
393
- return false
394
- }
395
- if (stepPosition.value === 3 && !force) {
396
- customizeHardwareSubmit.value++
397
- return false
398
- }
399
- return true
400
- }
401
- const checkSubmitByManual = (step: number): boolean => {
402
- if (stepPosition.value === 0) {
403
- nameFormSubmit.value++
404
- return false
405
- }
406
- if (stepPosition.value === 1) {
407
- storageSubmit.value++
408
- return false
409
- }
410
- if (step === 3) {
411
- customizeHardwareSubmit.value++
412
- return false
413
- }
414
- return true
415
- }
416
- const onBack = (): void => {
417
- stepPosition.value--
418
- }
419
- let cashStep = -1
420
- const onChangeStep = (key: number): void => {
421
- const isValid = checkSubmitByManual(key)
422
- if (!isValid) {
423
- cashStep = key
424
- return
425
- }
426
-
427
- stepPosition.value = key
428
- }
429
-
430
- const compatibility = ref<UI_I_OptionItem[]>(capabilities.compatibility)
431
- const maxMemory = ref<number>(capabilities.maxMemory)
432
-
433
- const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
434
- const vmName = ref<string>(vmSettings.value?.name || '')
435
- watch(vmSettings, (newValue) => {
436
- vmName.value = newValue?.name || ''
437
- })
438
-
439
- const onHideModal = (): void => {
440
- emits('hide')
441
- }
442
- </script>
443
-
444
- <style scoped lang="scss">
445
- :deep(.has-solid.close-icon.clr-icon) {
446
- width: 20px;
447
- top: 0;
448
- }
449
- .vm-context {
450
- padding: 16px 15px 10px 10px;
451
- height: 100%;
452
- display: flex;
453
- flex-direction: column;
454
-
455
- .context-title-wrap {
456
- padding-bottom: 3px;
457
- border-bottom: 1px solid #a6a6a6;
458
-
459
- h4 {
460
- font-weight: 700;
461
- font-size: 13px;
462
- color: var(--vm-context-title);
463
- }
464
- p {
465
- font-weight: 400;
466
- font-size: 13px;
467
- color: var(--vm-context-sub-title);
468
- }
469
- }
470
-
471
- .finish-block {
472
- padding: 18px 24px 24px 24px;
473
-
474
- .add-hosts-ready-to-complete-mt-12 {
475
- margin-top: 12px;
476
-
477
- .add-hosts-ready-to-complete-bold {
478
- line-height: 18px;
479
- font-weight: 700;
480
- }
481
- }
482
- }
483
-
484
- .vm-hardware-version {
485
- align-self: flex-end;
486
- margin-top: auto;
487
- }
488
- }
489
-
490
- :deep(.modal .modal-dialog .modal-content .modal-footer) {
491
- flex: unset;
492
- height: unset;
493
- min-height: unset;
494
- }
495
- :deep(.wizard-modal-titlebar h3) {
496
- color: #000;
497
- font-size: 24px;
498
- font-weight: 200;
499
- line-height: 27px;
500
- margin: 0;
501
- padding: 0;
502
- }
503
- :deep(.clr-wizard-stepnav-item) {
504
- padding-left: 0;
505
- }
506
- :deep(.clr-wizard-stepnav
507
- .clr-wizard-stepnav-item
508
- button
509
- .clr-wizard-stepnav-link-title) {
510
- width: 189px;
511
- font-weight: 700;
512
- font-size: 13px;
513
- }
514
-
515
- #vm-wizard-notification {
516
- h3 {
517
- color: var(--global-font-color7);
518
- margin-top: 6px;
519
- }
520
- p {
521
- color: var(--global-font-color6);
522
- line-height: 16px;
523
- }
524
- }
525
-
526
- .power-on-by-default-wrap {
527
- display: flex;
528
- align-items: center;
529
-
530
- input {
531
- margin-right: 6px;
532
- }
533
- }
534
- </style>
535
-
536
- <style>
537
- :root {
538
- --vm-context-title: #333;
539
- --vm-context-sub-title: #000;
540
- }
541
- :root.dark-theme {
542
- --vm-context-title: #adbbc4;
543
- --vm-context-sub-title: #adbbc4;
544
- }
545
- </style>
1
+ <template>
2
+ <div class="clone-vm">
3
+ <atoms-modal-by-steps
4
+ test-id="clone-vm-wizard"
5
+ :show="true"
6
+ :title="localization.cloneExistingVirtualMachine"
7
+ :step-items="stepItems"
8
+ :step-position="stepPosition"
9
+ :loading="loading"
10
+ @change-step="onChangeStep"
11
+ @hide="onHideModal"
12
+ >
13
+ <template #modalBody>
14
+ <atoms-loader v-show="!vmSettings || loading" id="loader" />
15
+ <div v-if="vmSettings" class="vm-context">
16
+ <div class="context-title-wrap">
17
+ <p>{{ stepSubTitle }}</p>
18
+ </div>
19
+
20
+ <common-vm-actions-common-select-name
21
+ v-show="stepPosition === 0"
22
+ :show="stepPosition === 0"
23
+ :name-form-submit="nameFormSubmit"
24
+ :project="props.project"
25
+ @submit="onChangeNameAndNext(...$event)"
26
+ @check-name="emits('check-name', $event)"
27
+ @loading="loading = $event"
28
+ />
29
+ <common-vm-actions-common-select-storage
30
+ v-show="stepPosition === 1"
31
+ :storage-submit="storageSubmit"
32
+ :datastore="props.datastore"
33
+ :get-datastore-table-func="props.getDatastoreTableFunc"
34
+ @submit="onChangeStorageAndNext"
35
+ />
36
+ <common-vm-actions-clone-select-options
37
+ v-show="stepPosition === 2"
38
+ :select-options-submit="selectOptionsSubmit"
39
+ @submit="onChangeSelectOptionsAndNext"
40
+ />
41
+ <common-vm-actions-common-customize-hardware
42
+ v-show="stepPosition === 3"
43
+ v-model:vm-name="vmName"
44
+ v-model:guest-machine-type="vmSettings.guestMachineType"
45
+ v-model:guest-os-family="vmSettings.guestOsFamily"
46
+ v-model:guest-os-version="vmSettings.guestOsVersion"
47
+ :storage="vmSettings.storage"
48
+ :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
49
+ :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
50
+ :networks-for-boot-options="virtualHardwareNetworksLocal"
51
+ :cd-dvd-drives="vmSettings.cdDvdDrives"
52
+ :hard-disks="vmSettings.hardDisks"
53
+ :networks="vmSettings.networks"
54
+ :customize-hardware-submit="customizeHardwareSubmit"
55
+ :max-cpus="vmSettings.maxCpus"
56
+ :max-memory="vmSettings.maxMemory"
57
+ :cpu-models="vmSettings.cpuModels"
58
+ :cpu="vmSettings.cpu"
59
+ :memory="vmSettings.memory"
60
+ :video-card="vmSettings.videoCard"
61
+ :usb-controller="vmSettings.usbController"
62
+ :pci-devices="vmSettings.pciDevices"
63
+ :selected-nav-item="selectedNavItem"
64
+ :hard-disks-for-edit="vmSettings.hardDisks"
65
+ :options="vmSettings.options"
66
+ :nodes="props.nodes"
67
+ :files="props.files"
68
+ :networks-table="props.networksTable"
69
+ :error-validation-fields="props.errorValidationFields"
70
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
71
+ :passthrough-devices="props.passthroughDevices"
72
+ :get-datastore-table-func="props.getDatastoreTableFunc"
73
+ :datastore="props.datastore"
74
+ is-clone
75
+ @change-boot-order="onChangeBootOrder"
76
+ @send-data="onChangeCustomizeHardware"
77
+ @get-storage="emits('get-storage', $event)"
78
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
79
+ @get-active-device-child="emits('get-active-device-child', $event)"
80
+ @show-datastore-child="emits('show-datastore-child', $event)"
81
+ @get-networks-table="emits('get-networks-table', $event)"
82
+ @get-pci-devices="emits('get-pci-devices')"
83
+ @next="onNext(true)"
84
+ />
85
+ <common-vm-actions-common-ready-to-complete
86
+ v-if="stepPosition === 4"
87
+ :ready-complete-table-info="props.readyCompleteTableInfo"
88
+ />
89
+ </div>
90
+ </template>
91
+
92
+ <template #modalFooter>
93
+ <div class="flex-align-center flex-space-between w-100">
94
+ <div class="power-on-by-default-wrap">
95
+ <template v-if="stepPosition === 4">
96
+ <input
97
+ id="power-on-by-default"
98
+ v-model="isPowerOnByDefault"
99
+ type="checkbox"
100
+ />
101
+ <label for="power-on-by-default" class="label-text-normal">{{
102
+ localization.powerOnByDefault
103
+ }}</label>
104
+ </template>
105
+ </div>
106
+ <div class="flex-align-center">
107
+ <button
108
+ id="vm-wizard-cancel-button"
109
+ class="btn btn-link"
110
+ @click="onHideModal"
111
+ >
112
+ {{ localization.cancel }}
113
+ </button>
114
+ <button
115
+ v-show="stepPosition > 0"
116
+ id="vm-wizard-back-button"
117
+ class="btn btn-outline"
118
+ @click="onBack"
119
+ >
120
+ {{ localization.back }}
121
+ </button>
122
+ <button
123
+ v-if="stepPosition === stepItems.length - 1"
124
+ id="vm-wizard-finish-button"
125
+ class="btn btn-success"
126
+ @click="onFinish"
127
+ >
128
+ {{ localization.finish }}
129
+ </button>
130
+ <button
131
+ v-else
132
+ id="vm-wizard-next-button"
133
+ class="btn btn-primary"
134
+ @click="onNext(false)"
135
+ >
136
+ {{ localization.next }}
137
+ </button>
138
+ </div>
139
+ </div>
140
+ </template>
141
+ </atoms-modal-by-steps>
142
+ </div>
143
+ </template>
144
+
145
+ <script setup lang="ts">
146
+ import type {
147
+ UI_I_DatastoreTableItem,
148
+ UI_I_FolderOrFileTreePayload,
149
+ } from '~/models/store/storage/interfaces'
150
+ import type { UI_I_NetworkTableItem } from '~/models/store/network/interfaces'
151
+ import type {
152
+ API_UI_I_Error,
153
+ UI_I_TablePayload,
154
+ } from '~/models/store/interfaces'
155
+ import type { UI_I_FileTreeNode } from '~/components/models/interfaces'
156
+ import type { UI_I_Localization } from '~/models/interfaces'
157
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/models/interfaces'
158
+ import type { UI_I_ErrorValidationField } from '~/models/store/interfaces'
159
+ import type {
160
+ UI_I_SendDataCpu,
161
+ UI_I_SendDataMemory,
162
+ UI_I_SendDataNewCdDvdDrive,
163
+ UI_I_SendDataNewHardDisk,
164
+ UI_I_SendDataNewNetwork,
165
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/models/interfaces'
166
+ import type {
167
+ UI_T_SelectedNavItem,
168
+ } from '~/components/common/vm/actions/common/models/types'
169
+ import type {
170
+ UI_I_OptionItem,
171
+ UI_I_VerticalStepItem,
172
+ } from '~/components/atoms/models/interfaces'
173
+ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
174
+ import type { UI_I_ConfigurePciDevicesTable } from '~/models/store/host/interfaces'
175
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/models/types'
176
+ import type { UI_T_Project } from '~/models/types'
177
+ import type { UI_I_VmSettings } from '~/models/store/vm/interfaces'
178
+ import type { UI_I_VmForm } from '~/components/common/vm/actions/clone/models/interfaces'
179
+ import { capabilities } from '~/components/common/vm/actions/common/config/capabilities'
180
+ import {
181
+ stepItemsFunc,
182
+ subTitleFunc,
183
+ } from '~/components/common/vm/actions/clone/utils'
184
+
185
+ const props = defineProps<{
186
+ project: UI_T_Project
187
+ vmSettings: UI_I_VmSettings | null
188
+ nodes: UI_I_FileTreeNode[]
189
+ files: UI_I_FileTreeNode[]
190
+ networksTable: UI_I_NetworkTableItem[]
191
+ datastore: UI_I_DatastoreTableItem[]
192
+ errorValidationFields: UI_I_ErrorValidationField[]
193
+ readyCompleteTableInfo: UI_I_TableInfoItem[]
194
+ vmCpuHelpTextSecond: string
195
+ finishFunc: any
196
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
197
+ validateSendDataFunc: any
198
+ passthroughDevices: UI_I_ConfigurePciDevicesTable | null
199
+ vmNameInWizard: string
200
+ }>()
201
+
202
+ const emits = defineEmits<{
203
+ (event: 'check-name', value: [string, (error: API_UI_I_Error) => void]): void
204
+ (event: 'get-storage', value: UI_I_TablePayload): void
205
+ (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
206
+ (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
207
+ (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
208
+ (event: 'remove-error-by-title', value: string): void
209
+ (event: 'get-networks-table', value: UI_I_TablePayload): void
210
+ (event: 'get-pci-devices'): void
211
+ (event: 'hide'): void
212
+ }>()
213
+
214
+ const localization = computed<UI_I_Localization>(() => useLocal())
215
+
216
+ const stepPosition = ref<number>(0)
217
+ watch(stepPosition, (newValue) => {
218
+ if (newValue === 4) validateSendData()
219
+ })
220
+ const stepItems = ref<UI_I_VerticalStepItem[]>([])
221
+ stepItems.value = stepItemsFunc(localization.value, props.project)
222
+
223
+ const subTitle: string[] = subTitleFunc(localization.value, props.project)
224
+ const stepSubTitle = computed<string>(() => subTitle[stepPosition.value])
225
+
226
+ const storageIdCash = ref<string | null>(null)
227
+ const vmForm = ref<UI_I_VmForm>({
228
+ name: '',
229
+ storage: null,
230
+ options: [],
231
+ })
232
+
233
+ const isPowerOnByDefault = ref<boolean>(true)
234
+
235
+ const onChangeNameAndNext = (name: string): void => {
236
+ checkLocalChangeAndChangeStepStatus()
237
+
238
+ vmForm.value.name = name
239
+ onNext(true)
240
+ }
241
+
242
+ const onChangeStorageAndNext = (
243
+ storage: UI_I_DatastoreTableItem | null
244
+ ): void => {
245
+ if (!storage) return
246
+
247
+ const hasChanges = storage.id !== storageIdCash.value
248
+ if (hasChanges) checkLocalChangeAndChangeStepStatus()
249
+
250
+ vmForm.value.storage = storage
251
+ storageIdCash.value = storage.id
252
+
253
+ onNext(true)
254
+ }
255
+
256
+ const onChangeSelectOptionsAndNext = (options: string[]): void => {
257
+ vmForm.value.options = options
258
+
259
+ onNext(true)
260
+ }
261
+
262
+ const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
263
+ const onChangeCustomizeHardware = (
264
+ data: UI_I_SendDataCustomizeHardware
265
+ ): void => {
266
+ customizeHardware.value = data
267
+ }
268
+
269
+ const virtualHardwareHardDisksLocal = computed<
270
+ UI_I_SendDataNewHardDisk[] | null
271
+ >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
272
+ const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
273
+ () => customizeHardware.value?.virtualHardware?.networks || null
274
+ )
275
+ const virtualHardwareCdDvdDrivesLocal = computed<
276
+ UI_I_SendDataNewCdDvdDrive[] | null
277
+ >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
278
+
279
+ const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
280
+ () => customizeHardware.value?.virtualHardware?.cpu || null
281
+ )
282
+ const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
283
+ () => customizeHardware.value?.virtualHardware?.memory || null
284
+ )
285
+ const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
286
+ const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
287
+ null
288
+ )
289
+ const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
290
+ const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
291
+ virtualHardwareHardDisks.value = data[0]
292
+ virtualHardwareCdDvdDrives.value = data[1]
293
+ virtualHardwareNetworks.value = data[2]
294
+ }
295
+
296
+ watch(
297
+ () => props.vmNameInWizard,
298
+ (newValue) => {
299
+ vmForm.value.name = newValue
300
+ }
301
+ )
302
+
303
+ const loading = ref<boolean>(false)
304
+ const validateSendData = (): void => {
305
+ loading.value = true
306
+ props
307
+ .validateSendDataFunc(
308
+ vmForm.value,
309
+ virtualHardwareCpu.value,
310
+ virtualHardwareMemory.value,
311
+ customizeHardware.value,
312
+ virtualHardwareNetworks.value,
313
+ virtualHardwareHardDisks.value,
314
+ virtualHardwareCdDvdDrives.value,
315
+ isPowerOnByDefault.value,
316
+ localization.value
317
+ )
318
+ .then((data) => {
319
+ loading.value = false
320
+ if (!data) return
321
+
322
+ selectedNavItem.value = data[0]
323
+ data[1] !== null && (stepPosition.value = data[1])
324
+ })
325
+ }
326
+ const onFinish = (): void => {
327
+ loading.value = true
328
+ props
329
+ .finishFunc(
330
+ vmForm.value,
331
+ virtualHardwareCpu.value,
332
+ virtualHardwareMemory.value,
333
+ customizeHardware.value,
334
+ virtualHardwareNetworks.value,
335
+ virtualHardwareHardDisks.value,
336
+ virtualHardwareCdDvdDrives.value,
337
+ isPowerOnByDefault.value,
338
+ localization.value
339
+ )
340
+ .then(() => {
341
+ onHideModal()
342
+ loading.value = false
343
+ })
344
+ }
345
+
346
+ const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
347
+
348
+ const nameFormSubmit = ref<number>(0)
349
+ const storageSubmit = ref<number>(0)
350
+ const selectOptionsSubmit = ref<number>(0)
351
+ const customizeHardwareSubmit = ref<number>(0)
352
+
353
+ const onNext = (force = false): void => {
354
+ const isValid = checkSubmit(force)
355
+ if (!isValid) {
356
+ return
357
+ }
358
+
359
+ const isDisabled = stepItems.value[cashStep]?.disabled
360
+ if (cashStep !== -1 && !isDisabled) {
361
+ stepPosition.value = cashStep
362
+ cashStep = -1
363
+ return
364
+ }
365
+
366
+ stepItems.value[stepPosition.value].complete = true
367
+ stepItems.value[stepPosition.value + 1].disabled = false
368
+ stepPosition.value++
369
+ }
370
+ const checkLocalChangeAndChangeStepStatus = (): void => {
371
+ stepItems.value = stepItems.value.map((step, index) => {
372
+ if (index > stepPosition.value) {
373
+ step.complete = false
374
+ step.disabled = index > stepPosition.value + 1
375
+ }
376
+
377
+ return step
378
+ })
379
+ }
380
+
381
+ const checkSubmit = (force = false): boolean => {
382
+ if (stepPosition.value === 0 && !force) {
383
+ nameFormSubmit.value++
384
+ return false
385
+ }
386
+ if (stepPosition.value === 1 && !force) {
387
+ storageSubmit.value++
388
+ return false
389
+ }
390
+ if (stepPosition.value === 2 && !force) {
391
+ selectOptionsSubmit.value++
392
+ return false
393
+ }
394
+ if (stepPosition.value === 3 && !force) {
395
+ customizeHardwareSubmit.value++
396
+ return false
397
+ }
398
+ return true
399
+ }
400
+ const checkSubmitByManual = (step: number): boolean => {
401
+ if (stepPosition.value === 0) {
402
+ nameFormSubmit.value++
403
+ return false
404
+ }
405
+ if (stepPosition.value === 1) {
406
+ storageSubmit.value++
407
+ return false
408
+ }
409
+ if (step === 3) {
410
+ customizeHardwareSubmit.value++
411
+ return false
412
+ }
413
+ return true
414
+ }
415
+ const onBack = (): void => {
416
+ stepPosition.value--
417
+ }
418
+ let cashStep = -1
419
+ const onChangeStep = (key: number): void => {
420
+ const isValid = checkSubmitByManual(key)
421
+ if (!isValid) {
422
+ cashStep = key
423
+ return
424
+ }
425
+
426
+ stepPosition.value = key
427
+ }
428
+
429
+ const compatibility = ref<UI_I_OptionItem[]>(capabilities.compatibility)
430
+ const maxMemory = ref<number>(capabilities.maxMemory)
431
+
432
+ const vmSettings = computed<UI_I_VmSettings | null>(() => props.vmSettings)
433
+ const vmName = ref<string>(vmSettings.value?.name || '')
434
+ watch(vmSettings, (newValue) => {
435
+ vmName.value = newValue?.name || ''
436
+ })
437
+
438
+ const onHideModal = (): void => {
439
+ emits('hide')
440
+ }
441
+ </script>
442
+
443
+ <style scoped lang="scss">
444
+ :deep(.has-solid.close-icon.clr-icon) {
445
+ width: 20px;
446
+ top: 0;
447
+ }
448
+ .vm-context {
449
+ padding: 16px 15px 10px 10px;
450
+ height: 100%;
451
+ display: flex;
452
+ flex-direction: column;
453
+
454
+ .context-title-wrap {
455
+ padding-bottom: 3px;
456
+ border-bottom: 1px solid #a6a6a6;
457
+
458
+ h4 {
459
+ font-weight: 700;
460
+ font-size: 13px;
461
+ color: var(--vm-context-title);
462
+ }
463
+ p {
464
+ font-weight: 400;
465
+ font-size: 13px;
466
+ color: var(--vm-context-sub-title);
467
+ }
468
+ }
469
+
470
+ .finish-block {
471
+ padding: 18px 24px 24px 24px;
472
+
473
+ .add-hosts-ready-to-complete-mt-12 {
474
+ margin-top: 12px;
475
+
476
+ .add-hosts-ready-to-complete-bold {
477
+ line-height: 18px;
478
+ font-weight: 700;
479
+ }
480
+ }
481
+ }
482
+
483
+ .vm-hardware-version {
484
+ align-self: flex-end;
485
+ margin-top: auto;
486
+ }
487
+ }
488
+
489
+ :deep(.modal .modal-dialog .modal-content .modal-footer) {
490
+ flex: unset;
491
+ height: unset;
492
+ min-height: unset;
493
+ }
494
+ :deep(.wizard-modal-titlebar h3) {
495
+ color: #000;
496
+ font-size: 24px;
497
+ font-weight: 200;
498
+ line-height: 27px;
499
+ margin: 0;
500
+ padding: 0;
501
+ }
502
+ :deep(.clr-wizard-stepnav-item) {
503
+ padding-left: 0;
504
+ }
505
+ :deep(.clr-wizard-stepnav
506
+ .clr-wizard-stepnav-item
507
+ button
508
+ .clr-wizard-stepnav-link-title) {
509
+ width: 189px;
510
+ font-weight: 700;
511
+ font-size: 13px;
512
+ }
513
+
514
+ #vm-wizard-notification {
515
+ h3 {
516
+ color: var(--global-font-color7);
517
+ margin-top: 6px;
518
+ }
519
+ p {
520
+ color: var(--global-font-color6);
521
+ line-height: 16px;
522
+ }
523
+ }
524
+
525
+ .power-on-by-default-wrap {
526
+ display: flex;
527
+ align-items: center;
528
+
529
+ input {
530
+ margin-right: 6px;
531
+ }
532
+ }
533
+ </style>
534
+
535
+ <style>
536
+ :root {
537
+ --vm-context-title: #333;
538
+ --vm-context-sub-title: #000;
539
+ }
540
+ :root.dark-theme {
541
+ --vm-context-title: #adbbc4;
542
+ --vm-context-sub-title: #adbbc4;
543
+ }
544
+ </style>