bfg-common 1.5.581 → 1.5.583

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 (57) hide show
  1. package/components/common/vm/actions/add/Add.vue +46 -120
  2. package/components/common/vm/actions/add/New.vue +16 -54
  3. package/components/common/vm/actions/add/Old.vue +16 -55
  4. package/components/common/vm/actions/clone/Clone.vue +44 -116
  5. package/components/common/vm/actions/clone/new/New.vue +14 -50
  6. package/components/common/vm/actions/clone/old/Old.vue +16 -52
  7. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +14 -81
  8. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +7 -56
  9. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +8 -56
  10. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +211 -206
  11. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +225 -120
  12. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +220 -118
  13. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +66 -53
  14. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +139 -159
  15. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +8 -15
  16. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuOld.vue +8 -13
  17. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +62 -75
  18. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +241 -149
  19. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +3 -4
  20. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +2 -3
  21. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +62 -100
  22. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +6 -17
  23. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +6 -3
  24. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerOld.vue +6 -3
  25. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +17 -39
  26. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +6 -5
  27. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +6 -5
  28. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options.ts +4 -4
  29. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +6 -93
  30. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +8 -60
  31. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +8 -58
  32. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +5 -69
  33. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +12 -32
  34. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsOld.vue +12 -33
  35. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +114 -132
  36. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +41 -6
  37. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderOld.vue +44 -6
  38. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +8 -23
  39. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +21 -31
  40. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +26 -34
  41. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +28 -34
  42. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/Old.vue +24 -30
  43. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +8 -112
  44. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +3 -3
  45. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapNew.vue → New.vue} +6 -6
  46. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapOld.vue → Old.vue} +5 -5
  47. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +6 -7
  48. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +9 -27
  49. package/components/common/vm/actions/common/lib/models/interfaces.ts +58 -25
  50. package/components/common/vm/actions/editSettings/EditSettings.vue +32 -90
  51. package/components/common/vm/actions/editSettings/EditSettingsOld.vue +14 -41
  52. package/components/common/vm/actions/editSettings/new/New.vue +14 -41
  53. package/components/common/vm/actions/lib/models/interfaces.ts +4 -29
  54. package/components/common/vm/actions/lib/utils.ts +64 -36
  55. package/package.json +1 -1
  56. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordNew.vue → New.vue} +0 -0
  57. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordOld.vue → Old.vue} +0 -0
@@ -20,29 +20,19 @@
20
20
 
21
21
  <div v-else class="vm-context px-8">
22
22
  <common-vm-actions-common-customize-hardware
23
- v-model:vm-name="vmName"
24
- v-model:guest-machine-type="vmSettings.guestMachineType"
25
- v-model:guest-os-family="vmSettings.guestOsFamily"
26
- v-model:guest-os-version="vmSettings.guestOsVersion"
23
+ v-model="vmSettings"
27
24
  :project="props.project"
28
25
  :storage="vmSettings.storage"
29
- :hard-disks-for-boot-options="props.virtualHardwareHardDisks"
30
- :cd-dvd-drives-for-boot-options="props.virtualHardwareCdDvdDrives"
31
- :networks-for-boot-options="props.virtualHardwareNetworks"
32
- :cd-dvd-drives="vmSettings.cdDvdDrives"
33
- :hard-disks="vmSettings.hardDisks"
34
- :networks="vmSettings.networks"
35
- :max-cpus="vmSettings.maxCpus"
36
- :max-memory="vmSettings.maxMemory"
37
- :cpu-models="vmSettings.cpuModels"
38
- :cpu="vmSettings.cpu"
39
- :memory="vmSettings.memory"
40
- :video-card="vmSettings.videoCard"
41
- :usb-controller="vmSettings.usbController"
42
- :pci-devices="vmSettings.pciDevices"
43
- :selected-nav-item="props.selectedNavItem"
44
- :hard-disks-for-edit="vmSettings.hardDisks"
26
+ :cd-dvd-drives="vmSettings.disk_devices.filter((disk) => disk.device_type === 'cdrom')"
27
+ :hard-disks="vmSettings.disk_devices.filter((disk) => disk.device_type !== 'cdrom')"
28
+ :max-memory="props.maxMemory"
29
+ :cpu-models="props.cpuModels"
30
+ :video-card="vmSettings.video_card"
31
+ :usb-controller="vmSettings.usb_controllers"
32
+ :pci-devices="vmSettings.passthrough_pci_devices"
33
+ :hard-disks-for-edit="vmSettings.disk_devices.filter((disk) => disk.device_type !== 'cdrom')"
45
34
  :options="vmSettings.options"
