bfg-common 1.4.393 → 1.4.395

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 (290) hide show
  1. package/components/common/layout/theHeader/feedback/new/New.vue +12 -12
  2. package/components/common/layout/theHeader/feedback/new/additionalDetails/Headline.vue +7 -4
  3. package/components/common/layout/theHeader/feedback/new/description/Description.vue +1 -1
  4. package/components/common/layout/theHeader/feedback/new/email/Email.vue +1 -1
  5. package/components/common/layout/theHeader/feedback/new/subtitle/Subtitle.vue +6 -3
  6. package/components/common/layout/theHeader/feedback/new/tabs/Tabs.vue +24 -8
  7. package/components/common/layout/theHeader/feedback/new/tabs/lib/config/tabs.ts +2 -2
  8. package/components/common/summary/notification/Notification.vue +28 -0
  9. package/components/common/summary/notification/NotificationNew.vue +135 -0
  10. package/components/common/summary/notification/NotificationOld.vue +46 -0
  11. package/components/common/vm/actions/common/_customizeHardware/CustomizeHardware.vue +274 -0
  12. package/components/common/vm/actions/common/_customizeHardware/lib/config/navItems.ts +21 -0
  13. package/components/common/vm/actions/common/_customizeHardware/lib/models/interfaces.ts +7 -0
  14. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/VirtualHardware.vue +702 -0
  15. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/browseView/BrowseView.vue +203 -0
  16. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/browseView/lib/models/interfaces.ts +8 -0
  17. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/bus/Bus.vue +156 -0
  18. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/bus/lib/config/options.ts +20 -0
  19. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +270 -0
  20. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/config/fileTypes.ts +9 -0
  21. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/config/options.ts +11 -0
  22. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/models/types.ts +1 -0
  23. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +57 -0
  24. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Cpu.vue +403 -0
  25. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Hv.vue +99 -0
  26. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Iommu.vue +55 -0
  27. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Pc.vue +55 -0
  28. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Sa.vue +106 -0
  29. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/lib/config/cpuOptions.ts +21 -0
  30. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/shares/Shares.vue +160 -0
  31. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -0
  32. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/tooltip/Tooltip.vue +59 -0
  33. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/config/binaryOptions.ts +12 -0
  34. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/config/dropdownItems.ts +66 -0
  35. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/models/interfaces.ts +118 -0
  36. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/models/types.ts +4 -0
  37. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/limit/Limit.vue +236 -0
  38. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/limit/lib/config/options.ts +28 -0
  39. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/Memory.vue +329 -0
  40. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/lib/config/memoryOptions.ts +35 -0
  41. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +462 -0
  42. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +81 -0
  43. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/cache/lib/config/options.ts +7 -0
  44. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +153 -0
  45. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/limitIops/lib/config/options.ts +28 -0
  46. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/Location.vue +172 -0
  47. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/StorageModalOld.vue +52 -0
  48. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/mode/Mode.vue +88 -0
  49. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/mode/lib/config/options.ts +18 -0
  50. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +88 -0
  51. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/provisioning/lib/config/options.ts +15 -0
  52. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/sharing/Sharing.vue +86 -0
  53. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/sharing/lib/config/options.ts +12 -0
  54. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/Location.vue +145 -0
  55. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +305 -0
  56. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +87 -0
  57. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/adapterType/lib/config/options.ts +9 -0
  58. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +148 -0
  59. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/macAddress/lib/config/options.ts +11 -0
  60. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +168 -0
  61. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +48 -0
  62. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +49 -0
  63. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/lib/config/options.ts +10 -0
  64. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/lib/config/options.ts +7 -0
  65. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/note/Note.vue +27 -0
  66. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +42 -0
  67. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelection.vue +57 -0
  68. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +82 -0
  69. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newUsbController/lib/config/options.ts +6 -0
  70. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/other/Other.vue +32 -0
  71. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/reservation/Reservation.vue +237 -0
  72. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/reservation/lib/config/options.ts +33 -0
  73. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/Graphics.vue +50 -0
  74. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/VideoCard.vue +182 -0
  75. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/lib/config/options.ts +11 -0
  76. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/model/Model.vue +59 -0
  77. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/model/lib/config/options.ts +10 -0
  78. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +83 -0
  79. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/numberDisplays/lib/config/options.ts +14 -0
  80. package/components/common/vm/actions/common/_customizeHardware/vmoptions/Vmoptions.vue +181 -0
  81. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/BootOptions.vue +114 -0
  82. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/Secure.vue +50 -0
  83. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/delay/Delay.vue +54 -0
  84. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/delay/lib/config/config.ts +14 -0
  85. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +84 -0
  86. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/firmware/lib/config/config.ts +11 -0
  87. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/order/Order.vue +201 -0
  88. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/order/lib/models/interfaces.ts +9 -0
  89. package/components/common/vm/actions/common/_customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +192 -0
  90. package/components/common/vm/actions/common/_customizeHardware/vmoptions/lib/models/interfaces.ts +34 -0
  91. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/PlaybackCompression.vue +52 -0
  92. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/PowerControl.vue +50 -0
  93. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +254 -0
  94. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/ImgCompression.vue +85 -0
  95. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/lib/config/config.ts +14 -0
  96. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/JpegCompression.vue +85 -0
  97. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/lib/config/config.ts +12 -0
  98. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +56 -0
  99. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/keymap/lib/config/config.ts +6 -0
  100. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/MouseMode.vue +57 -0
  101. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/lib/config/config.ts +11 -0
  102. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +142 -0
  103. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/lib/models/interfaces.ts +5 -0
  104. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/lib/utils.ts +12 -0
  105. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/SharePolicy.vue +56 -0
  106. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/lib/config/config.ts +11 -0
  107. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +85 -0
  108. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/lib/config/config.ts +12 -0
  109. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/type/Type.vue +85 -0
  110. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/type/lib/config/config.ts +7 -0
  111. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +57 -0
  112. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/lib/config/config.ts +14 -0
  113. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/ZlibCompression.vue +85 -0
  114. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/lib/config/config.ts +12 -0
  115. package/components/common/vm/actions/common/_customizeHardware/vmoptions/tools/Tools.vue +72 -0
  116. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +119 -126
  117. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +189 -0
  118. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +158 -0
  119. package/components/common/vm/actions/common/customizeHardware/lib/config/navItems.ts +17 -2
  120. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +165 -182
  121. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +392 -0
  122. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +267 -0
  123. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +34 -93
  124. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/BusNew.vue +118 -0
  125. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/BusOld.vue +109 -0
  126. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +69 -111
  127. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveNew.vue +159 -0
  128. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveOld.vue +158 -0
  129. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +13 -45
  130. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +55 -0
  131. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaOld.vue +42 -0
  132. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +73 -139
  133. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +185 -0
  134. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuOld.vue +174 -0
  135. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Hv.vue +90 -90
  136. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Iommu.vue +50 -50
  137. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Pc.vue +50 -50
  138. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Sa.vue +98 -98
  139. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/coresPerSocket/CoresPerSocket.vue +86 -0
  140. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/coresPerSocket/CoresPerSocketNew.vue +68 -0
  141. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/coresPerSocket/CoresPerSocketOld.vue +63 -0
  142. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/cpuHotPlug/CpuHotPlug.vue +40 -0
  143. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/cpuHotPlug/CpuHotPlugNew.vue +31 -0
  144. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/cpuHotPlug/CpuHotPlugOld.vue +38 -0
  145. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/cpuModel/CpuModel.vue +121 -0
  146. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/cpuModel/CpuModelNew.vue +209 -0
  147. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/cpuModel/CpuModelOld.vue +171 -0
  148. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/maxCpu/MaxCpu.vue +94 -0
  149. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/maxCpu/MaxCpuNew.vue +40 -0
  150. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/maxCpu/MaxCpuOld.vue +51 -0
  151. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +29 -49
  152. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/SharesNew.vue +58 -0
  153. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/SharesOld.vue +76 -0
  154. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/Tooltip.vue +10 -48
  155. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/TooltipNew.vue +111 -0
  156. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/TooltipOld.vue +59 -0
  157. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +83 -2
  158. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +32 -52
  159. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/LimitNew.vue +70 -0
  160. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/LimitOld.vue +75 -0
  161. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +53 -94
  162. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryNew.vue +151 -0
  163. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryOld.vue +154 -0
  164. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/hotPlug/HotPlug.vue +29 -0
  165. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/hotPlug/HotPlugNew.vue +30 -0
  166. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/hotPlug/HotPlugOld.vue +43 -0
  167. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +77 -188
  168. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +224 -0
  169. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +240 -0
  170. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +21 -47
  171. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/cache/CacheNew.vue +40 -0
  172. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/cache/CacheOld.vue +57 -0
  173. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/file/File.vue +22 -0
  174. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/file/FileNew.vue +28 -0
  175. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/file/FileOld.vue +24 -0
  176. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +32 -85
  177. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIopsNew.vue +63 -0
  178. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIopsOld.vue +86 -0
  179. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +5 -16
  180. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/StorageModal.vue +52 -0
  181. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/StorageModalNew.vue +74 -0
  182. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/StorageModalOld.vue +1 -1
  183. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/maximumSize/MaximumSize.vue +23 -0
  184. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/maximumSize/MaximumSizeNew.vue +28 -0
  185. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/maximumSize/MaximumSizeOld.vue +25 -0
  186. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/Mode.vue +24 -47
  187. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/ModeNew.vue +46 -0
  188. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/ModeOld.vue +57 -0
  189. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +24 -51
  190. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/provisioning/ProvisioningNew.vue +44 -0
  191. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/provisioning/ProvisioningOld.vue +58 -0
  192. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/Sharing.vue +24 -47
  193. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/SharingNew.vue +44 -0
  194. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/SharingOld.vue +58 -0
  195. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +56 -89
  196. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetworkNew.vue +124 -0
  197. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetworkOld.vue +131 -0
  198. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +22 -49
  199. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/adapterType/AdapterTypeNew.vue +49 -0
  200. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/adapterType/AdapterTypeOld.vue +60 -0
  201. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +51 -80
  202. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressNew.vue +69 -0
  203. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressOld.vue +84 -0
  204. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +1 -1
  205. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +16 -40
  206. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +53 -0
  207. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerOld.vue +61 -0
  208. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +8 -24
  209. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/OtherNew.vue +27 -0
  210. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/OtherOld.vue +32 -0
  211. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/inputDevices/InputDevices.vue +15 -0
  212. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/inputDevices/InputDevicesNew.vue +33 -0
  213. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/inputDevices/InputDevicesOld.vue +21 -0
  214. package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/Reservation.vue +30 -71
  215. package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/ReservationNew.vue +98 -0
  216. package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/ReservationOld.vue +96 -0
  217. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +39 -77
  218. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +96 -0
  219. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +108 -0
  220. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/Model.vue +16 -41
  221. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/ModelNew.vue +40 -0
  222. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/ModelOld.vue +44 -0
  223. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +21 -47
  224. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplaysNew.vue +45 -0
  225. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplaysOld.vue +56 -0
  226. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/totalVideoMemory/TotalVideoMemory.vue +105 -0
  227. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/totalVideoMemory/TotalVideoMemoryNew.vue +54 -0
  228. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/totalVideoMemory/TotalVideoMemoryOld.vue +60 -0
  229. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +57 -93
  230. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +102 -0
  231. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +96 -0
  232. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +39 -53
  233. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +75 -0
  234. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsOld.vue +80 -0
  235. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +13 -41
  236. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/DelayNew.vue +35 -0
  237. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/DelayOld.vue +41 -0
  238. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +20 -47
  239. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/FirmwareNew.vue +42 -0
  240. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/FirmwareOld.vue +56 -0
  241. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/menu/Menu.vue +20 -0
  242. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/menu/MenuNew.vue +25 -0
  243. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/menu/MenuOld.vue +36 -0
  244. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +13 -43
  245. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +50 -0
  246. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderOld.vue +60 -0
  247. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +40 -155
  248. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +141 -0
  249. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +137 -0
  250. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +140 -0
  251. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/Old.vue +254 -0
  252. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/PowerControl.vue +1 -1
  253. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +28 -110
  254. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPaste.vue +26 -0
  255. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPasteNew.vue +30 -0
  256. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPasteOld.vue +41 -0
  257. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransfer.vue +26 -0
  258. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransferNew.vue +30 -0
  259. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransferOld.vue +41 -0
  260. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/folderSharing/FolderSharing.vue +20 -0
  261. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/folderSharing/FolderSharingNew.vue +30 -0
  262. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/folderSharing/FolderSharingOld.vue +37 -0
  263. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +16 -40
  264. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/KeymapNew.vue +39 -0
  265. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/KeymapOld.vue +43 -0
  266. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +32 -73
  267. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordNew.vue +100 -0
  268. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordOld.vue +92 -0
  269. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +13 -42
  270. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionNew.vue +38 -0
  271. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -0
  272. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +15 -38
  273. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsNew.vue +39 -0
  274. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsOld.vue +48 -0
  275. package/package.json +2 -2
  276. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/virtualHardware/cpu/CoresPerSocket.vue +0 -0
  277. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/virtualHardware/cpu/CpuHotPlug.vue +0 -0
  278. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/virtualHardware/cpu/CpuModel.vue +0 -0
  279. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/virtualHardware/cpu/MaxCpu.vue +0 -0
  280. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/virtualHardware/memory/MemoryHotPlug.vue +0 -0
  281. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/virtualHardware/newHardDisk/DiskFile.vue +0 -0
  282. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/virtualHardware/newHardDisk/MaximumSize.vue +0 -0
  283. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/virtualHardware/newHardDisk/location/storageModalNew/StorageModalNew.vue +0 -0
  284. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/virtualHardware/newHardDisk/location/storageModalNew/lib/config/table.ts +0 -0
  285. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/virtualHardware/other/InputDevices.vue +0 -0
  286. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/virtualHardware/videoCard/TotalVideoMemory.vue +0 -0
  287. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/vmoptions/bootOptions/Menu.vue +0 -0
  288. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/vmoptions/remoteConsoleOptions/CopyPaste.vue +0 -0
  289. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/vmoptions/remoteConsoleOptions/FileTransfer.vue +0 -0
  290. /package/components/common/vm/actions/common/{customizeHardware → _customizeHardware}/vmoptions/remoteConsoleOptions/FolderSharing.vue +0 -0
