bfg-common 1.5.580 → 1.5.581

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