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,521 +1,483 @@
1
- <template>
2
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-new
3
- v-if="isNewView"
4
- v-model:delete-files-from-datastore="deleteFilesFromDatastore"
5
- v-model:size="sizeLocal"
6
- v-model:hard-disk-type="hardDiskType"
7
- v-model:disk-provisioning="provisionType"
8
- v-model:sharing="sharingLocal"
9
- v-model:limit-iops="limitIops"
10
- v-model:limit-iops-type="limitIopsType"
11
- v-model:limit-iops-invalid="limitIopsInvalid"
12
- v-model:disk-mode="diskMode"
13
- v-model:cache="cache"
14
- v-model:bus="bus"
15
- v-model:source="source"
16
- :is-removable="isRemovable"
17
- :label="label"
18
- :hard-disk-invalid="hardDiskInvalid"
19
- :error-text="hardDiskLocalAndApiErrorsTexts"
20
- :hard-disk-type-error-local-text="hardDiskTypeErrorLocalText"
21
- :is-disabled-size="isDisabledSize"
22
- :is-disabled-provisioning="isDisabledProvisioning"
23
- :is-disabled-sharing="isDisabledSharing"
24
- :is-disabled-limit-iops="isDisabledLimitIops"
25
- :is-disabled-mode="isDisabledMode"
26
- :is-disabled-cache="isDisabledCache"
27
- :is-disabled-bus="isDisabledBus"
28
- :hard-disk-type-options="hardDiskTypeOptions"
29
- :max-hard-disk="maxHardDisk"
30
- :location="location"
31
- :is-running="isRunning"
32
- :is-new-hard-disk="isNewHardDisk"
33
- :is-edit="props.isEdit"
34
- :datastore="props.datastore"
35
- :is-datastore-loading="props.isDatastoreLoading"
36
- :get-datastore-table-func="props.getDatastoreTableFunc"
37
- :error-validation-fields="props.errorValidationFields"
38
- :index="props.index"
39
- :type="props.type"
40
- :guest-machine-type="props.guestMachineType"
41
- :compute-resource="props.computeResource"
42
- @remove="emits('remove')"
43
- @roll-back="emits('roll-back')"
44
- @validate-size="onValidateSize"
45
- @change-storage="onChangeStorage"
46
- @remove-error-by-title="emits('remove-error-by-title', $event)"
47
- />
48
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-old
49
- v-else
50
- v-model:delete-files-from-datastore="deleteFilesFromDatastore"
51
- v-model:size="sizeLocal"
52
- v-model:hard-disk-type="hardDiskType"
53
- v-model:disk-provisioning="provisionType"
54
- v-model:sharing="sharingLocal"
55
- v-model:limit-iops="limitIops"
56
- v-model:limit-iops-type="limitIopsType"
57
- v-model:limit-iops-invalid="limitIopsInvalid"
58
- v-model:disk-mode="diskMode"
59
- v-model:cache="cache"
60
- v-model:bus="bus"
61
- v-model:source="source"
62
- :is-removable="isRemovable"
63
- :label="label"
64
- :hard-disk-invalid="hardDiskInvalid"
65
- :error-text="hardDiskLocalAndApiErrorsTexts"
66
- :hard-disk-type-error-local-text="hardDiskTypeErrorLocalText"
67
- :is-disabled-size="isDisabledSize"
68
- :is-disabled-provisioning="isDisabledProvisioning"
69
- :is-disabled-sharing="isDisabledSharing"
70
- :is-disabled-limit-iops="isDisabledLimitIops"
71
- :is-disabled-mode="isDisabledMode"
72
- :is-disabled-cache="isDisabledCache"
73
- :is-disabled-bus="isDisabledBus"
74
- :hard-disk-type-options="hardDiskTypeOptions"
75
- :max-hard-disk="maxHardDisk"
76
- :location="location"
77
- :is-running="isRunning"
78
- :is-new-hard-disk="isNewHardDisk"
79
- :is-edit="props.isEdit"
80
- :datastore="props.datastore"
81
- :is-datastore-loading="props.isDatastoreLoading"
82
- :get-datastore-table-func="props.getDatastoreTableFunc"
83
- :error-validation-fields="props.errorValidationFields"
84
- :index="props.index"
85
- :type="props.type"
86
- :guest-machine-type="props.guestMachineType"
87
- :compute-resource="props.computeResource"
88
- :disabled="false"
89
- @remove="emits('remove')"
90
- @roll-back="emits('roll-back')"
91
- @validate-size="onValidateSize"
92
- @change-storage="onChangeStorage"
93
- @remove-error-by-title="emits('remove-error-by-title', $event)"
94
- />
95
- </template>
96
-
97
- <script setup lang="ts">
98
- import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
99
- // import type {
100
- // UI_I_SendDataNewHardDisk,
101
- // UI_I_SendDataNewHardDiskStorage,
102
- // } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
103
- import type { UI_T_HardDiskType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
104
- import type { UI_I_Localization } from '~/lib/models/interfaces'
105
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
106
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
107
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
108
- import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
109
- import { binaryOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/binaryOptions'
110
-
111
- const size = defineModel<number>('size', { required: true })
112
- const initialSize = size.value
113
- // const provisionType = ref<string>('thick')
114
- const provisionType = defineModel<string>('provisionType', { required: true })
115
- // const sharing = ref<string>('')
116
- const sharing = defineModel<boolean>('sharing', { required: true })
117
- // const sharingLocal = ref<string>(sharing.value ? 'yes' : '')
118
- const sharingLocal = computed<string>({
119
- set(newValue) {
120
- sharing.value = newValue === 'yes'
121
- },
122
- get() {
123
- return sharing.value ? 'yes' : ''
124
- }
125
- })
126
- // const shares = ref<number>(0)
127
- const shares = defineModel<number>('shares', { required: true })
128
-
129
- // const limitIops = ref<number>(16)
130
- const limitIops = defineModel<number>('limitIops', { required: true })
131
- const limitIopsType = ref<string>('unlimited') // ??
132
- const limitIopsInvalid = ref<boolean>(false) // ??
133
-
134
- // const diskMode = ref<string>('dependent')
135
- const diskMode = defineModel<string>('diskMode', { required: true })
136
-
137
- // const cache = ref<string>('none')
138
- const cache = defineModel<string>('cache', { required: true })
139
-
140
- // const bus = ref<string>('ide')
141
- const bus = defineModel<string>('bus', { required: true })
142
-
143
- // const readOnly = ref<boolean>(false)
144
- const readOnly = defineModel<boolean>('readOnly', { required: true })
145
-
146
- // const discard = ref<string>('')
147
- const discard = defineModel<string>('discard', { required: true })
148
-
149
- // const io = ref<string>('')
150
- const io = defineModel<string>('io', { required: true })
151
-
152
- // const target = ref<string>('')
153
- const target = defineModel<string>('target', { required: true })
154
-
155
- const source = defineModel<string>('source', { required: true })
156
-
157
- const storage = defineModel<any>('storage', { required: true })
158
-
159
- const remove = defineModel<boolean>('remove', { required: true })
160
- const detach = defineModel<boolean>('detach', { required: true })
161
-
162
- const props = withDefaults(
163
- defineProps<{
164
- mainStorage: UI_I_DatastoreTableItem | null
165
- // hardDisk: UI_I_SendDataNewHardDisk
166
- type: UI_T_HardDiskType
167
- index: number
168
- errorValidationFields: UI_I_ErrorValidationField[]
169
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
170
- datastore: UI_I_DatastoreTableItem[]
171
- isDatastoreLoading: boolean
172
- isEdit: boolean
173
- state?: string | number
174
- guestMachineType?: UI_I_OptionItem | null
175
- computeResource?: UI_I_TreeNode | null
176
- }>(),
177
- {
178
- state: undefined,
179
- guestMachineType: undefined,
180
- computeResource: undefined,
181
- }
182
- )
183
- const emits = defineEmits<{
184
- // (event: 'send-data', value: UI_I_SendDataNewHardDisk): void
185
- (event: 'invalid', value: boolean): void
186
- (event: 'remove'): void
187
- (event: 'roll-back'): void
188
- (event: 'remove-error-by-title', value: string): void
189
- }>()
190
-
191
- watch(() => props.type, (newValue) => {
192
- detach.value = newValue === 'removed'
193
- })
194
-
195
-
196
- const { $store, $binary }: any = useNuxtApp()
197
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
198
-
199
- const localization = computed<UI_I_Localization>(() => useLocal())
200
-
201
- const isRunning = computed<boolean>(() => {
202
- return props.state === 2
203
- })
204
-
205
- const isRemovable = computed<boolean>(() => {
206
- return (
207
- !props.isEdit ||
208
- !isRunning.value ||
209
- (isRunning.value && bus.value === 'virtio')
210
- )
211
- })
212
-
213
- const typeError = computed<string>(() => `disk_devices[${props.index}].size`)
214
-
215
- const apiErrorLocal = computed<string>(() => {
216
- return (
217
- props.errorValidationFields?.find(
218
- (message) => message.field === typeError.value
219
- )?.error_message || ''
220
- )
221
- })
222
-
223
- // PC-1796
224
- // const isNotNewHardDisk = computed<boolean>(
225
- // () => props.type === 'edit' || props.type === 'removed'
226
- // )
227
- const isNewHardDisk = computed<boolean>(
228
- () => props.type !== 'edit' && props.type !== 'removed'
229
- )
230
- const label = computed<string>(() => {
231
- // if (props.type === 'edit' || props.type === 'removed')
232
- if (!isNewHardDisk.value)
233
- return `${localization.value.common.hardDisk} ${props.index + 1}`
234
-
235
- return `${localization.value.common.newHardDisk} *`
236
- })
237
-
238
- const maxHardDisk = computed<number>(() => {
239
- // const hardDiskSizeMb = $binary.gbToMb(props.hardDisk.size)
240
-
241
- if (props.type === 'exist') return initialSize
242
-
243
- if (!storageLocal.value) return 0
244
- const free = (storageLocal.value.capacity.free_mb ||
245
- storageLocal.value.capacity) as number // TODO fix
246
-
247
- if (props.isEdit) return free + initialSize
248
-
249
- return free
250
- })
251
- const hardDiskTypeErrorLocalText = computed<string>(() => {
252
- if (size.value > maxHardDisk.value) {
253
- return localization.value.common.diskCapacitySpecifiedGreater
254
- }
255
-
256
- if (size.value <= 0) {
257
- return localization.value.common.diskCapacityCannotZero
258
- }
259
-
260
- return ''
261
- })
262
-
263
- const hardDiskLocalAndApiErrorsTexts = computed<string>(() => {
264
- const localError = hardDiskTypeErrorLocalText.value
265
- const apiError = apiErrorLocal.value
266
-
267
- let result = ''
268
- if (localError && !apiError) result = localError
269
- if (!localError && apiError) result = apiError
270
- if (localError && apiError) result = localError + ', ' + apiError
271
- if (!localError && apiError) result = apiError
272
-
273
- return result
274
- })
275
-
276
- const deleteFilesFromDatastore = ref<boolean>(false)
277
- watch(deleteFilesFromDatastore, (newValue) => {
278
- remove.value = props.type === 'removed' && newValue
279
- })
280
-
281
- const hardDiskType = ref<string>(size.value < 1024 ? 'mb' : 'gb')
282
- watch(hardDiskType, (newValue) => {
283
- size.value = $binary.universalFromTo(sizeLocal.value, newValue, 'mb')
284
- })
285
- const hardDiskTypeOptions = ref<UI_I_OptionItem[]>(
286
- binaryOptionsFunc(localization.value)
287
- )
288
-
289
- const sizeLocal = ref<number>(size.value < 1024 ? size.value : $binary.mbToGb(size.value))
290
- watch(sizeLocal, (newValue) => {
291
- if (hardDiskType.value === 'mb') {
292
- size.value = newValue
293
- }
294
-
295
- size.value = $binary.universalFromTo(newValue, hardDiskType.value, 'mb')
296
- })
297
- // const sizeInMb = computed<number>(() => {
298
- // if (hardDiskType.value === 'mb') {
299
- // return size.value
300
- // }
301
- //
302
- // return $binary.universalFromTo(size.value, hardDiskType.value, 'mb')
303
- // })
304
- const onValidateSize = (): void => {
305
- if (props.type !== 'edit') return
306
- if (size.value < initialSize) {
307
- sizeLocal.value = $binary.universalFromTo(
308
- initialSize,
309
- 'mb',
310
- hardDiskType.value
311
- )
312
- }
313
- }
314
-
315
- const isDisabledSize = computed<boolean>(() => {
316
- if (isNewHardDisk.value) return false
317
- return (
318
- props.type === 'exist' ||
319
- (props.type === 'edit' && readOnly.value) ||
320
- (isRunning.value && provisionType.value === 'thick')
321
- )
322
- })
323
- const isDisabledProvisioning = computed<boolean>(() => {
324
- if (isNewHardDisk.value) return false
325
- return props.isEdit || isRunning.value
326
- })
327
- const isDisabledSharing = computed<boolean>(() => {
328
- return isRunning.value && !isNewHardDisk.value
329
- })
330
- const isDisabledLimitIops = computed<boolean>(() => {
331
- return isRunning.value && !isNewHardDisk.value
332
- })
333
- const isDisabledMode = computed<boolean>(() => {
334
- return isRunning.value && !isNewHardDisk.value
335
- })
336
- const isDisabledCache = computed<boolean>(() => {
337
- if (isNewHardDisk.value) return false
338
- return props.isEdit || isRunning.value
339
- })
340
- const isDisabledBus = computed<boolean>(() => {
341
- return !isNewHardDisk.value && isRunning.value
342
- })
343
-
344
- const location = ref<UI_I_DatastoreTableItem | null>(props.mainStorage || null)
345
- const storageLocal = ref<UI_I_DatastoreTableItem | null>(props.mainStorage)
346
- watch(
347
- () => props.mainStorage,
348
- (newValue) => {
349
- location.value = newValue
350
- storageLocal.value = newValue
351
-
352
- storage.value = {
353
- id: newValue?.id || '',
354
- name: newValue?.name || '',
355
- type: newValue?.type_text || '',
356
- pool: newValue?.pool_name || '',
357
- user: '',
358
- endpoint: '',
359
- password: '',
360
- protocol: '',
361
- options: '',
362
- }
363
- },
364
- {
365
- immediate: true,
366
- deep: true,
367
- }
368
- )
369
- const onChangeStorage = (item: UI_I_DatastoreTableItem): void => {
370
- storageLocal.value = item
371
-
372
- storage.value = {
373
- id: item?.id || '',
374
- name: item?.name || '',
375
- type: item?.type_text || '',
376
- pool: item?.pool_name || '',
377
- user: '',
378
- endpoint: '',
379
- password: '',
380
- protocol: '',
381
- options: '',
382
- }
383
- }
384
-
385
- // const diskProvisioning = ref<string>('thick')
386
- // const sharing = ref<string>('')
387
- // const shares = ref<number>(0)
388
- //
389
- // const limitIops = ref<number>(16)
390
- // const limitIopsType = ref<string>('unlimited')
391
- // const limitIopsInvalid = ref<boolean>(false)
392
- //
393
- // const diskMode = ref<string>('dependent')
394
- //
395
- // const cache = ref<string>('none')
396
- //
397
- // const bus = ref<string>('ide')
398
- //
399
- // const readOnly = ref<boolean>(false)
400
- //
401
- // const discard = ref<string>('')
402
- //
403
- // const io = ref<string>('')
404
- //
405
- // const target = ref<string>('')
406
-
407
- // watch(
408
- // [
409
- // sizeInMb,
410
- // storage,
411
- // diskProvisioning,
412
- // sharing,
413
- // limitIops,
414
- // limitIopsType,
415
- // diskMode,
416
- // cache,
417
- // bus,
418
- // deleteFilesFromDatastore,
419
- // (): void => props.type,
420
- // ],
421
- // () => {
422
- // const limitIopsLocal =
423
- // limitIopsType.value === 'unlimited' ? 0 : limitIops.value
424
- // const storageLocal: UI_I_SendDataNewHardDiskStorage = {
425
- // id: storage.value?.id || '',
426
- // name: storage.value?.name || '',
427
- // type: storage.value?.type_text || '',
428
- // pool: storage.value?.pool_name || '',
429
- // user: '',
430
- // endpoint: '',
431
- // password: '',
432
- // protocol: '',
433
- // options: '',
434
- // }
435
- //
436
- // emits('send-data', {
437
- // create: props.hardDisk.create,
438
- // attach: props.hardDisk.attach,
439
- // source: props.hardDisk.source,
440
- // size: Math.ceil(sizeInMb.value),
441
- // bus: bus.value,
442
- // target: target.value,
443
- // storage: storageLocal,
444
- // device_type: 'disk',
445
- // provision_type: diskProvisioning.value,
446
- // disk_mode: diskMode.value,
447
- // sharing: sharing.value === 'yes',
448
- // read_only: readOnly.value,
449
- // shares: shares.value,
450
- // cache: cache.value,
451
- // io: io.value,
452
- // limit_iops: limitIopsLocal,
453
- // discard: discard.value,
454
- // capacity: Math.ceil(sizeInMb.value),
455
- // boot_order: props.hardDisk.boot_order,
456
- // detach: props.type === 'removed',
457
- // remove: props.type === 'removed' && deleteFilesFromDatastore.value, // Проверяем если удалили диск и указали Delete files from datastore
458
- // })
459
- // },
460
- // { immediate: true }
461
- // )
462
-
463
- // Добавляем данные для редактирования
464
- // watch(
465
- // () => props.hardDisk,
466
- // (newValue) => {
467
- // // TODO refactoring
468
- // if (props.type === 'exist') {
469
- // diskProvisioning.value = newValue.provision_type || 'thick'
470
- // return
471
- // }
472
- // // if (props.type !== 'edit') return
473
- // if (props.type !== 'edit' && props.type !== 'clone') return
474
- //
475
- // const sizeInGb = $binary.mbToGb(newValue.size)
476
- // if (sizeInGb < 1) {
477
- // size.value = newValue.size
478
- // hardDiskType.value = 'mb'
479
- // } else {
480
- // size.value = sizeInGb
481
- // hardDiskType.value = 'gb'
482
- // }
483
- // diskProvisioning.value = newValue.provision_type || 'thick'
484
- // sharing.value = newValue.sharing ? 'yes' : ''
485
- // shares.value = newValue.shares || 0
486
- // // limitIopsType.value = newValue.io === 'native' ? 'unlimited' : 'custom'
487
- // limitIopsType.value = newValue.limit_iops === 0 ? 'unlimited' : 'custom'
488
- // limitIops.value = newValue.limit_iops || 16
489
- // diskMode.value = newValue.disk_mode || 'dependent'
490
- // cache.value = newValue.cache || 'none'
491
- // bus.value = newValue.bus || 'ide'
492
- // readOnly.value = newValue.read_only || false
493
- // discard.value = newValue.discard || ''
494
- // io.value = newValue.io || ''
495
- // target.value = newValue.target || ''
496
- // },
497
- // { immediate: true }
498
- // )
499
- watch(
500
- isRunning,
501
- (newValue) => {
502
- if (newValue && props.type === 'new') {
503
- bus.value = 'virtio'
504
- }
505
- },
506
- { immediate: true }
507
- )
508
-
509
- const hardDiskInvalid = computed<boolean>(() => {
510
- return !!hardDiskTypeErrorLocalText.value || limitIopsInvalid.value
511
- })
512
- watch(
513
- hardDiskInvalid,
514
- (newValue) => {
515
- emits('invalid', newValue)
516
- },
517
- { immediate: true }
518
- )
519
- </script>
520
-
521
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <component
3
+ :is="currentComponent"
4
+ v-model:delete-files-from-datastore="deleteFilesFromDatastore"
5
+ v-model:size="sizeLocal"
6
+ v-model:hard-disk-type="hardDiskType"
7
+ v-model:disk-provisioning="provisionType"
8
+ v-model:sharing="sharingLocal"
9
+ v-model:limit-iops="limitIops"
10
+ v-model:limit-iops-type="limitIopsType"
11
+ v-model:limit-iops-invalid="limitIopsInvalid"
12
+ v-model:disk-mode="diskMode"
13
+ v-model:cache="cache"
14
+ v-model:bus="bus"
15
+ v-model:source="source"
16
+ :is-removable="isRemovable"
17
+ :label="label"
18
+ :hard-disk-invalid="hardDiskInvalid"
19
+ :error-text="hardDiskLocalAndApiErrorsTexts"
20
+ :hard-disk-type-error-local-text="hardDiskTypeErrorLocalText"
21
+ :is-disabled-size="isDisabledSize"
22
+ :is-disabled-provisioning="isDisabledProvisioning"
23
+ :is-disabled-sharing="isDisabledSharing"
24
+ :is-disabled-limit-iops="isDisabledLimitIops"
25
+ :is-disabled-mode="isDisabledMode"
26
+ :is-disabled-cache="isDisabledCache"
27
+ :is-disabled-bus="isDisabledBus"
28
+ :hard-disk-type-options="hardDiskTypeOptions"
29
+ :max-hard-disk="maxHardDisk"
30
+ :location="location"
31
+ :is-running="isRunning"
32
+ :is-new-hard-disk="isNewHardDisk"
33
+ :is-edit="props.isEdit"
34
+ :datastore="props.datastore"
35
+ :is-datastore-loading="props.isDatastoreLoading"
36
+ :get-datastore-table-func="props.getDatastoreTableFunc"
37
+ :error-validation-fields="props.errorValidationFields"
38
+ :index="props.index"
39
+ :type="props.type"
40
+ :guest-machine-type="props.guestMachineType"
41
+ :compute-resource="props.computeResource"
42
+ @remove="emits('remove')"
43
+ @roll-back="emits('roll-back')"
44
+ @validate-size="onValidateSize"
45
+ @change-storage="onChangeStorage"
46
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
47
+ />
48
+ </template>
49
+
50
+ <script setup lang="ts">
51
+ import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
52
+ // import type {
53
+ // UI_I_SendDataNewHardDisk,
54
+ // UI_I_SendDataNewHardDiskStorage,
55
+ // } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
56
+ import type { UI_T_HardDiskType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
57
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
58
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
59
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
60
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
61
+ import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
62
+ import { binaryOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/binaryOptions'
63
+
64
+ const size = defineModel<number>('size', { required: true })
65
+ const initialSize = size.value
66
+ // const provisionType = ref<string>('thick')
67
+ const provisionType = defineModel<string>('provisionType', { required: true })
68
+ // const sharing = ref<string>('')
69
+ const sharing = defineModel<boolean>('sharing', { required: true })
70
+ // const sharingLocal = ref<string>(sharing.value ? 'yes' : '')
71
+ const sharingLocal = computed<string>({
72
+ set(newValue) {
73
+ sharing.value = newValue === 'yes'
74
+ },
75
+ get() {
76
+ return sharing.value ? 'yes' : ''
77
+ },
78
+ })
79
+ // const shares = ref<number>(0)
80
+ const shares = defineModel<number>('shares', { required: true })
81
+
82
+ // const limitIops = ref<number>(16)
83
+ const limitIops = defineModel<number>('limitIops', { required: true })
84
+ const limitIopsType = ref<string>('unlimited') // ??
85
+ const limitIopsInvalid = ref<boolean>(false) // ??
86
+
87
+ // const diskMode = ref<string>('dependent')
88
+ const diskMode = defineModel<string>('diskMode', { required: true })
89
+
90
+ // const cache = ref<string>('none')
91
+ const cache = defineModel<string>('cache', { required: true })
92
+
93
+ // const bus = ref<string>('ide')
94
+ const bus = defineModel<string>('bus', { required: true })
95
+
96
+ // const readOnly = ref<boolean>(false)
97
+ const readOnly = defineModel<boolean>('readOnly', { required: true })
98
+
99
+ // const discard = ref<string>('')
100
+ const discard = defineModel<string>('discard', { required: true })
101
+
102
+ // const io = ref<string>('')
103
+ const io = defineModel<string>('io', { required: true })
104
+
105
+ // const target = ref<string>('')
106
+ const target = defineModel<string>('target', { required: true })
107
+
108
+ const source = defineModel<string>('source', { required: true })
109
+
110
+ const storage = defineModel<any>('storage', { required: true })
111
+
112
+ const remove = defineModel<boolean>('remove', { required: true })
113
+ const detach = defineModel<boolean>('detach', { required: true })
114
+
115
+ const props = withDefaults(
116
+ defineProps<{
117
+ mainStorage: UI_I_DatastoreTableItem | null
118
+ // hardDisk: UI_I_SendDataNewHardDisk
119
+ type: UI_T_HardDiskType
120
+ index: number
121
+ errorValidationFields: UI_I_ErrorValidationField[]
122
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
123
+ datastore: UI_I_DatastoreTableItem[]
124
+ isDatastoreLoading: boolean
125
+ isEdit: boolean
126
+ state?: string | number
127
+ guestMachineType?: UI_I_OptionItem | null
128
+ computeResource?: UI_I_TreeNode | null
129
+ }>(),
130
+ {
131
+ state: undefined,
132
+ guestMachineType: undefined,
133
+ computeResource: undefined,
134
+ }
135
+ )
136
+ const emits = defineEmits<{
137
+ // (event: 'send-data', value: UI_I_SendDataNewHardDisk): void
138
+ (event: 'invalid', value: boolean): void
139
+ (event: 'remove'): void
140
+ (event: 'roll-back'): void
141
+ (event: 'remove-error-by-title', value: string): void
142
+ }>()
143
+
144
+ watch(
145
+ () => props.type,
146
+ (newValue) => {
147
+ detach.value = newValue === 'removed'
148
+ }
149
+ )
150
+
151
+ const { $store, $binary }: any = useNuxtApp()
152
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
153
+ const currentComponent = computed(() =>
154
+ isNewView.value
155
+ ? defineAsyncComponent(() => import('./New.vue'))
156
+ : defineAsyncComponent(() => import('./Old.vue'))
157
+ )
158
+
159
+ const localization = computed<UI_I_Localization>(() => useLocal())
160
+
161
+ const isRunning = computed<boolean>(() => {
162
+ return props.state === 2
163
+ })
164
+
165
+ const isRemovable = computed<boolean>(() => {
166
+ return (
167
+ !props.isEdit ||
168
+ !isRunning.value ||
169
+ (isRunning.value && bus.value === 'virtio')
170
+ )
171
+ })
172
+
173
+ const typeError = computed<string>(() => `disk_devices[${props.index}].size`)
174
+
175
+ const apiErrorLocal = computed<string>(() => {
176
+ return (
177
+ props.errorValidationFields?.find(
178
+ (message) => message.field === typeError.value
179
+ )?.error_message || ''
180
+ )
181
+ })
182
+
183
+ // PC-1796
184
+ // const isNotNewHardDisk = computed<boolean>(
185
+ // () => props.type === 'edit' || props.type === 'removed'
186
+ // )
187
+ const isNewHardDisk = computed<boolean>(
188
+ () => props.type !== 'edit' && props.type !== 'removed'
189
+ )
190
+ const label = computed<string>(() => {
191
+ // if (props.type === 'edit' || props.type === 'removed')
192
+ if (!isNewHardDisk.value)
193
+ return `${localization.value.common.hardDisk} ${props.index + 1}`
194
+
195
+ return `${localization.value.common.newHardDisk} *`
196
+ })
197
+
198
+ const maxHardDisk = computed<number>(() => {
199
+ // const hardDiskSizeMb = $binary.gbToMb(props.hardDisk.size)
200
+
201
+ if (props.type === 'exist') return initialSize
202
+
203
+ if (!storageLocal.value) return 0
204
+ const free = (storageLocal.value.capacity.free_mb ||
205
+ storageLocal.value.capacity) as number // TODO fix
206
+
207
+ if (props.isEdit) return free + initialSize
208
+
209
+ return free
210
+ })
211
+ const hardDiskTypeErrorLocalText = computed<string>(() => {
212
+ if (size.value > maxHardDisk.value) {
213
+ return localization.value.common.diskCapacitySpecifiedGreater
214
+ }
215
+
216
+ if (size.value <= 0) {
217
+ return localization.value.common.diskCapacityCannotZero
218
+ }
219
+
220
+ return ''
221
+ })
222
+
223
+ const hardDiskLocalAndApiErrorsTexts = computed<string>(() => {
224
+ const localError = hardDiskTypeErrorLocalText.value
225
+ const apiError = apiErrorLocal.value
226
+
227
+ let result = ''
228
+ if (localError && !apiError) result = localError
229
+ if (!localError && apiError) result = apiError
230
+ if (localError && apiError) result = localError + ', ' + apiError
231
+ if (!localError && apiError) result = apiError
232
+
233
+ return result
234
+ })
235
+
236
+ const deleteFilesFromDatastore = ref<boolean>(false)
237
+ watch(deleteFilesFromDatastore, (newValue) => {
238
+ remove.value = props.type === 'removed' && newValue
239
+ })
240
+
241
+ const hardDiskType = ref<string>(size.value < 1024 ? 'mb' : 'gb')
242
+ watch(hardDiskType, (newValue) => {
243
+ size.value = $binary.universalFromTo(sizeLocal.value, newValue, 'mb')
244
+ })
245
+ const hardDiskTypeOptions = ref<UI_I_OptionItem[]>(
246
+ binaryOptionsFunc(localization.value)
247
+ )
248
+
249
+ const sizeLocal = ref<number>(
250
+ size.value < 1024 ? size.value : $binary.mbToGb(size.value)
251
+ )
252
+ watch(sizeLocal, (newValue) => {
253
+ if (hardDiskType.value === 'mb') {
254
+ size.value = newValue
255
+ }
256
+
257
+ size.value = $binary.universalFromTo(newValue, hardDiskType.value, 'mb')
258
+ })
259
+ // const sizeInMb = computed<number>(() => {
260
+ // if (hardDiskType.value === 'mb') {
261
+ // return size.value
262
+ // }
263
+ //
264
+ // return $binary.universalFromTo(size.value, hardDiskType.value, 'mb')
265
+ // })
266
+ const onValidateSize = (): void => {
267
+ if (props.type !== 'edit') return
268
+ if (size.value < initialSize) {
269
+ sizeLocal.value = $binary.universalFromTo(
270
+ initialSize,
271
+ 'mb',
272
+ hardDiskType.value
273
+ )
274
+ }
275
+ }
276
+
277
+ const isDisabledSize = computed<boolean>(() => {
278
+ if (isNewHardDisk.value) return false
279
+ return (
280
+ props.type === 'exist' ||
281
+ (props.type === 'edit' && readOnly.value) ||
282
+ (isRunning.value && provisionType.value === 'thick')
283
+ )
284
+ })
285
+ const isDisabledProvisioning = computed<boolean>(() => {
286
+ if (isNewHardDisk.value) return false
287
+ return props.isEdit || isRunning.value
288
+ })
289
+ const isDisabledSharing = computed<boolean>(() => {
290
+ return isRunning.value && !isNewHardDisk.value
291
+ })
292
+ const isDisabledLimitIops = computed<boolean>(() => {
293
+ return isRunning.value && !isNewHardDisk.value
294
+ })
295
+ const isDisabledMode = computed<boolean>(() => {
296
+ return isRunning.value && !isNewHardDisk.value
297
+ })
298
+ const isDisabledCache = computed<boolean>(() => {
299
+ if (isNewHardDisk.value) return false
300
+ return props.isEdit || isRunning.value
301
+ })
302
+ const isDisabledBus = computed<boolean>(() => {
303
+ return !isNewHardDisk.value && isRunning.value
304
+ })
305
+
306
+ const location = ref<UI_I_DatastoreTableItem | null>(props.mainStorage || null)
307
+ const storageLocal = ref<UI_I_DatastoreTableItem | null>(props.mainStorage)
308
+ watch(
309
+ () => props.mainStorage,
310
+ (newValue) => {
311
+ location.value = newValue
312
+ storageLocal.value = newValue
313
+
314
+ storage.value = {
315
+ id: newValue?.id || '',
316
+ name: newValue?.name || '',
317
+ type: newValue?.type_text || '',
318
+ pool: newValue?.pool_name || '',
319
+ user: '',
320
+ endpoint: '',
321
+ password: '',
322
+ protocol: '',
323
+ options: '',
324
+ }
325
+ },
326
+ {
327
+ immediate: true,
328
+ deep: true,
329
+ }
330
+ )
331
+ const onChangeStorage = (item: UI_I_DatastoreTableItem): void => {
332
+ storageLocal.value = item
333
+
334
+ storage.value = {
335
+ id: item?.id || '',
336
+ name: item?.name || '',
337
+ type: item?.type_text || '',
338
+ pool: item?.pool_name || '',
339
+ user: '',
340
+ endpoint: '',
341
+ password: '',
342
+ protocol: '',
343
+ options: '',
344
+ }
345
+ }
346
+
347
+ // const diskProvisioning = ref<string>('thick')
348
+ // const sharing = ref<string>('')
349
+ // const shares = ref<number>(0)
350
+ //
351
+ // const limitIops = ref<number>(16)
352
+ // const limitIopsType = ref<string>('unlimited')
353
+ // const limitIopsInvalid = ref<boolean>(false)
354
+ //
355
+ // const diskMode = ref<string>('dependent')
356
+ //
357
+ // const cache = ref<string>('none')
358
+ //
359
+ // const bus = ref<string>('ide')
360
+ //
361
+ // const readOnly = ref<boolean>(false)
362
+ //
363
+ // const discard = ref<string>('')
364
+ //
365
+ // const io = ref<string>('')
366
+ //
367
+ // const target = ref<string>('')
368
+
369
+ // watch(
370
+ // [
371
+ // sizeInMb,
372
+ // storage,
373
+ // diskProvisioning,
374
+ // sharing,
375
+ // limitIops,
376
+ // limitIopsType,
377
+ // diskMode,
378
+ // cache,
379
+ // bus,
380
+ // deleteFilesFromDatastore,
381
+ // (): void => props.type,
382
+ // ],
383
+ // () => {
384
+ // const limitIopsLocal =
385
+ // limitIopsType.value === 'unlimited' ? 0 : limitIops.value
386
+ // const storageLocal: UI_I_SendDataNewHardDiskStorage = {
387
+ // id: storage.value?.id || '',
388
+ // name: storage.value?.name || '',
389
+ // type: storage.value?.type_text || '',
390
+ // pool: storage.value?.pool_name || '',
391
+ // user: '',
392
+ // endpoint: '',
393
+ // password: '',
394
+ // protocol: '',
395
+ // options: '',
396
+ // }
397
+ //
398
+ // emits('send-data', {
399
+ // create: props.hardDisk.create,
400
+ // attach: props.hardDisk.attach,
401
+ // source: props.hardDisk.source,
402
+ // size: Math.ceil(sizeInMb.value),
403
+ // bus: bus.value,
404
+ // target: target.value,
405
+ // storage: storageLocal,
406
+ // device_type: 'disk',
407
+ // provision_type: diskProvisioning.value,
408
+ // disk_mode: diskMode.value,
409
+ // sharing: sharing.value === 'yes',
410
+ // read_only: readOnly.value,
411
+ // shares: shares.value,
412
+ // cache: cache.value,
413
+ // io: io.value,
414
+ // limit_iops: limitIopsLocal,
415
+ // discard: discard.value,
416
+ // capacity: Math.ceil(sizeInMb.value),
417
+ // boot_order: props.hardDisk.boot_order,
418
+ // detach: props.type === 'removed',
419
+ // remove: props.type === 'removed' && deleteFilesFromDatastore.value, // Проверяем если удалили диск и указали Delete files from datastore
420
+ // })
421
+ // },
422
+ // { immediate: true }
423
+ // )
424
+
425
+ // Добавляем данные для редактирования
426
+ // watch(
427
+ // () => props.hardDisk,
428
+ // (newValue) => {
429
+ // // TODO refactoring
430
+ // if (props.type === 'exist') {
431
+ // diskProvisioning.value = newValue.provision_type || 'thick'
432
+ // return
433
+ // }
434
+ // // if (props.type !== 'edit') return
435
+ // if (props.type !== 'edit' && props.type !== 'clone') return
436
+ //
437
+ // const sizeInGb = $binary.mbToGb(newValue.size)
438
+ // if (sizeInGb < 1) {
439
+ // size.value = newValue.size
440
+ // hardDiskType.value = 'mb'
441
+ // } else {
442
+ // size.value = sizeInGb
443
+ // hardDiskType.value = 'gb'
444
+ // }
445
+ // diskProvisioning.value = newValue.provision_type || 'thick'
446
+ // sharing.value = newValue.sharing ? 'yes' : ''
447
+ // shares.value = newValue.shares || 0
448
+ // // limitIopsType.value = newValue.io === 'native' ? 'unlimited' : 'custom'
449
+ // limitIopsType.value = newValue.limit_iops === 0 ? 'unlimited' : 'custom'
450
+ // limitIops.value = newValue.limit_iops || 16
451
+ // diskMode.value = newValue.disk_mode || 'dependent'
452
+ // cache.value = newValue.cache || 'none'
453
+ // bus.value = newValue.bus || 'ide'
454
+ // readOnly.value = newValue.read_only || false
455
+ // discard.value = newValue.discard || ''
456
+ // io.value = newValue.io || ''
457
+ // target.value = newValue.target || ''
458
+ // },
459
+ // { immediate: true }
460
+ // )
461
+ watch(
462
+ isRunning,
463
+ (newValue) => {
464
+ if (newValue && props.type === 'new') {
465
+ bus.value = 'virtio'
466
+ }
467
+ },
468
+ { immediate: true }
469
+ )
470
+
471
+ const hardDiskInvalid = computed<boolean>(() => {
472
+ return !!hardDiskTypeErrorLocalText.value || limitIopsInvalid.value
473
+ })
474
+ watch(
475
+ hardDiskInvalid,
476
+ (newValue) => {
477
+ emits('invalid', newValue)
478
+ },
479
+ { immediate: true }
480
+ )
481
+ </script>
482
+
483
+ <style scoped lang="scss"></style>