bfg-common 1.5.591 → 1.5.592

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 (261) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  4. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  5. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  6. package/components/atoms/TheIcon3.vue +50 -50
  7. package/components/atoms/collapse/CollapseNav.vue +170 -170
  8. package/components/atoms/perPage/PerPage.vue +58 -58
  9. package/components/atoms/table/dataGrid/DataGrid.vue +1718 -1718
  10. package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
  11. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  12. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  13. package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
  14. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  15. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  16. package/components/common/browse/lib/models/interfaces.ts +5 -5
  17. package/components/common/diagramMain/network/Contents.vue +497 -497
  18. package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
  19. package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
  20. package/components/common/pages/backups/DetailView.vue +52 -52
  21. package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
  22. package/components/common/pages/backups/modals/Modals.vue +243 -243
  23. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  24. package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
  25. package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
  26. package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
  27. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
  28. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  29. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  30. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  31. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  32. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  33. package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
  34. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  35. package/components/common/select/radio/RadioGroup.vue +137 -137
  36. package/components/common/spiceConsole/Drawer.vue +420 -420
  37. package/components/common/spiceConsole/SpiceConsole.vue +184 -184
  38. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  39. package/components/common/tools/Actions.vue +207 -207
  40. package/components/common/treeView/TreeView.vue +52 -52
  41. package/components/common/vm/actions/add/Add.vue +819 -886
  42. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +205 -241
  43. package/components/common/vm/actions/common/customizeHardware/{CustomizeHardwareNew.vue → New.vue} +325 -325
  44. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +679 -733
  45. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +101 -110
  46. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +227 -252
  47. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +29 -30
  48. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +322 -348
  49. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/coresPerSocket/CoresPerSocket.vue +81 -86
  50. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/hotPlug/HotPlug.vue +40 -40
  51. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/maxCpu/MaxCpu.vue +91 -94
  52. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/model/Model.vue +92 -124
  53. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +133 -140
  54. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  55. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/Tooltip.vue +27 -25
  56. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +214 -221
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +280 -300
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/{MemoryNew.vue → New.vue} +158 -158
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/{MemoryOld.vue → Old.vue} +155 -155
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/hotPlug/HotPlug.vue +29 -29
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/{NewHardDiskNew.vue → New.vue} +0 -2
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +483 -521
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/{NewHardDiskOld.vue → Old.vue} +1 -6
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +59 -63
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/file/File.vue +24 -25
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +96 -103
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +142 -154
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/storageModal/StorageModal.vue +55 -61
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/maximumSize/MaximumSize.vue +26 -26
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/Mode.vue +61 -65
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +57 -61
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/Sharing.vue +59 -63
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +257 -277
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +56 -60
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/Location.vue +65 -71
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +111 -119
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +199 -210
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +27 -29
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +29 -31
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +23 -22
  81. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +40 -41
  82. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelection.vue +34 -35
  83. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +47 -47
  84. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +15 -16
  85. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/inputDevices/InputDevices.vue +15 -15
  86. package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/Reservation.vue +194 -197
  87. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +129 -140
  88. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/Model.vue +35 -37
  89. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +50 -53
  90. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/totalVideoMemory/TotalVideoMemory.vue +104 -107
  91. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +70 -76
  92. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +42 -46
  93. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  94. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +57 -60
  95. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/menu/Menu.vue +25 -26
  96. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +155 -156
  97. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +82 -86
  98. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +74 -74
  99. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPaste.vue +25 -26
  100. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransfer.vue +25 -26
  101. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/folderSharing/FolderSharing.vue +17 -20
  102. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  103. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +99 -102
  104. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  105. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +42 -42
  106. package/components/common/vm/actions/common/select/compatibility/Compatibility.vue +105 -107
  107. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  108. package/components/common/vm/actions/common/select/createType/CreateType.vue +36 -38
  109. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  110. package/components/common/vm/actions/common/select/options/Options.vue +53 -54
  111. package/components/common/vm/actions/common/select/os/Os.vue +152 -164
  112. package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
  113. package/components/common/vm/actions/common/select/storage/Storage.vue +170 -178
  114. package/components/common/vm/actions/common/select/storage/new/New.vue +311 -311
  115. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  116. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  117. package/components/common/vm/actions/common/select/template/Template.vue +75 -77
  118. package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
  119. package/components/common/vm/actions/common/select/template/treeView/TreeView.vue +85 -87
  120. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  121. package/components/common/vm/actions/register/Register.vue +352 -352
  122. package/components/common/vm/actions/register/lib/config/steps.ts +86 -86
  123. package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
  124. package/components/common/wizards/common/compatibility/New.vue +99 -99
  125. package/components/common/wizards/common/compatibility/Old.vue +53 -53
  126. package/components/common/wizards/common/steps/computeResource/ComputeResource.vue +86 -86
  127. package/components/common/wizards/common/steps/computeResource/New.vue +93 -93
  128. package/components/common/wizards/common/steps/name/Name.vue +178 -178
  129. package/components/common/wizards/common/steps/name/New.vue +221 -221
  130. package/components/common/wizards/common/steps/name/Old.vue +121 -121
  131. package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
  132. package/components/common/wizards/common/steps/name/location/Location.vue +85 -85
  133. package/components/common/wizards/common/steps/name/location/New.vue +40 -40
  134. package/components/common/wizards/datastore/add/Add.vue +228 -228
  135. package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
  136. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  137. package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +205 -205
  138. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  139. package/composables/useAppVersion.ts +21 -21
  140. package/composables/useLocal.ts +6 -6
  141. package/composables/useLocalCommon.ts +39 -39
  142. package/package.json +1 -1
  143. package/plugins/console.ts +21 -21
  144. package/plugins/date.ts +233 -233
  145. package/plugins/mouse.ts +21 -21
  146. package/plugins/panelStates.ts +70 -70
  147. package/plugins/text.ts +59 -59
  148. package/plugins/time.ts +58 -58
  149. package/public/spice-console/application/clientgui.js +854 -854
  150. package/public/spice-console/application/packetfactory.js +211 -211
  151. package/public/spice-console/application/virtualmouse.js +147 -147
  152. package/public/spice-console/lib/images/bitmap.js +203 -203
  153. package/public/spice-console/network/spicechannel.js +440 -440
  154. package/public/spice-console/process/cursorprocess.js +121 -121
  155. package/public/spice-console/process/inputprocess.js +227 -227
  156. package/public/spice-console/process/mainprocess.js +210 -210
  157. package/public/spice-console/run.js +210 -210
  158. package/store/main/mutations.ts +7 -7
  159. package/store/main/state.ts +7 -7
  160. /package/components/common/vm/actions/common/customizeHardware/{CustomizeHardwareOld.vue → Old.vue} +0 -0
  161. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/{VirtualHardwareNew.vue → New.vue} +0 -0
  162. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/{VirtualHardwareOld.vue → Old.vue} +0 -0
  163. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/{BusNew.vue → New.vue} +0 -0
  164. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/{BusOld.vue → Old.vue} +0 -0
  165. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/{CdDvdDriveNew.vue → New.vue} +0 -0
  166. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/{CdDvdDriveOld.vue → Old.vue} +0 -0
  167. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/{MediaNew.vue → New.vue} +0 -0
  168. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/{MediaOld.vue → Old.vue} +0 -0
  169. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/{CpuNew.vue → New.vue} +0 -0
  170. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/{CpuOld.vue → Old.vue} +0 -0
  171. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/coresPerSocket/{CoresPerSocketNew.vue → New.vue} +0 -0
  172. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/coresPerSocket/{CoresPerSocketOld.vue → Old.vue} +0 -0
  173. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/hotPlug/{HotPlugNew.vue → New.vue} +0 -0
  174. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/hotPlug/{HotPlugOld.vue → Old.vue} +0 -0
  175. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/maxCpu/{MaxCpuNew.vue → New.vue} +0 -0
  176. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/maxCpu/{MaxCpuOld.vue → Old.vue} +0 -0
  177. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/model/{ModelNew.vue → New.vue} +0 -0
  178. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/model/{ModelOld.vue → Old.vue} +0 -0
  179. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/{SharesNew.vue → New.vue} +0 -0
  180. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/{SharesOld.vue → Old.vue} +0 -0
  181. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/{TooltipNew.vue → New.vue} +0 -0
  182. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/{TooltipOld.vue → Old.vue} +0 -0
  183. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/{LimitNew.vue → New.vue} +0 -0
  184. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/{LimitOld.vue → Old.vue} +0 -0
  185. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/hotPlug/{HotPlugNew.vue → New.vue} +0 -0
  186. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/hotPlug/{HotPlugOld.vue → Old.vue} +0 -0
  187. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/cache/{CacheNew.vue → New.vue} +0 -0
  188. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/cache/{CacheOld.vue → Old.vue} +0 -0
  189. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/file/{FileNew.vue → New.vue} +0 -0
  190. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/file/{FileOld.vue → Old.vue} +0 -0
  191. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/{LimitIopsNew.vue → New.vue} +0 -0
  192. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/{LimitIopsOld.vue → Old.vue} +0 -0
  193. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/{LocationNew.vue → New.vue} +0 -0
  194. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/{LocationOld.vue → Old.vue} +0 -0
  195. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/maximumSize/{MaximumSizeNew.vue → New.vue} +0 -0
  196. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/maximumSize/{MaximumSizeOld.vue → Old.vue} +0 -0
  197. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/{ModeNew.vue → New.vue} +0 -0
  198. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/{ModeOld.vue → Old.vue} +0 -0
  199. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/provisioning/{ProvisioningNew.vue → New.vue} +0 -0
  200. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/provisioning/{ProvisioningOld.vue → Old.vue} +0 -0
  201. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/{SharingNew.vue → New.vue} +0 -0
  202. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/{SharingOld.vue → Old.vue} +0 -0
  203. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/{NewNetworkNew.vue → New.vue} +0 -0
  204. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/{NewNetworkOld.vue → Old.vue} +0 -0
  205. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/adapterType/{AdapterTypeNew.vue → New.vue} +0 -0
  206. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/adapterType/{AdapterTypeOld.vue → Old.vue} +0 -0
  207. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/{LocationOld.vue → Old.vue} +0 -0
  208. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/{MacAddressNew.vue → New.vue} +0 -0
  209. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/{MacAddressOld.vue → Old.vue} +0 -0
  210. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/{NewPciDeviceNew.vue → New.vue} +0 -0
  211. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/{NewPciDeviceOld.vue → Old.vue} +0 -0
  212. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/{DirectPathIoNew.vue → New.vue} +0 -0
  213. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/{DirectPathIoOld.vue → Old.vue} +0 -0
  214. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/{DynamicDirectPathIoNew.vue → New.vue} +0 -0
  215. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/{DynamicDirectPathIoOld.vue → Old.vue} +0 -0
  216. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/{NoteNew.vue → New.vue} +0 -0
  217. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/{NoteOld.vue → Old.vue} +0 -0
  218. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/{NvidiaGridNew.vue → New.vue} +0 -0
  219. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/{NvidiaGridOld.vue → Old.vue} +0 -0
  220. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/{TypeSelectionNew.vue → New.vue} +0 -0
  221. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/{TypeSelectionOld.vue → Old.vue} +0 -0
  222. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/{NewUsbControllerNew.vue → New.vue} +0 -0
  223. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/{NewUsbControllerOld.vue → Old.vue} +0 -0
  224. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/{OtherNew.vue → New.vue} +0 -0
  225. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/{OtherOld.vue → Old.vue} +0 -0
  226. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/inputDevices/{InputDevicesNew.vue → New.vue} +0 -0
  227. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/inputDevices/{InputDevicesOld.vue → Old.vue} +0 -0
  228. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/{ReservationNew.vue → New.vue} +0 -0
  229. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/{ReservationOld.vue → Old.vue} +0 -0
  230. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/{VideoCardNew.vue → New.vue} +0 -0
  231. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/{VideoCardOld.vue → Old.vue} +0 -0
  232. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/{ModelNew.vue → New.vue} +0 -0
  233. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/{ModelOld.vue → Old.vue} +0 -0
  234. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/{NumberDisplaysNew.vue → New.vue} +0 -0
  235. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/{NumberDisplaysOld.vue → Old.vue} +0 -0
  236. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/totalVideoMemory/{TotalVideoMemoryNew.vue → New.vue} +0 -0
  237. /package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/totalVideoMemory/{TotalVideoMemoryOld.vue → Old.vue} +0 -0
  238. /package/components/common/vm/actions/common/customizeHardware/vmoptions/{VmoptionsNew.vue → New.vue} +0 -0
  239. /package/components/common/vm/actions/common/customizeHardware/vmoptions/{VmoptionsOld.vue → Old.vue} +0 -0
  240. /package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/{BootOptionsNew.vue → New.vue} +0 -0
  241. /package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/{BootOptionsOld.vue → Old.vue} +0 -0
  242. /package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/{DelayNew.vue → New.vue} +0 -0
  243. /package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/{DelayOld.vue → Old.vue} +0 -0
  244. /package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/{FirmwareNew.vue → New.vue} +0 -0
  245. /package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/{FirmwareOld.vue → Old.vue} +0 -0
  246. /package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/menu/{MenuNew.vue → New.vue} +0 -0
  247. /package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/menu/{MenuOld.vue → Old.vue} +0 -0
  248. /package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/{OrderNew.vue → New.vue} +0 -0
  249. /package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/{OrderOld.vue → Old.vue} +0 -0
  250. /package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/{GeneralOptionsNew.vue → New.vue} +0 -0
  251. /package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/{GeneralOptionsOld.vue → Old.vue} +0 -0
  252. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/{CopyPasteNew.vue → New.vue} +0 -0
  253. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/{CopyPasteOld.vue → Old.vue} +0 -0
  254. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/{FileTransferNew.vue → New.vue} +0 -0
  255. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/{FileTransferOld.vue → Old.vue} +0 -0
  256. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/folderSharing/{FolderSharingNew.vue → New.vue} +0 -0
  257. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/folderSharing/{FolderSharingOld.vue → Old.vue} +0 -0
  258. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/{UsbRedirectionNew.vue → New.vue} +0 -0
  259. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/{UsbRedirectionOld.vue → Old.vue} +0 -0
  260. /package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/{ToolsNew.vue → New.vue} +0 -0
  261. /package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/{ToolsOld.vue → Old.vue} +0 -0