@@ -0,0 +1,236 @@
1
+ <template>
2
+ <div class="">
3
+ <atoms-stack-block :has-children="false">
4
+ <template #stackBlockKey>
5
+ {{ localization.common.limit }}
6
+ </template>
7
+ <template #stackBlockContent>
8
+ <div class="flex-align-center">
9
+ <div class="tooltip-top-left combobox-container flex-align-center">
10
+ <atoms-tooltip-error
11
+ :has-error="!!limitLocalAndApiErrorsTexts"
12
+ :selector="`#vm-wizard-${props.componentType}-limit input`"
13
+ @remove="onRemoveValidationError"
14
+ >
15
+ <template #elem>
16
+ <atoms-combobox
17
+ :id="`vm-wizard-${props.componentType}-limit`"
18
+ v-model="limitLocalByLocalization"
19
+ :items="limitOptionsLocal"
20
+ :disabled="props.disabled"
21
+ :test-id="`vm-wizard-${props.componentType}-limit`"
22
+ @click.stop
23
+ @select="onSelectLimit"
24
+ />
25
+ </template>
26
+ <template #content>{{ limitLocalAndApiErrorsTexts }}</template>
27
+ </atoms-tooltip-error>
28
+ </div>
29
+ <div class="select">
30
+ <select
31
+ id="vm-wizard-limit-type-select"
32
+ v-model="limitTypeLocal"
33
+ :data-id="`vm-wizard-${props.componentType}-limit-type-select`"
34
+ :disabled="props.disabled"
35
+ >
36
+ <option
37
+ v-for="(item, key) in limitTypeOptions"
38
+ :key="key"
39
+ :value="item.value"
40
+ >
41
+ {{ item.text }}
42
+ </option>
43
+ </select>
44
+ </div>
45
+ </div>
46
+ </template>
47
+ </atoms-stack-block>
48
+ </div>
49
+ </template>
50
+
51
+ <script setup lang="ts">
52
+ import {
53
+ limitOptionsFunc,
54
+ limitTypeOptionsFunc,
55
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/lib/config/options'
56
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
57
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
58
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
59
+
60
+ const localization = computed<UI_I_Localization>(() => useLocal())
61
+
62
+ const props = withDefaults(
63
+ defineProps<{
64
+ limit: string
65
+ limitType: string
66
+ type: 'mb' | 'mhz'
67
+ componentType: string
68
+ errorValidationFields: UI_I_ErrorValidationField<string>[]
69
+ disabled?: boolean
70
+ limitOptions?: UI_I_OptionItem[]
71
+ multiply?: number
72
+ }>(),
73
+ {
74
+ limitOptions: undefined,
75
+ multiply: 1,
76
+ }
77
+ )
78
+ const emits = defineEmits<{
79
+ (event: 'update:limit', value: string): void
80
+ (event: 'update:limit-type', value: string): void
81
+ (event: 'invalid', value: boolean): void
82
+ (event: 'remove-error-by-title', value: string): void
83
+ }>()
84
+
85
+ const typeError = computed<string>(() => `${props.componentType}.limit_mb`)
86
+
87
+ const apiErrorLocal = computed<string>(() => {
88
+ return (
89
+ props.errorValidationFields?.find(
90
+ (message) => message.field === typeError.value
91
+ )?.error_message || ''
92
+ )
93
+ })
94
+
95
+ const binaryKeys: [string, string] =
96
+ props.type === 'mb' ? ['mb', 'gb'] : ['mhz', 'ghz']
97
+
98
+ const limitOptionsLocal = computed<UI_I_OptionItem[]>(
99
+ () => props.limitOptions || limitOptionsFunc(localization.value, binaryKeys)
100
+ )
101
+ const limitTypeOptions = ref<UI_I_OptionItem[]>(
102
+ limitTypeOptionsFunc(localization.value, binaryKeys)
103
+ )
104
+
105
+ const limitLocalByLocalization = computed<string>({
106
+ get() {
107
+ return limitLocal.value === 'Unlimited'
108
+ ? localization.value.common.unlimited
109
+ : limitLocal.value
110
+ },
111
+ set(newValue) {
112
+ limitLocal.value =
113
+ newValue === localization.value.common.unlimited ? 'Unlimited' : newValue
114
+ },
115
+ })
116
+ const limitLocal = computed<string>({
117
+ get() {
118
+ return props.limit
119
+ },
120
+ set(newValue) {
121
+ emits('update:limit', '' + newValue)
122
+ },
123
+ })
124
+ const limitTypeLocal = computed<string>({
125
+ get() {
126
+ return props.limitType
127
+ },
128
+ set(newValue) {
129
+ emits('update:limit-type', newValue)
130
+ },
131
+ })
132
+
133
+ const { $binary } = useNuxtApp()
134
+ const onSelectLimit = ({
135
+ value,
136
+ type,
137
+ }: {
138
+ value: number | 'Unlimited'
139
+ type: string
140
+ }): void => {
141
+ limitLocal.value = '' + value
142
+ if (limitTypeLocal.value !== type) {
143
+ limitTypeLocal.value = type
144
+ }
145
+
146
+ // if (limitTypeLocal.value === binaryKeys[0] || value === 'Unlimited') {
147
+ // limitLocal.value = '' + value
148
+ // return
149
+ // }
150
+ //
151
+ // limitLocal.value =
152
+ // '' + $binary.universalFromTo(value, binaryKeys[0], binaryKeys[1], 8)
153
+ }
154
+
155
+ const limitErrorLocalText = computed<string>(() => {
156
+ const valueForMin = $binary.universalFromTo(
157
+ +limitLocal.value,
158
+ limitTypeLocal.value,
159
+ limitOptionsLocal.value[0].value.type,
160
+ 0
161
+ )
162
+ const valueForMax = $binary.universalFromTo(
163
+ +limitLocal.value,
164
+ limitTypeLocal.value,
165
+ limitOptionsLocal.value[1].value.type,
166
+ 0
167
+ )
168
+ const minValue = limitOptionsLocal.value[0].value.value
169
+ const maxValue = limitOptionsLocal.value[1].value.value
170
+ if (valueForMin < minValue) {
171
+ return localization.value.common.limitMustBe.replace(
172
+ '{0}',
173
+ `${minValue} ${localization.value.common[binaryKeys[0]]}`
174
+ )
175
+ }
176
+ if (props.limitOptions && valueForMax > maxValue) {
177
+ return localization.value.common.limitMustBeMax.replace(
178
+ '{0}',
179
+ `${maxValue} ${localization.value.common[binaryKeys[0]]}`
180
+ )
181
+ }
182
+
183
+ const validValue = /^\d+(\.\d+)?$/.test(limitLocal.value)
184
+ if (
185
+ !validValue &&
186
+ (limitLocal.value !== limitOptionsLocal.value[1].value.value ||
187
+ props.limitOptions)
188
+ ) {
189
+ return localization.value.common.inputContainsInvalidCharacters
190
+ }
191
+
192
+ if (limitLocal.value !== 'Unlimited') {
193
+ const value = $binary.universalFromTo(
194
+ +limitLocal.value,
195
+ limitTypeLocal.value,
196
+ binaryKeys[0],
197
+ 0
198
+ )
199
+ if (value % props.multiply !== 0) {
200
+ return localization.value.common.valueShouldMultiple.replace(
201
+ '{0}',
202
+ `${props.multiply} ${binaryKeys[0].toUpperCase()}`
203
+ )
204
+ }
205
+ }
206
+
207
+ return ''
208
+ })
209
+ const limitInvalid = computed<boolean>(() => !!limitErrorLocalText.value)
210
+ watch(
211
+ limitInvalid,
212
+ (newValue) => {
213
+ emits('invalid', newValue)
214
+ },
215
+ { immediate: true }
216
+ )
217
+
218
+ const limitLocalAndApiErrorsTexts = computed<string>(() => {
219
+ const localError = limitErrorLocalText.value
220
+ const apiError = apiErrorLocal.value
221
+
222
+ let result = ''
223
+ if (localError && !apiError) result = localError
224
+ if (!localError && apiError) result = apiError
225
+ if (localError && apiError) result = localError + ', ' + apiError
226
+ if (!localError && apiError) result = apiError
227
+
228
+ return result
229
+ })
230
+
231
+ const onRemoveValidationError = (): void => {
232
+ emits('remove-error-by-title', typeError.value)
233
+ }
234
+ </script>
235
+
236
+ <style scoped></style>
@@ -0,0 +1,28 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
+
4
+ export const limitOptionsFunc = (
5
+ localization: UI_I_Localization,
6
+ binaryKeys: [string, string]
7
+ ): UI_I_OptionItem[] => {
8
+ return [
9
+ {
10
+ text: `${localization.common.minimum}: 0 ${localization.common[binaryKeys[0]]}`,
11
+ value: { value: 0, type: binaryKeys[0] },
12
+ },
13
+ {
14
+ text: `${localization.common.maximum}: ${localization.common.unlimited}`,
15
+ value: { value: 'Unlimited', type: binaryKeys[0] },
16
+ },
17
+ ]
18
+ }
19
+
20
+ export const limitTypeOptionsFunc = (
21
+ localization: UI_I_Localization,
22
+ binaryKeys: [string, string]
23
+ ): UI_I_OptionItem[] => {
24
+ return [
25
+ { text: localization.common[binaryKeys[0]], value: binaryKeys[0] },
26
+ { text: localization.common[binaryKeys[1]], value: binaryKeys[1] },
27
+ ]
28
+ }
@@ -0,0 +1,329 @@
1
+ <template>
2
+ <div class="hardware-memory">
3
+ <atoms-stack-block :has-children="true" test-id="memory-stack-block">
4
+ <template #stackBlockKey>
5
+ <div
6
+ id="vm-wizard-toggle-block-memory"
7
+ data-id="vm-wizard-toggle-block-memory"
8
+ class="flex-align-center"
9
+ >
10
+ <span>{{ localization.common.memory }}</span>
11
+ <atoms-the-icon
12
+ v-show="memoryInvalid"
13
+ width="24px"
14
+ height="24px"
15
+ class="is-error tooltip-trigger"
16
+ name="info"
17
+ />
18
+ </div>
19
+ </template>
20
+ <template #stackBlockContent>
21
+ <div class="flex-align-center">
22
+ <atoms-tooltip-error
23
+ :has-error="!!memorySizeLocalAndApiErrorsTexts"
24
+ selector="#vm-wizard-memory-field input"
25
+ @remove="onRemoveValidationError"
26
+ >
27
+ <template #elem>
28
+ <atoms-combobox
29
+ id="vm-wizard-memory-field"
30
+ v-model="selectedMemory"
31
+ :items="memoryOptions"
32
+ :disabled="isMemoryDisabled"
33
+ test-id="vm-wizard-memory-field"
34
+ class="input-text-color"
35
+ @click.stop
36
+ @select="onSelectMemory"
37
+ />
38
+ </template>
39
+ <template #content>{{ memorySizeLocalAndApiErrorsTexts }}</template>
40
+ </atoms-tooltip-error>
41
+
42
+ <div class="select ml-1">
43
+ <select
44
+ id="vm-wizard-memory-type-select"
45
+ v-model="memoryType"
46
+ data-id="vm-wizard-memory-type-select"
47
+ class="input-text-color"
48
+ @click.stop
49
+ >
50
+ <option
51
+ v-for="(item, key) in memoryTypeOptions"
52
+ :key="key"
53
+ :value="item.value"
54
+ >
55
+ {{ item.text }}
56
+ </option>
57
+ </select>
58
+ </div>
59
+ </div>
60
+ </template>
61
+ <template #stackChildren>
62
+ <common-vm-actions-common-customize-hardware-virtual-hardware-reservation
63
+ v-model:reservation="reservation"
64
+ v-model:reservation-type="reservationType"
65
+ v-model:reserve-guest-memory="reserveGuestMemory"
66
+ :error-validation-fields="props.errorValidationFields"
67
+ :multiply="2"
68
+ :disabled="isDisabled"
69
+ component-type="memory"
70
+ type="mb"
71
+ class="memory-reservation"
72
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
73
+ @invalid="reservationInvalid = $event"
74
+ />
75
+ <common-vm-actions-common-customize-hardware-virtual-hardware-limit
76
+ v-model:limit="limit"
77
+ v-model:limit-type="limitType"
78
+ :error-validation-fields="props.errorValidationFields"
79
+ :limit-options="limitOptions"
80
+ :multiply="2"
81
+ :disabled="isDisabled"
82
+ type="mb"
83
+ component-type="memory"
84
+ class="memory-limit"
85
+ @invalid="limitInvalid = $event"
86
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
87
+ />
88
+ <common-vm-actions-common-customize-hardware-virtual-hardware-memory-hot-plug
89
+ v-model:memory-hot-plug="memoryHotPlug"
90
+ :disabled="isDisabledMemoryHotPlug"
91
+ />
92
+ </template>
93
+ </atoms-stack-block>
94
+ </div>
95
+ </template>
96
+
97
+ <script setup lang="ts">
98
+ import type { API_UI_I_VmEditMemory } from '~/lib/models/store/vm/interfaces'
99
+ import type { UI_I_SendDataMemory } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
100
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
101
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
102
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
103
+ import {
104
+ memoryOptionsFunc,
105
+ memoryTypeOptionsFunc,
106
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/lib/config/memoryOptions'
107
+
108
+ const props = defineProps<{
109
+ maxMemory: number
110
+ isEdit: boolean
111
+ errorValidationFields: UI_I_ErrorValidationField[]
112
+ state?: string | number
113
+ memory?: API_UI_I_VmEditMemory
114
+ }>()
115
+ const emits = defineEmits<{
116
+ (event: 'send-data', value: UI_I_SendDataMemory): void
117
+ (event: 'invalid', value: boolean): void
118
+ (event: 'remove-error-by-title', value: string): void
119
+ }>()
120
+
121
+ const localization = computed<UI_I_Localization>(() => useLocal())
122
+ const { $binary } = useNuxtApp()
123
+
124
+ const minMemoryInMb = 128
125
+ watch(
126
+ () => props.maxMemory,
127
+ (newValue) => {
128
+ memoryOptions.value = memoryOptionsFunc(
129
+ localization.value,
130
+ minMemoryInMb,
131
+ newValue
132
+ )
133
+ }
134
+ )
135
+
136
+ const isDisabled = computed<boolean>(() => {
137
+ return props.state === 2
138
+ })
139
+
140
+ const isMemoryDisabled = computed<boolean>(
141
+ () => isDisabled.value && !memoryHotPlug.value
142
+ )
143
+
144
+ const selectedMemory = ref<number>(4)
145
+ watch(selectedMemory, (newValue) => {
146
+ const valueInt = parseInt('' + newValue)
147
+ selectedMemory.value = isNaN(valueInt) ? 0 : valueInt
148
+ })
149
+ const memoryType = ref<string>('gb')
150
+ const memoryTypeOptions = ref<UI_I_OptionItem[]>(
151
+ memoryTypeOptionsFunc(localization.value)
152
+ )
153
+ const memoryInMb = computed<number>(() => {
154
+ if (memoryType.value === 'mb') {
155
+ return +selectedMemory.value
156
+ }
157
+
158
+ return $binary.universalFromTo(+selectedMemory.value, memoryType.value, 'mb')
159
+ })
160
+
161
+ const memoryOptions = ref<UI_I_OptionItem[]>(
162
+ memoryOptionsFunc(localization.value, minMemoryInMb, props.maxMemory)
163
+ )
164
+ const onSelectMemory = ({
165
+ value,
166
+ type,
167
+ }: {
168
+ value: number
169
+ type: string
170
+ }): void => {
171
+ selectedMemory.value = value
172
+ if (memoryType.value !== type) {
173
+ memoryType.value = type
174
+ }
175
+ // if (memoryType.value === 'mb') {
176
+ // selectedMemory.value = mb
177
+ // return
178
+ // }
179
+ //
180
+ // selectedMemory.value = $binary.universalFromTo(mb, 'mb', memoryType.value, 12)
181
+ }
182
+
183
+ const memoryErrorLocalText = computed<string>(() => {
184
+ const validValue = /^\d+(\.\d+)?$/.test(selectedMemory.value + '')
185
+ if (!validValue) {
186
+ return localization.value.common.inputContainsInvalidCharacters
187
+ }
188
+
189
+ const maxMemoryInGb = $binary.mbToGb(props.maxMemory)
190
+ if (memoryInMb.value < minMemoryInMb || memoryInMb.value > props.maxMemory) {
191
+ return localization.value.common.memoryMustBe
192
+ .replace('{0}', `${minMemoryInMb} ${localization.value.common.mb}`)
193
+ .replace('{1}', `${maxMemoryInGb} ${localization.value.common.gb}`)
194
+ }
195
+
196
+ if (memoryInMb.value % 2 !== 0) {
197
+ return localization.value.common.valueShouldMultiple.replace(
198
+ '{0}',
199
+ `${2} ${localization.value.common.mb}`
200
+ )
201
+ }
202
+ return ''
203
+ })
204
+
205
+ const apiErrorLocal = computed<string>(() => {
206
+ return (
207
+ props.errorValidationFields?.find(
208
+ (message) => message.field === 'memory.size_mb'
209
+ )?.error_message || ''
210
+ )
211
+ })
212
+
213
+ const memorySizeLocalAndApiErrorsTexts = computed<string>(() => {
214
+ const localError = memoryErrorLocalText.value
215
+ const apiError = apiErrorLocal.value
216
+
217
+ let result = ''
218
+ if (localError && !apiError) result = localError
219
+ if (apiError && !localError) result = apiError
220
+ if (localError && apiError) result = localError + ', ' + apiError
221
+ if (!localError && apiError) result = apiError
222
+
223
+ return result
224
+ })
225
+
226
+ const reservationInvalid = ref<boolean>(false)
227
+ const limitInvalid = ref<boolean>(false)
228
+ const memoryInvalid = computed<boolean>(
229
+ () =>
230
+ !!memorySizeLocalAndApiErrorsTexts.value ||
231
+ reservationInvalid.value ||
232
+ limitInvalid.value
233
+ )
234
+ watch(
235
+ memoryInvalid,
236
+ (newValue) => {
237
+ emits('invalid', newValue)
238
+ },
239
+ { immediate: true }
240
+ )
241
+
242
+ const reservation = ref<string>('2')
243
+ watch(reservation, (newValue) => {
244
+ const valueInt = parseInt('' + newValue)
245
+ reservation.value = isNaN(valueInt) ? '0' : '' + valueInt
246
+ })
247
+ const reservationType = ref<string>('mb')
248
+ const reserveGuestMemory = ref<boolean>(false)
249
+
250
+ const limit = ref<string>('Unlimited')
251
+ watch(limit, (newValue) => {
252
+ const valueInt = parseInt('' + newValue)
253
+ limit.value !== 'Unlimited' &&
254
+ (limit.value = isNaN(valueInt) ? '0' : '' + valueInt)
255
+ })
256
+ const limitType = ref<string>('mb')
257
+ const limitOptions = computed<UI_I_OptionItem[] | undefined>(() => {
258
+ if (memoryHotPlug.value)
259
+ return memoryOptionsFunc(
260
+ localization.value,
261
+ memoryInMb.value,
262
+ props.maxMemory
263
+ )
264
+ })
265
+
266
+ const memoryHotPlug = ref<boolean>(false)
267
+ const isDisabledMemoryHotPlug = computed<boolean>(
268
+ () => memoryInMb.value >= props.maxMemory || isDisabled.value
269
+ )
270
+ watch(isDisabledMemoryHotPlug, (newValue) => {
271
+ if (newValue) memoryHotPlug.value = false
272
+ })
273
+
274
+ watch(
275
+ [memoryInMb, memoryHotPlug, reservation, reservationType, limit, limitType],
276
+ () => {
277
+ const reservationInMb =
278
+ reservationType.value === 'mb'
279
+ ? reservation.value
280
+ : '' +
281
+ $binary.universalFromTo(
282
+ reservation.value,
283
+ reservationType.value,
284
+ 'mb',
285
+ 12
286
+ )
287
+ const limitInMb =
288
+ limit.value === 'Unlimited'
289
+ ? limit.value
290
+ : limitType.value === 'gb'
291
+ ? $binary.gbToMb(+limit.value)
292
+ : +limit.value
293
+ emits('send-data', {
294
+ memory: '' + memoryInMb.value,
295
+ hotplug: memoryHotPlug.value,
296
+ reservation_mb: reservationInMb,
297
+ limit_mb: limitInMb,
298
+ })
299
+ },
300
+ { immediate: true }
301
+ )
302
+
303
+ // Добавляем данные для редактирования
304
+ watch(
305
+ () => props.memory,
306
+ (newValue) => {
307
+ if (!newValue) return
308
+
309
+ const sizeInGb = $binary.mbToGb(newValue.size_mb)
310
+ if (sizeInGb < 1) {
311
+ selectedMemory.value = newValue.size_mb
312
+ memoryType.value = 'mb'
313
+ } else {
314
+ selectedMemory.value = sizeInGb
315
+ }
316
+
317
+ reservation.value = '' + newValue.reservation_mb
318
+ limit.value = '' + newValue.limit_mb
319
+ memoryHotPlug.value = newValue.hotplug
320
+ },
321
+ { immediate: true }
322
+ )
323
+
324
+ const onRemoveValidationError = (): void => {
325
+ emits('remove-error-by-title', 'memory.size_mb')
326
+ }
327
+ </script>
328
+
329
+ <style scoped lang="scss"></style>
@@ -0,0 +1,35 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
+
4
+ export const memoryOptionsFunc = (
5
+ localization: UI_I_Localization,
6
+ min: number,
7
+ max: number
8
+ ): UI_I_OptionItem[] => {
9
+ const { $binary } = useNuxtApp()
10
+ const minValueText = $binary.round(min)
11
+ const [value, type] = minValueText.split(' ')
12
+ const maxValue = $binary.mbToGb(max, 0)
13
+
14
+ return [
15
+ {
16
+ text: `${localization.common.minimum}: ${minValueText}`,
17
+ value: { value: +value, type: type.toLowerCase() },
18
+ testId: 'option-minimum-memory',
19
+ },
20
+ {
21
+ text: `${localization.common.maximum}: ${maxValue} ${localization.common.gb}`,
22
+ value: { value: maxValue, type: 'gb' },
23
+ testId: 'option-minimum-memory',
24
+ },
25
+ ]
26
+ }
27
+
28
+ export const memoryTypeOptionsFunc = (
29
+ localization: UI_I_Localization
30
+ ): UI_I_OptionItem[] => {
31
+ return [
32
+ { text: localization.common.mb, value: 'mb' },
33
+ { text: localization.common.gb, value: 'gb' },
34
+ ]
35
+ }