35
+ :selected-nav-item="props.selectedNavItem"
46
36
  :nodes="props.nodes"
47
37
  :files="props.files"
48
38
  :networks-table="props.networksTable"
@@ -63,8 +53,6 @@
63
53
  @show-datastore-child="emits('show-datastore-child', $event)"
64
54
  @get-networks-table="emits('get-networks-table', $event)"
65
55
  @get-pci-devices="emits('get-pci-devices')"
66
- @change-boot-order="emits('change-boot-order', $event)"
67
- @send-data="emits('change-customize-hardware', $event)"
68
56
  />
69
57
  </div>
70
58
  </template>
@@ -84,12 +72,6 @@ import type {
84
72
  UI_I_VmSettings,
85
73
  } from '~/lib/models/store/vm/interfaces'
86
74
  import type { UI_I_Localization } from '~/lib/models/interfaces'
87
- import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
88
- import type {
89
- UI_I_SendDataNewCdDvdDrive,
90
- UI_I_SendDataNewHardDisk,
91
- UI_I_SendDataNewNetwork,
92
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
93
75
  import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
94
76
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
95
77
  import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
@@ -97,11 +79,9 @@ import type {
97
79
  UI_I_DatastoreTableItem,
98
80
  UI_I_FolderOrFileTreePayload,
99
81
  } from '~/lib/models/store/storage/interfaces'
100
- import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
82
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
101
83
  import { modalTexts } from '~/components/common/vm/actions/editSettings/lib/config/modal'
102
84
 
103
- const vmName = defineModel<string>('vmName', { required: true })
104
-
105
85
  const vmSettings = defineModel<UI_I_VmSettings | null>('vmSettings', {
106
86
  required: true,
107
87
  })
@@ -117,10 +97,9 @@ const props = withDefaults(
117
97
  networksTable: UI_I_NetworkTableItem[]
118
98
  selectedNavItem: UI_T_SelectedNavItem
119
99
  vmCpuHelpTextSecond: string
120
- errorValidationFields: UI_I_ErrorValidationField<string>[]
121
- virtualHardwareNetworks: UI_I_SendDataNewNetwork[] | null
122
- virtualHardwareHardDisks: UI_I_SendDataNewHardDisk[] | null
123
- virtualHardwareCdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null
100
+ errorValidationFields: UI_I_ErrorValidationField[]
101
+ maxMemory: number
102
+ cpuModels: UI_I_OptionItem[]
124
103
  state?: string | number
125
104
  vmNameOld?: string
126
105
  passthroughDevices?: UI_I_PciDevice[]
@@ -143,18 +122,12 @@ const props = withDefaults(
143
122
  const emits = defineEmits<{
144
123
  (event: 'hide'): void
145
124
  (event: 'validate'): void
146
- (event: 'update-vm'): void
147
125
  (event: 'get-storage', value: UI_I_TablePayload): void
148
126
  (event: 'get-pci-devices'): void
149
- (event: 'change-boot-order', value: UI_T_ChangeBootOrder): void
150
127
  (event: 'get-networks-table', value: UI_I_TablePayload): void
151
128
  (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
152
129
  (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
153
130
  (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
154
- (
155
- event: 'change-customize-hardware',
156
- value: UI_I_SendDataCustomizeHardware
157
- ): void
158
131
  }>()
159
132
 
160
133
  const localization = computed<UI_I_Localization>(() => useLocal())
@@ -1,40 +1,15 @@
1
- import type { UI_I_ErrorMessage } from '~/components/common/vm/actions/common/lib/models/interfaces'
2
- import type { UI_I_VmSettings } from '~/lib/models/store/vm/interfaces'
3
1
  import type {
4
- UI_I_CreateVmDataCdDvdDevice,
5
- UI_I_CreateVmDataExistDiskDevice,
6
- UI_I_CreateVmDataNewDiskDevice,
7
- UI_I_VmForm,
2
+ UI_I_CreateVmData,
3
+ UI_I_ErrorMessage,
8
4
  } from '~/components/common/vm/actions/common/lib/models/interfaces'
9
- import type {
10
- UI_I_SendDataCpu,
11
- UI_I_SendDataMemory,
12
- UI_I_SendDataNewNetwork,
13
- UI_I_SendDataNewPciDevice,
14
- UI_I_SendDataVideoCard,
15
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
16
5
 
17
6
  export interface UI_I_ConstructErrorMessagesData {
18
7
  fields: string[]
19
8
  messages: UI_I_ErrorMessage[]
20
9
  }
21
10
 
22
- export interface UI_I_VmConstructData<T> {
23
- options: T,
24
- name: string,
25
- vmData: UI_I_VmSettings | UI_I_VmForm,
26
- videoCard: UI_I_SendDataVideoCard,
27
- diskDevices: (
28
- | UI_I_CreateVmDataNewDiskDevice
29
- | UI_I_CreateVmDataExistDiskDevice
30
- | UI_I_CreateVmDataCdDvdDevice
31
- )[],
32
- networks: UI_I_SendDataNewNetwork[],
33
- storageId: string,
34
- cpu: UI_I_SendDataCpu,
35
- memory: UI_I_SendDataMemory,
36
- usbController: string,
37
- pciDevices: UI_I_SendDataNewPciDevice[]
11
+ export interface UI_I_VmConstructData {
12
+ form: UI_I_CreateVmData
38
13
  // Sphere
39
14
  uuid: string
40
15
  }
@@ -77,6 +77,25 @@ export const constructDiskDevicesFunc = (
77
77
  limit_iops: hardDisk.limit_iops ?? 0,
78
78
  }
79
79
  }
80
+ // TODO refactoring
81
+ if (hardDisk.hasOwnProperty('target')) {
82
+ result.target = hardDisk.target
83
+ }
84
+ if (hardDisk.hasOwnProperty('read_only')) {
85
+ result.read_only = hardDisk.read_only
86
+ }
87
+ if (hardDisk.hasOwnProperty('discard')) {
88
+ result.discard = hardDisk.discard
89
+ }
90
+ if (hardDisk.hasOwnProperty('attach')) {
91
+ result.attach = hardDisk.attach
92
+ }
93
+ if (hardDisk.hasOwnProperty('detach')) {
94
+ result.detach = hardDisk.detach
95
+ }
96
+ if (hardDisk.hasOwnProperty('remove')) {
97
+ result.remove = hardDisk.remove
98
+ }
80
99
  return result
81
100
  }) || []
82
101
  if (virtualHardwareCdDvdDrives) {
@@ -86,12 +105,16 @@ export const constructDiskDevicesFunc = (
86
105
  cdDvdDrive: UI_I_SendDataNewCdDvdDrive
87
106
  ): UI_I_CreateVmDataCdDvdDevice => {
88
107
  return {
108
+ ...cdDvdDrive,
89
109
  create: false,
90
- device_type: cdDvdDrive.device_type,
91
- bus: cdDvdDrive.bus,
92
- source: cdDvdDrive.source,
93
- boot_order: cdDvdDrive.boot_order,
94
110
  }
111
+ // return {
112
+ // create: false,
113
+ // device_type: cdDvdDrive.device_type,
114
+ // bus: cdDvdDrive.bus,
115
+ // source: cdDvdDrive.source,
116
+ // boot_order: cdDvdDrive.boot_order,
117
+ // }
95
118
  }
96
119
  ) || []
97
120
  diskDevices = [...diskDevices, ...cdDvdDrives]
@@ -102,37 +125,53 @@ export const constructDiskDevicesFunc = (
102
125
  export const constructSendDataForm = (
103
126
  data: UI_I_VmConstructData
104
127
  ): UI_I_CreateVmData => {
128
+ const { form, uuid = '' } = data
129
+
105
130
  const {
106
- options,
107
131
  name,
108
- vmData,
109
- videoCard,
110
- diskDevices,
111
- networks,
132
+ options,
112
133
  storage,
134
+ compatibility,
135
+ guest_os_family,
136
+ guest_os_version,
137
+ machine_type,
138
+ video_card,
139
+ disk_devices,
140
+ network_devices,
141
+ passthrough_pci_devices,
113
142
  cpu,
114
143
  memory,
115
- usbController,
116
- pciDevices,
117
- uuid = '',
118
- } = data
144
+ usb_controllers,
145
+ input_devices,
146
+ } = form
147
+
148
+ const diskDevices: (
149
+ | UI_I_CreateVmDataNewDiskDevice
150
+ | UI_I_CreateVmDataExistDiskDevice
151
+ | UI_I_CreateVmDataCdDvdDevice
152
+ )[] = constructDiskDevicesFunc(
153
+ disk_devices.filter((disk) => disk.device_type !== 'cdrom'),
154
+ disk_devices.filter((disk) => disk.device_type === 'cdrom')
155
+ )
119
156
 
120
157
  return {
121
- options,
122
- name,
123
158
  uuid,
124
- compatibility: vmData.compatibility,
125
- guest_os_family: vmData.guestOsFamily?.value,
126
- guest_os_version: vmData.guestOsVersion?.value,
127
- machine_type: vmData.guestMachineType?.value,
128
- video_card: videoCard,
159
+ name,
160
+ options,
161
+ compatibility,
162
+ usb_controllers,
163
+ input_devices,
164
+ storage: { id: storage?.id || '' },
165
+ guest_os_family: guest_os_family?.value,
166
+ guest_os_version: guest_os_version?.value,
167
+ machine_type: machine_type?.value,
168
+ video_card: video_card,
129
169
  disk_devices: diskDevices,
130
- network_devices: networks,
131
- passthrough_pci_devices: pciDevices,
132
- storage,
170
+ network_devices: network_devices,
171
+ passthrough_pci_devices: passthrough_pci_devices,
133
172
  cpu: {
134
173
  vcpus: cpu.vcpus,
135
- max_vcpus: cpu.max_vcpus,
174
+ max_vcpus: cpu.hotplug ? cpu.max_vcpus : 0,
136
175
  core_per_socket: cpu.core_per_socket,
137
176
  model: cpu.model,
138
177
  reservation_mhz: cpu.reservation_mhz,
@@ -141,22 +180,11 @@ export const constructSendDataForm = (
141
180
  hotplug: cpu.hotplug,
142
181
  },
143
182
  memory: {
144
- size_mb: +memory.memory,
183
+ size_mb: +memory.size_mb,
145
184
  hotplug: memory.hotplug,
146
185
  reservation_mb: +memory.reservation_mb,
147
186
  limit_mb: +memory.limit_mb,
148
187
  },
149
- usb_controllers: [
150
- {
151
- type: usbController,
152
- },
153
- ],
154
- input_devices: [
155
- {
156
- type: 'keyboard',
157
- bus: 'usb',
158
- },
159
- ],
160
188
  }
161
189
  }
162
190
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.581",
4
+ "version": "1.5.583",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",