@@ -1,348 +1,322 @@
1
- <template>
2
- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-new
3
- v-if="isNewView"
4
- v-model="model"
5
- v-model:reservation="reservation"
6
- v-model:reservation-type="reservationType"
7
- v-model:limit="limit"
8
- v-model:limit-type="limitType"
9
- v-model:shares="shares"
10
- v-model:shares-type="sharesType"
11
- v-model:cpu-model="cpuModel"
12
- v-model:passthrough-host-cpu="passthroughHostCpu"
13
- v-model:host-model-cpu="hostModelCpu"
14
- :cpu-models="props.cpuModels"
15
- :is-edit="props.isEdit"
16
- :error-validation-fields="props.errorValidationFields"
17
- :cpu-invalid="cpuInvalid"
18
- :vcpus-local-and-api-errors-texts="vcpusLocalAndApiErrorsTexts"
19
- :cpu-options="cpuOptions"
20
- :is-cpu-disabled="isCpuDisabled"
21
- :selected-cpus="selectedCpus"
22
- :is-disabled="isDisabled"
23
- :enable-cpu-hot-add-disabled="enableCpuHotAddDisabled"
24
- :max-cpu-options="maxCpuOptions"
25
- :vm-cpu-help-text-second="vmCpuHelpTextSecond"
26
- @remove-error-by-title="emits('remove-error-by-title', $event)"
27
- @remove-validation-error="onRemoveValidationError"
28
- @max-cpu-invalid="maxCpuInvalid = $event"
29
- @reservation-invalid="reservationInvalid = $event"
30
- @limit-invalid="limitInvalid = $event"
31
- @shares-invalid="sharesInvalid = $event"
32
- />
33
- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-old
34
- v-else
35
- v-model="model"
36
- v-model:reservation="reservation"
37
- v-model:reservation-type="reservationType"
38
- v-model:limit="limit"
39
- v-model:limit-type="limitType"
40
- v-model:shares="shares"
41
- v-model:shares-type="sharesType"
42
- v-model:cpu-model="cpuModel"
43
- v-model:passthrough-host-cpu="passthroughHostCpu"
44
- v-model:host-model-cpu="hostModelCpu"
45
- :cpu-models="props.cpuModels"
46
- :is-edit="props.isEdit"
47
- :error-validation-fields="props.errorValidationFields"
48
- :cpu-invalid="cpuInvalid"
49
- :vcpus-local-and-api-errors-texts="vcpusLocalAndApiErrorsTexts"
50
- :cpu-options="cpuOptions"
51
- :is-cpu-disabled="isCpuDisabled"
52
- :selected-cpus="selectedCpus"
53
- :is-disabled="isDisabled"
54
- :enable-cpu-hot-add-disabled="enableCpuHotAddDisabled"
55
- :max-cpu-options="maxCpuOptions"
56
- :vm-cpu-help-text-second="vmCpuHelpTextSecond"
57
- @remove-error-by-title="emits('remove-error-by-title', $event)"
58
- @remove-validation-error="onRemoveValidationError"
59
- @max-cpu-invalid="maxCpuInvalid = $event"
60
- @reservation-invalid="reservationInvalid = $event"
61
- @limit-invalid="limitInvalid = $event"
62
- @shares-invalid="sharesInvalid = $event"
63
- />
64
- </template>
65
-
66
- <script setup lang="ts">
67
- import type { UI_I_Localization } from '~/lib/models/interfaces'
68
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
69
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
70
- import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
71
- import { cpuOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/lib/config/cpuOptions'
72
-
73
- const model = defineModel<UI_I_CreateVmData>({ required: true })
74
-
75
- const props = withDefaults(
76
- defineProps<{
77
- cpuModels: UI_I_OptionItem[]
78
- isEdit: boolean
79
- errorValidationFields: UI_I_ErrorValidationField[]
80
- vmCpuHelpTextSecond?: string
81
- state?: string | number
82
- }>(),
83
- {
84
- state: undefined,
85
- }
86
- )
87
- const emits = defineEmits<{
88
- (event: 'invalid', value: boolean): void
89
- (event: 'remove-error-by-title', value: string): void
90
- }>()
91
-
92
- const { $store, $binary }: any = useNuxtApp()
93
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
94
-
95
- const localization = computed<UI_I_Localization>(() => useLocal())
96
-
97
- const isDisabled = computed<boolean>(() => {
98
- return props.state === 2
99
- })
100
-
101
- const cpuOptions = computed<UI_I_OptionItem[]>(() =>
102
- cpuOptionsFunc(localization.value, 1, model.value.cpu.max_vcpus)
103
- )
104
-
105
- // const enableCpuHotAdd = ref<boolean>(false)
106
-
107
- const enableCpuHotAddDisabled = computed<boolean>(
108
- // () => model.value.cpu.vcpus >= model.value.cpu.max_vcpus || isDisabled.value
109
- () => isDisabled.value // pc-1766
110
- )
111
- watch(
112
- () => model.value.cpu.hotplug,
113
- (newValue) => {
114
- if (newValue) {
115
- model.value.cpu.max_vcpus = Math.max(
116
- model.value.cpu.vcpus,
117
- model.value.cpu.max_vcpus
118
- )
119
- return
120
- }
121
-
122
- maxCpuInvalid.value = false
123
- model.value.cpu.max_vcpus = 1
124
- }
125
- )
126
-
127
- // const selectedCpu = ref<number>(
128
- // isDisabled.value && model.value.cpu.hotplug ? model.value.cpu.max_vcpus : 2
129
- // )
130
- model.value.cpu.vcpus =
131
- isDisabled.value && model.value.cpu.hotplug ? model.value.cpu.max_vcpus : 2
132
-
133
- const isCpuDisabled = computed<boolean>(
134
- () => isDisabled.value && !model.value.cpu.hotplug
135
- )
136
- watch(
137
- () => model.value.cpu.vcpus,
138
- (newValue) => {
139
- model.value.cpu.vcpus = Math.floor(+newValue)
140
- if (
141
- !(model.value.cpu.vcpus % model.value.cpu.core_per_socket) ||
142
- isDisabled.value
143
- )
144
- return
145
- model.value.cpu.core_per_socket = 1
146
- }
147
- )
148
-
149
- const maxCpuOptions = computed<UI_I_OptionItem[]>(() =>
150
- cpuOptionsFunc(
151
- localization.value,
152
- model.value.cpu.vcpus,
153
- model.value.cpu.max_vcpus
154
- )
155
- )
156
- // const selectedMaxCpu = ref<number>(1)
157
- // watch(
158
- // () => props.maxCpus,
159
- // (newValue) => {
160
- // model.value.cpu.max_vcpus = newValue
161
- // }
162
- // )
163
-
164
- const selectedCpus = computed<number[]>(() =>
165
- model.value.cpu.hotplug
166
- ? [model.value.cpu.vcpus, model.value.cpu.max_vcpus]
167
- : [model.value.cpu.vcpus]
168
- )
169
-
170
- // const selectedCorePerSocket = ref<number>(1)
171
-
172
- const cpuErrorLocalText = computed<string>(() => {
173
- const validValue = /^\d+(\.\d+)?$/.test(model.value.cpu.vcpus + '')
174
- if (!validValue) {
175
- return localization.value.common.inputContainsInvalidCharacters
176
- }
177
-
178
- const min = cpuOptions.value[0].value
179
- const max = cpuOptions.value[1].value
180
- if (model.value.cpu.vcpus < min || model.value.cpu.vcpus > max) {
181
- return localization.value.vmWizard.cpuMustBe
182
- .replace('{0}', min)
183
- .replace('{1}', max)
184
- }
185
-
186
- return ''
187
- })
188
-
189
- const apiVcpusError = computed<string>(() => {
190
- return (
191
- props.errorValidationFields?.find(
192
- (message) => message.field === 'cpu.vcpus'
193
- )?.error_message || ''
194
- )
195
- })
196
-
197
- const vcpusLocalAndApiErrorsTexts = computed<string>(() => {
198
- const localError = cpuErrorLocalText.value
199
- const apiError = apiVcpusError.value
200
-
201
- let result = ''
202
- if (localError && !apiError) result = localError
203
- if (!localError && apiError) result = apiError
204
- if (localError && apiError) result = localError + ', ' + apiError
205
- if (!localError && apiError) result = apiError
206
-
207
- return result
208
- })
209
- const reservationInvalid = ref<boolean>(false)
210
- const limitInvalid = ref<boolean>(false)
211
- const sharesInvalid = ref<boolean>(false)
212
- const maxCpuInvalid = ref<boolean>(false)
213
- const cpuInvalid = computed<boolean>(
214
- () =>
215
- !!cpuErrorLocalText.value ||
216
- reservationInvalid.value ||
217
- limitInvalid.value ||
218
- sharesInvalid.value ||
219
- (model.value.cpu.hotplug &&
220
- // model.value.cpu.vcpus < model.value.cpu.max_vcpus && // pc-1766
221
- maxCpuInvalid.value)
222
- )
223
- watch(
224
- cpuInvalid,
225
- (newValue: boolean) => {
226
- emits('invalid', newValue)
227
- },
228
- { immediate: true }
229
- )
230
-
231
- const reservation = ref<string>('1')
232
- const reservationType = ref<string>('mhz')
233
- if (model.value.cpu.reservation_mhz !== 1) {
234
- const reservationInGhz = $binary.mhzToGhz(model.value.cpu.reservation_mhz)
235
- if (reservationInGhz < 1) {
236
- reservation.value = model.value.cpu.reservation_mhz.toString()
237
- reservationType.value = 'mhz'
238
- } else {
239
- reservation.value = reservationInGhz
240
- reservationType.value = 'ghz'
241
- }
242
- }
243
- watch(
244
- [reservation, reservationType],
245
- () => {
246
- model.value.cpu.reservation_mhz =
247
- reservationType.value === 'ghz'
248
- ? $binary.ghzToMhz(+reservation.value)
249
- : +reservation.value
250
- },
251
- { deep: true, immediate: true }
252
- )
253
-
254
- const limit = ref<string>('Unlimited')
255
- const limitType = ref<string>('mhz')
256
- if (model.value.cpu.limit_mhz !== null) {
257
- if (typeof model.value.cpu.limit_mhz === 'string')
258
- limit.value = model.value.cpu.limit_mhz
259
- else {
260
- const limitInGhz = $binary.mhzToGhz(model.value.cpu.limit_mhz)
261
- if (limitInGhz < 1) {
262
- limit.value = model.value.cpu.limit_mhz.toString()
263
- limitType.value = 'mhz'
264
- } else {
265
- limit.value = limitInGhz
266
- limitType.value = 'ghz'
267
- }
268
- }
269
- }
270
- watch(
271
- [limit, limitType],
272
- () => {
273
- model.value.cpu.limit_mhz =
274
- limit.value === 'Unlimited'
275
- ? limit.value
276
- : limitType.value === 'ghz'
277
- ? $binary.ghzToMhz(+limit.value)
278
- : +limit.value
279
- },
280
- { deep: true, immediate: true }
281
- )
282
-
283
- const shares = ref<string>(model.value.cpu.shares + '' || '2000')
284
- const sharesType = ref<string>(model.value.cpu.shares + '' || '2000') // TODO check
285
- watch(
286
- shares,
287
- () => {
288
- model.value.cpu.shares = +shares.value
289
- },
290
- { deep: true, immediate: true }
291
- )
292
-
293
- // const hardwareVirtualization = ref<boolean>(false)
294
- //
295
- // const performanceCounters = ref<boolean>(false)
296
- //
297
- // const schedulingAffinity = ref<string>('')
298
- //
299
- // const iommu = ref<boolean>(false)
300
-
301
- // const cpuModel = ref<string>(props.cpuModels[0]?.value || '')
302
- const cpuModel = ref<string>('') // PNCWEB-389
303
- watch(
304
- () => props.cpuModels,
305
- (newValue) => {
306
- cpuModel.value = newValue[0].value
307
- }
308
- )
309
- const passthroughHostCpu = ref<boolean>(false)
310
- const hostModelCpu = ref<boolean>(false)
311
- if (model.value.cpu.model) {
312
- switch (model.value.cpu.model) {
313
- case 'host-passthrough':
314
- passthroughHostCpu.value = true
315
- hostModelCpu.value = false
316
- cpuModel.value = ''
317
- break
318
- case 'host-model':
319
- passthroughHostCpu.value = false
320
- hostModelCpu.value = true
321
- cpuModel.value = ''
322
- break
323
- default:
324
- cpuModel.value =
325
- props.cpuModels.find((model) => model.value === model.value.cpu.model)
326
- ?.value || cpuModel.value
327
- }
328
- }
329
- watch(
330
- [cpuModel, passthroughHostCpu, hostModelCpu],
331
- () => {
332
- model.value.cpu.model = passthroughHostCpu.value
333
- ? 'host-passthrough'
334
- : hostModelCpu.value
335
- ? 'host-model'
336
- : cpuModel.value
337
- },
338
- { deep: true, immediate: true }
339
- )
340
-
341
- // const isShowCpuHelp = ref<boolean>(false)
342
-
343
- const onRemoveValidationError = (): void => {
344
- emits('remove-error-by-title', 'cpu.vcpus')
345
- }
346
- </script>
347
-
348
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <component
3
+ :is="currentComponent"
4
+ v-model="model"
5
+ v-model:reservation="reservation"
6
+ v-model:reservation-type="reservationType"
7
+ v-model:limit="limit"
8
+ v-model:limit-type="limitType"
9
+ v-model:shares="shares"
10
+ v-model:shares-type="sharesType"
11
+ v-model:cpu-model="cpuModel"
12
+ v-model:passthrough-host-cpu="passthroughHostCpu"
13
+ v-model:host-model-cpu="hostModelCpu"
14
+ :cpu-models="props.cpuModels"
15
+ :is-edit="props.isEdit"
16
+ :error-validation-fields="props.errorValidationFields"
17
+ :cpu-invalid="cpuInvalid"
18
+ :vcpus-local-and-api-errors-texts="vcpusLocalAndApiErrorsTexts"
19
+ :cpu-options="cpuOptions"
20
+ :is-cpu-disabled="isCpuDisabled"
21
+ :selected-cpus="selectedCpus"
22
+ :is-disabled="isDisabled"
23
+ :enable-cpu-hot-add-disabled="enableCpuHotAddDisabled"
24
+ :max-cpu-options="maxCpuOptions"
25
+ :vm-cpu-help-text-second="vmCpuHelpTextSecond"
26
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
27
+ @remove-validation-error="onRemoveValidationError"
28
+ @max-cpu-invalid="maxCpuInvalid = $event"
29
+ @reservation-invalid="reservationInvalid = $event"
30
+ @limit-invalid="limitInvalid = $event"
31
+ @shares-invalid="sharesInvalid = $event"
32
+ />
33
+ </template>
34
+
35
+ <script setup lang="ts">
36
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
37
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
38
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
39
+ import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
40
+ import { cpuOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/lib/config/cpuOptions'
41
+
42
+ const model = defineModel<UI_I_CreateVmData>({ required: true })
43
+
44
+ const props = withDefaults(
45
+ defineProps<{
46
+ cpuModels: UI_I_OptionItem[]
47
+ isEdit: boolean
48
+ errorValidationFields: UI_I_ErrorValidationField[]
49
+ vmCpuHelpTextSecond?: string
50
+ state?: string | number
51
+ }>(),
52
+ {
53
+ state: undefined,
54
+ }
55
+ )
56
+ const emits = defineEmits<{
57
+ (event: 'invalid', value: boolean): void
58
+ (event: 'remove-error-by-title', value: string): void
59
+ }>()
60
+
61
+ const { $store, $binary }: any = useNuxtApp()
62
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
63
+ const currentComponent = computed(() =>
64
+ isNewView.value
65
+ ? defineAsyncComponent(() => import('./New.vue'))
66
+ : defineAsyncComponent(() => import('./Old.vue'))
67
+ )
68
+
69
+ const localization = computed<UI_I_Localization>(() => useLocal())
70
+
71
+ const isDisabled = computed<boolean>(() => {
72
+ return props.state === 2
73
+ })
74
+
75
+ const cpuOptions = computed<UI_I_OptionItem[]>(() =>
76
+ cpuOptionsFunc(localization.value, 1, model.value.cpu.max_vcpus)
77
+ )
78
+
79
+ // const enableCpuHotAdd = ref<boolean>(false)
80
+
81
+ const enableCpuHotAddDisabled = computed<boolean>(
82
+ // () => model.value.cpu.vcpus >= model.value.cpu.max_vcpus || isDisabled.value
83
+ () => isDisabled.value // pc-1766
84
+ )
85
+ watch(
86
+ () => model.value.cpu.hotplug,
87
+ (newValue) => {
88
+ if (newValue) {
89
+ model.value.cpu.max_vcpus = Math.max(
90
+ model.value.cpu.vcpus,
91
+ model.value.cpu.max_vcpus
92
+ )
93
+ return
94
+ }
95
+
96
+ maxCpuInvalid.value = false
97
+ model.value.cpu.max_vcpus = 1
98
+ }
99
+ )
100
+
101
+ // const selectedCpu = ref<number>(
102
+ // isDisabled.value && model.value.cpu.hotplug ? model.value.cpu.max_vcpus : 2
103
+ // )
104
+ model.value.cpu.vcpus =
105
+ isDisabled.value && model.value.cpu.hotplug ? model.value.cpu.max_vcpus : 2
106
+
107
+ const isCpuDisabled = computed<boolean>(
108
+ () => isDisabled.value && !model.value.cpu.hotplug
109
+ )
110
+ watch(
111
+ () => model.value.cpu.vcpus,
112
+ (newValue) => {
113
+ model.value.cpu.vcpus = Math.floor(+newValue)
114
+ if (
115
+ !(model.value.cpu.vcpus % model.value.cpu.core_per_socket) ||
116
+ isDisabled.value
117
+ )
118
+ return
119
+ model.value.cpu.core_per_socket = 1
120
+ }
121
+ )
122
+
123
+ const maxCpuOptions = computed<UI_I_OptionItem[]>(() =>
124
+ cpuOptionsFunc(
125
+ localization.value,
126
+ model.value.cpu.vcpus,
127
+ model.value.cpu.max_vcpus
128
+ )
129
+ )
130
+ // const selectedMaxCpu = ref<number>(1)
131
+ // watch(
132
+ // () => props.maxCpus,
133
+ // (newValue) => {
134
+ // model.value.cpu.max_vcpus = newValue
135
+ // }
136
+ // )
137
+
138
+ const selectedCpus = computed<number[]>(() =>
139
+ model.value.cpu.hotplug
140
+ ? [model.value.cpu.vcpus, model.value.cpu.max_vcpus]
141
+ : [model.value.cpu.vcpus]
142
+ )
143
+
144
+ // const selectedCorePerSocket = ref<number>(1)
145
+
146
+ const cpuErrorLocalText = computed<string>(() => {
147
+ const validValue = /^\d+(\.\d+)?$/.test(model.value.cpu.vcpus + '')
148
+ if (!validValue) {
149
+ return localization.value.common.inputContainsInvalidCharacters
150
+ }
151
+
152
+ const min = cpuOptions.value[0].value
153
+ const max = cpuOptions.value[1].value
154
+ if (model.value.cpu.vcpus < min || model.value.cpu.vcpus > max) {
155
+ return localization.value.vmWizard.cpuMustBe
156
+ .replace('{0}', min)
157
+ .replace('{1}', max)
158
+ }
159
+
160
+ return ''
161
+ })
162
+
163
+ const apiVcpusError = computed<string>(() => {
164
+ return (
165
+ props.errorValidationFields?.find(
166
+ (message) => message.field === 'cpu.vcpus'
167
+ )?.error_message || ''
168
+ )
169
+ })
170
+
171
+ const vcpusLocalAndApiErrorsTexts = computed<string>(() => {
172
+ const localError = cpuErrorLocalText.value
173
+ const apiError = apiVcpusError.value
174
+
175
+ let result = ''
176
+ if (localError && !apiError) result = localError
177
+ if (!localError && apiError) result = apiError
178
+ if (localError && apiError) result = localError + ', ' + apiError
179
+ if (!localError && apiError) result = apiError
180
+
181
+ return result
182
+ })
183
+ const reservationInvalid = ref<boolean>(false)
184
+ const limitInvalid = ref<boolean>(false)
185
+ const sharesInvalid = ref<boolean>(false)
186
+ const maxCpuInvalid = ref<boolean>(false)
187
+ const cpuInvalid = computed<boolean>(
188
+ () =>
189
+ !!cpuErrorLocalText.value ||
190
+ reservationInvalid.value ||
191
+ limitInvalid.value ||
192
+ sharesInvalid.value ||
193
+ (model.value.cpu.hotplug &&
194
+ // model.value.cpu.vcpus < model.value.cpu.max_vcpus && // pc-1766
195
+ maxCpuInvalid.value)
196
+ )
197
+ watch(
198
+ cpuInvalid,
199
+ (newValue: boolean) => {
200
+ emits('invalid', newValue)
201
+ },
202
+ { immediate: true }
203
+ )
204
+
205
+ const reservation = ref<string>('1')
206
+ const reservationType = ref<string>('mhz')
207
+ if (model.value.cpu.reservation_mhz !== 1) {
208
+ const reservationInGhz = $binary.mhzToGhz(model.value.cpu.reservation_mhz)
209
+ if (reservationInGhz < 1) {
210
+ reservation.value = model.value.cpu.reservation_mhz.toString()
211
+ reservationType.value = 'mhz'
212
+ } else {
213
+ reservation.value = reservationInGhz
214
+ reservationType.value = 'ghz'
215
+ }
216
+ }
217
+ watch(
218
+ [reservation, reservationType],
219
+ () => {
220
+ model.value.cpu.reservation_mhz =
221
+ reservationType.value === 'ghz'
222
+ ? $binary.ghzToMhz(+reservation.value)
223
+ : +reservation.value
224
+ },
225
+ { deep: true, immediate: true }
226
+ )
227
+
228
+ const limit = ref<string>('Unlimited')
229
+ const limitType = ref<string>('mhz')
230
+ if (model.value.cpu.limit_mhz !== null) {
231
+ if (typeof model.value.cpu.limit_mhz === 'string')
232
+ limit.value = model.value.cpu.limit_mhz
233
+ else {
234
+ const limitInGhz = $binary.mhzToGhz(model.value.cpu.limit_mhz)
235
+ if (limitInGhz < 1) {
236
+ limit.value = model.value.cpu.limit_mhz.toString()
237
+ limitType.value = 'mhz'
238
+ } else {
239
+ limit.value = limitInGhz
240
+ limitType.value = 'ghz'
241
+ }
242
+ }
243
+ }
244
+ watch(
245
+ [limit, limitType],
246
+ () => {
247
+ model.value.cpu.limit_mhz =
248
+ limit.value === 'Unlimited'
249
+ ? limit.value
250
+ : limitType.value === 'ghz'
251
+ ? $binary.ghzToMhz(+limit.value)
252
+ : +limit.value
253
+ },
254
+ { deep: true, immediate: true }
255
+ )
256
+
257
+ const shares = ref<string>(model.value.cpu.shares + '' || '2000')
258
+ const sharesType = ref<string>(model.value.cpu.shares + '' || '2000') // TODO check
259
+ watch(
260
+ shares,
261
+ () => {
262
+ model.value.cpu.shares = +shares.value
263
+ },
264
+ { deep: true, immediate: true }
265
+ )
266
+
267
+ // const hardwareVirtualization = ref<boolean>(false)
268
+ //
269
+ // const performanceCounters = ref<boolean>(false)
270
+ //
271
+ // const schedulingAffinity = ref<string>('')
272
+ //
273
+ // const iommu = ref<boolean>(false)
274
+
275
+ // const cpuModel = ref<string>(props.cpuModels[0]?.value || '')
276
+ const cpuModel = ref<string>('') // PNCWEB-389
277
+ watch(
278
+ () => props.cpuModels,
279
+ (newValue) => {
280
+ cpuModel.value = newValue[0].value
281
+ }
282
+ )
283
+ const passthroughHostCpu = ref<boolean>(false)
284
+ const hostModelCpu = ref<boolean>(false)
285
+ if (model.value.cpu.model) {
286
+ switch (model.value.cpu.model) {
287
+ case 'host-passthrough':
288
+ passthroughHostCpu.value = true
289
+ hostModelCpu.value = false
290
+ cpuModel.value = ''
291
+ break
292
+ case 'host-model':
293
+ passthroughHostCpu.value = false
294
+ hostModelCpu.value = true
295
+ cpuModel.value = ''
296
+ break
297
+ default:
298
+ cpuModel.value =
299
+ props.cpuModels.find((model) => model.value === model.value.cpu.model)
300
+ ?.value || cpuModel.value
301
+ }
302
+ }
303
+ watch(
304
+ [cpuModel, passthroughHostCpu, hostModelCpu],
305
+ () => {
306
+ model.value.cpu.model = passthroughHostCpu.value
307
+ ? 'host-passthrough'
308
+ : hostModelCpu.value
309
+ ? 'host-model'
310
+ : cpuModel.value
311
+ },
312
+ { deep: true, immediate: true }
313
+ )
314
+
315
+ // const isShowCpuHelp = ref<boolean>(false)
316
+
317
+ const onRemoveValidationError = (): void => {
318
+ emits('remove-error-by-title', 'cpu.vcpus')
319
+ }
320
+ </script>
321
+
322
+ <style scoped lang="scss"></style>