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
@@ -1,7 +1,10 @@
1
1
  <template>
2
2
  <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-new
3
3
  v-if="isNewView"
4
- v-model="model"
4
+ v-model:selected-cpu="selectedCpu"
5
+ v-model:selected-core-per-socket="selectedCorePerSocket"
6
+ v-model:enable-cpu-hot-add="enableCpuHotAdd"
7
+ v-model:selected-max-cpu="selectedMaxCpu"
5
8
  v-model:reservation="reservation"
6
9
  v-model:reservation-type="reservationType"
7
10
  v-model:limit="limit"
@@ -11,6 +14,7 @@
11
14
  v-model:cpu-model="cpuModel"
12
15
  v-model:passthrough-host-cpu="passthroughHostCpu"
13
16
  v-model:host-model-cpu="hostModelCpu"
17
+ :max-cpus="props.maxCpus"
14
18
  :cpu-models="props.cpuModels"
15
19
  :is-edit="props.isEdit"
16
20
  :error-validation-fields="props.errorValidationFields"
@@ -32,7 +36,10 @@
32
36
  />
33
37
  <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-old
34
38
  v-else
35
- v-model="model"
39
+ v-model:selected-cpu="selectedCpu"
40
+ v-model:selected-core-per-socket="selectedCorePerSocket"
41
+ v-model:enable-cpu-hot-add="enableCpuHotAdd"
42
+ v-model:selected-max-cpu="selectedMaxCpu"
36
43
  v-model:reservation="reservation"
37
44
  v-model:reservation-type="reservationType"
38
45
  v-model:limit="limit"
@@ -42,6 +49,7 @@
42
49
  v-model:cpu-model="cpuModel"
43
50
  v-model:passthrough-host-cpu="passthroughHostCpu"
44
51
  v-model:host-model-cpu="hostModelCpu"
52
+ :max-cpus="props.maxCpus"
45
53
  :cpu-models="props.cpuModels"
46
54
  :is-edit="props.isEdit"
47
55
  :error-validation-fields="props.errorValidationFields"
@@ -64,27 +72,30 @@
64
72
  </template>
65
73
 
66
74
  <script setup lang="ts">
75
+ import type { UI_I_SendDataCpu } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
67
76
  import type { UI_I_Localization } from '~/lib/models/interfaces'
68
77
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
69
78
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
70
- import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
79
+ import type { API_UI_I_VmEditCpu } from '~/lib/models/store/vm/interfaces'
71
80
  import { cpuOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/lib/config/cpuOptions'
72
81
 
73
- const model = defineModel<UI_I_CreateVmData>({ required: true })
74
-
75
82
  const props = withDefaults(
76
83
  defineProps<{
84
+ maxCpus: number
77
85
  cpuModels: UI_I_OptionItem[]
78
86
  isEdit: boolean
79
- errorValidationFields: UI_I_ErrorValidationField[]
87
+ errorValidationFields: UI_I_ErrorValidationField<string>[]
80
88
  vmCpuHelpTextSecond?: string
81
89
  state?: string | number
90
+ cpu?: API_UI_I_VmEditCpu
82
91
  }>(),
83
92
  {
84
93
  state: undefined,
94
+ cpu: undefined,
85
95
  }
86
96
  )
87
97
  const emits = defineEmits<{
98
+ (event: 'send-data', value: UI_I_SendDataCpu): void
88
99
  (event: 'invalid', value: boolean): void
89
100
  (event: 'remove-error-by-title', value: string): void
90
101
  }>()
@@ -99,85 +110,74 @@ const isDisabled = computed<boolean>(() => {
99
110
  })
100
111
 
101
112
  const cpuOptions = computed<UI_I_OptionItem[]>(() =>
102
- cpuOptionsFunc(localization.value, 1, model.value.cpu.max_vcpus)
113
+ cpuOptionsFunc(localization.value, 1, props.maxCpus)
103
114
  )
104
115
 
105
- // const enableCpuHotAdd = ref<boolean>(false)
106
-
116
+ const enableCpuHotAdd = ref<boolean>(false)
107
117
  const enableCpuHotAddDisabled = computed<boolean>(
108
- // () => model.value.cpu.vcpus >= model.value.cpu.max_vcpus || isDisabled.value
118
+ // () => selectedCpu.value >= props.maxCpus || isDisabled.value
109
119
  () => isDisabled.value // pc-1766
110
120
  )
111
- watch(
112
- () => model.value.cpu.hotplug,
113
- (newValue) => {
114
- if (newValue) {
115
- model.value.cpu.max_vcpus = Math.max(
116
- model.value.cpu.vcpus,
117
- model.value.cpu.max_vcpus
118
- )
119
- return
120
- }
121
-
122
- maxCpuInvalid.value = false
123
- model.value.cpu.max_vcpus = 1
121
+ watch(enableCpuHotAdd, (newValue) => {
122
+ if (newValue) {
123
+ selectedMaxCpu.value = Math.max(selectedCpu.value, selectedMaxCpu.value)
124
+ return
124
125
  }
125
- )
126
126
 
127
- // const selectedCpu = ref<number>(
128
- // isDisabled.value && model.value.cpu.hotplug ? model.value.cpu.max_vcpus : 2
129
- // )
130
- model.value.cpu.vcpus =
131
- isDisabled.value && model.value.cpu.hotplug ? model.value.cpu.max_vcpus : 2
127
+ maxCpuInvalid.value = false
128
+ selectedMaxCpu.value = 1
129
+ })
132
130
 
131
+ const selectedCpu = ref<number>(
132
+ isDisabled.value && enableCpuHotAdd.value ? props.maxCpus : 2
133
+ )
133
134
  const isCpuDisabled = computed<boolean>(
134
- () => isDisabled.value && !model.value.cpu.hotplug
135
+ () => isDisabled.value && !enableCpuHotAdd.value
135
136
  )
137
+ watch(selectedCpu, (newValue) => {
138
+ selectedCpu.value = Math.floor(+newValue)
139
+ if (!(selectedCpu.value % selectedCorePerSocket.value) || isDisabled.value)
140
+ return
141
+ selectedCorePerSocket.value = 1
142
+ })
143
+ // watch(selectedCpu, (newValue) => {
144
+ // if (enableCpuHotAdd.value && enableCpuHotAddDisabled.value) return
145
+
146
+ // if (newValue >= props.maxCpus) { // pc-1766
147
+ // enableCpuHotAdd.value = false
148
+ // }
149
+ // selectedMaxCpu.value =
150
+ // selectedMaxCpu.value <= newValue ? newValue + 1 : selectedMaxCpu.value
151
+ // if (selectedMaxCpu.value > props.maxCpus) selectedMaxCpu.value = props.maxCpus
152
+ // })
153
+ const maxCpuOptions = computed<UI_I_OptionItem[]>(() =>
154
+ cpuOptionsFunc(localization.value, selectedCpu.value, props.maxCpus)
155
+ )
156
+ const selectedMaxCpu = ref<number>(1)
136
157
  watch(
137
- () => model.value.cpu.vcpus,
158
+ () => props.maxCpus,
138
159
  (newValue) => {
139
- model.value.cpu.vcpus = Math.floor(+newValue)
140
- if (
141
- !(model.value.cpu.vcpus % model.value.cpu.core_per_socket) ||
142
- isDisabled.value
143
- )
144
- return
145
- model.value.cpu.core_per_socket = 1
160
+ selectedMaxCpu.value = newValue
146
161
  }
147
162
  )
148
163
 
149
- const maxCpuOptions = computed<UI_I_OptionItem[]>(() =>
150
- cpuOptionsFunc(
151
- localization.value,
152
- model.value.cpu.vcpus,
153
- model.value.cpu.max_vcpus
154
- )
155
- )
156
- // const selectedMaxCpu = ref<number>(1)
157
- // watch(
158
- // () => props.maxCpus,
159
- // (newValue) => {
160
- // model.value.cpu.max_vcpus = newValue
161
- // }
162
- // )
163
-
164
164
  const selectedCpus = computed<number[]>(() =>
165
- model.value.cpu.hotplug
166
- ? [model.value.cpu.vcpus, model.value.cpu.max_vcpus]
167
- : [model.value.cpu.vcpus]
165
+ enableCpuHotAdd.value
166
+ ? [selectedCpu.value, selectedMaxCpu.value]
167
+ : [selectedCpu.value]
168
168
  )
169
169
 
170
- // const selectedCorePerSocket = ref<number>(1)
170
+ const selectedCorePerSocket = ref<number>(1)
171
171
 
172
172
  const cpuErrorLocalText = computed<string>(() => {
173
- const validValue = /^\d+(\.\d+)?$/.test(model.value.cpu.vcpus + '')
173
+ const validValue = /^\d+(\.\d+)?$/.test(selectedCpu.value + '')
174
174
  if (!validValue) {
175
175
  return localization.value.common.inputContainsInvalidCharacters
176
176
  }
177
177
 
178
178
  const min = cpuOptions.value[0].value
179
179
  const max = cpuOptions.value[1].value
180
- if (model.value.cpu.vcpus < min || model.value.cpu.vcpus > max) {
180
+ if (selectedCpu.value < min || selectedCpu.value > max) {
181
181
  return localization.value.vmWizard.cpuMustBe
182
182
  .replace('{0}', min)
183
183
  .replace('{1}', max)
@@ -216,8 +216,8 @@ const cpuInvalid = computed<boolean>(
216
216
  reservationInvalid.value ||
217
217
  limitInvalid.value ||
218
218
  sharesInvalid.value ||
219
- (model.value.cpu.hotplug &&
220
- // model.value.cpu.vcpus < model.value.cpu.max_vcpus && // pc-1766
219
+ (enableCpuHotAdd.value &&
220
+ // selectedCpu.value < props.maxCpus && // pc-1766
221
221
  maxCpuInvalid.value)
222
222
  )
223
223
  watch(
@@ -230,65 +230,12 @@ watch(
230
230
 
231
231
  const reservation = ref<string>('1')
232
232
  const reservationType = ref<string>('mhz')
233
- if (model.value.cpu.reservation_mhz !== 1) {
234
- const reservationInGhz = $binary.mhzToGhz(model.value.cpu.reservation_mhz)
235
- if (reservationInGhz < 1) {
236
- reservation.value = model.value.cpu.reservation_mhz.toString()
237
- reservationType.value = 'mhz'
238
- } else {
239
- reservation.value = reservationInGhz
240
- reservationType.value = 'ghz'
241
- }
242
- }
243
- watch(
244
- [reservation, reservationType],
245
- () => {
246
- model.value.cpu.reservation_mhz =
247
- reservationType.value === 'ghz'
248
- ? $binary.ghzToMhz(+reservation.value)
249
- : +reservation.value
250
- },
251
- { deep: true, immediate: true }
252
- )
253
233
 
254
234
  const limit = ref<string>('Unlimited')
255
235
  const limitType = ref<string>('mhz')
256
- if (model.value.cpu.limit_mhz !== null) {
257
- if (typeof model.value.cpu.limit_mhz === 'string')
258
- limit.value = model.value.cpu.limit_mhz
259
- else {
260
- const limitInGhz = $binary.mhzToGhz(model.value.cpu.limit_mhz)
261
- if (limitInGhz < 1) {
262
- limit.value = model.value.cpu.limit_mhz.toString()
263
- limitType.value = 'mhz'
264
- } else {
265
- limit.value = limitInGhz
266
- limitType.value = 'ghz'
267
- }
268
- }
269
- }
270
- watch(
271
- [limit, limitType],
272
- () => {
273
- model.value.cpu.limit_mhz =
274
- limit.value === 'Unlimited'
275
- ? limit.value
276
- : limitType.value === 'ghz'
277
- ? $binary.ghzToMhz(+limit.value)
278
- : +limit.value
279
- },
280
- { deep: true, immediate: true }
281
- )
282
236
 
283
- const shares = ref<string>(model.value.cpu.shares + '' || '2000')
284
- const sharesType = ref<string>(model.value.cpu.shares + '' || '2000') // TODO check
285
- watch(
286
- shares,
287
- () => {
288
- model.value.cpu.shares = +shares.value
289
- },
290
- { deep: true, immediate: true }
291
- )
237
+ const shares = ref<string>('2000')
238
+ const sharesType = ref<string>('2000')
292
239
 
293
240
  // const hardwareVirtualization = ref<boolean>(false)
294
241
  //
@@ -307,38 +254,111 @@ watch(
307
254
  }
308
255
  )
309
256
  const passthroughHostCpu = ref<boolean>(false)
310
- const hostModelCpu = ref<boolean>(false)
311
- if (model.value.cpu.model) {
312
- switch (model.value.cpu.model) {
313
- case 'host-passthrough':
314
- passthroughHostCpu.value = true
315
- hostModelCpu.value = false
316
- cpuModel.value = ''
317
- break
318
- case 'host-model':
319
- passthroughHostCpu.value = false
320
- hostModelCpu.value = true
321
- cpuModel.value = ''
322
- break
323
- default:
324
- cpuModel.value =
325
- props.cpuModels.find((model) => model.value === model.value.cpu.model)
326
- ?.value || cpuModel.value
327
- }
328
- }
257
+ const hostModelCpu = ref<boolean>(true)
258
+
259
+ // const isShowCpuHelp = ref<boolean>(false)
260
+
329
261
  watch(
330
- [cpuModel, passthroughHostCpu, hostModelCpu],
262
+ [
263
+ reservation,
264
+ reservationType,
265
+ limit,
266
+ limitType,
267
+ shares,
268
+ selectedCpu,
269
+ selectedMaxCpu,
270
+ selectedCorePerSocket,
271
+ enableCpuHotAdd,
272
+ cpuModel,
273
+ passthroughHostCpu,
274
+ hostModelCpu,
275
+ ],
331
276
  () => {
332
- model.value.cpu.model = passthroughHostCpu.value
277
+ const reservationInMhz =
278
+ reservationType.value === 'ghz'
279
+ ? $binary.ghzToMhz(+reservation.value)
280
+ : +reservation.value
281
+ const limitInMhz =
282
+ limit.value === 'Unlimited'
283
+ ? limit.value
284
+ : limitType.value === 'ghz'
285
+ ? $binary.ghzToMhz(+limit.value)
286
+ : +limit.value
287
+ const model = passthroughHostCpu.value
333
288
  ? 'host-passthrough'
334
289
  : hostModelCpu.value
335
290
  ? 'host-model'
336
291
  : cpuModel.value
292
+
293
+ emits('send-data', {
294
+ model,
295
+ vcpus: selectedCpu.value,
296
+ max_vcpus: enableCpuHotAdd.value ? selectedMaxCpu.value : 0,
297
+ core_per_socket: selectedCorePerSocket.value,
298
+ reservation_mhz: reservationInMhz,
299
+ limit_mhz: limitInMhz,
300
+ shares: +shares.value,
301
+ hotplug: enableCpuHotAdd.value,
302
+ })
337
303
  },
338
- { deep: true, immediate: true }
304
+ {
305
+ immediate: true,
306
+ }
339
307
  )
340
308
 
341
- // const isShowCpuHelp = ref<boolean>(false)
309
+ // Добавляем данные для редактирования
310
+ watch(
311
+ () => props.cpu,
312
+ (newValue) => {
313
+ if (!newValue) return
314
+
315
+ enableCpuHotAdd.value = newValue.hotplug
316
+ selectedCpu.value = newValue.vcpus
317
+ selectedMaxCpu.value = newValue.hotplug ? newValue.max_vcpus : 1
318
+ selectedCorePerSocket.value = newValue.core_per_socket
319
+ shares.value = '' + newValue.shares
320
+ sharesType.value = '' + newValue.shares
321
+
322
+ const reservationInGhz = $binary.mhzToGhz(newValue.reservation_mhz)
323
+ if (reservationInGhz < 1) {
324
+ reservation.value = newValue.reservation_mhz.toString()
325
+ reservationType.value = 'mhz'
326
+ } else {
327
+ reservation.value = reservationInGhz
328
+ reservationType.value = 'ghz'
329
+ }
330
+
331
+ if (typeof newValue.limit_mhz === 'string') limit.value = newValue.limit_mhz
332
+ else {
333
+ const limitInGhz = $binary.mhzToGhz(newValue.limit_mhz)
334
+ if (limitInGhz < 1) {
335
+ limit.value = newValue.limit_mhz.toString()
336
+ limitType.value = 'mhz'
337
+ } else {
338
+ limit.value = limitInGhz
339
+ limitType.value = 'ghz'
340
+ }
341
+ }
342
+
343
+ switch (newValue.model) {
344
+ case 'host-passthrough':
345
+ passthroughHostCpu.value = true
346
+ hostModelCpu.value = false
347
+ cpuModel.value = ''
348
+ break
349
+ case 'host-model':
350
+ passthroughHostCpu.value = false
351
+ hostModelCpu.value = true
352
+ cpuModel.value = ''
353
+ break
354
+ default:
355
+ cpuModel.value =
356
+ props.cpuModels.find((model) => model.value === newValue.model)
357
+ ?.value || cpuModel.value
358
+ }
359
+ },
360
+ { immediate: true }
361
+ )
342
362
 
343
363
  const onRemoveValidationError = (): void => {
344
364
  emits('remove-error-by-title', 'cpu.vcpus')
@@ -24,7 +24,7 @@
24
24
  <template #stackBlockContent>
25
25
  <div class="flex-align-center flex-space-between">
26
26
  <ui-combobox
27
- v-model.number="model.cpu.vcpus"
27
+ v-model.number="selectedCpu"
28
28
  :items="props.cpuOptions"
29
29
  :disabled="props.isCpuDisabled"
30
30
  :error-text="props.vcpusLocalAndApiErrorsTexts"
@@ -70,7 +70,7 @@
70
70
  </template>
71
71
  <template #stackChildren>
72
72
  <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-cores-per-socket
73
- v-model:selected-core-per-socket="model.cpu.core_per_socket"
73
+ v-model:selected-core-per-socket="selectedCorePerSocket"
74
74
  :selected-cpus="props.selectedCpus"
75
75
  :cpu-options="props.cpuOptions"
76
76
  :is-edit="props.isEdit"
@@ -79,12 +79,12 @@
79
79
  @remove-error-by-title="emits('remove-error-by-title', $event)"
80
80
  />
81
81
  <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-hot-plug
82
- v-model:enable-cpu-hot-add="model.cpu.hotplug"
82
+ v-model:enable-cpu-hot-add="enableCpuHotAdd"
83
83
  :disabled="props.enableCpuHotAddDisabled"
84
84
  />
85
85
  <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-max-cpu
86
- v-show="model.cpu.hotplug"
87
- v-model:selected-max-cpu.number="model.cpu.max_vcpus"
86
+ v-show="enableCpuHotAdd"
87
+ v-model:selected-max-cpu.number="selectedMaxCpu"
88
88
  :cpu-options="props.maxCpuOptions"
89
89
  :error-validation-fields="props.errorValidationFields"
90
90
  :disabled="props.isDisabled"
@@ -150,10 +150,17 @@
150
150
  import type { UI_I_Localization } from '~/lib/models/interfaces'
151
151
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
152
152
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
153
- import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
154
-
155
- const model = defineModel<UI_I_CreateVmData>({ required: true })
156
153
 
154
+ const selectedCpu = defineModel<number>('selectedCpu', { required: true })
155
+ const selectedCorePerSocket = defineModel<number>('selectedCorePerSocket', {
156
+ required: true,
157
+ })
158
+ const enableCpuHotAdd = defineModel<boolean>('enableCpuHotAdd', {
159
+ required: true,
160
+ })
161
+ const selectedMaxCpu = defineModel<number>('selectedMaxCpu', {
162
+ required: true,
163
+ })
157
164
  const reservation = defineModel<string>('reservation', { required: true })
158
165
  const reservationType = defineModel<string>('reservationType', {
159
166
  required: true,
@@ -28,7 +28,7 @@
28
28
  <template #elem>
29
29
  <atoms-combobox
30
30
  id="vm-wizard-vcpus-field"
31
- v-model.number="model.cpu.vcpus"
31
+ v-model.number="selectedCpu"
32
32
  :items="props.cpuOptions"
33
33
  :disabled="props.isCpuDisabled"
34
34
  class="input-text-color"
@@ -48,7 +48,7 @@
48
48
  </template>
49
49
  <template #stackChildren>
50
50
  <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-cores-per-socket
51
- v-model:selected-core-per-socket="model.cpu.core_per_socket"
51
+ v-model:selected-core-per-socket="selectedCorePerSocket"
52
52
  :selected-cpus="props.selectedCpus"
53
53
  :cpu-options="props.cpuOptions"
54
54
  :is-edit="props.isEdit"
@@ -57,12 +57,12 @@
57
57
  @remove-error-by-title="emits('remove-error-by-title', $event)"
58
58
  />
59
59
  <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-hot-plug
60
- v-model:enable-cpu-hot-add="model.cpu.hotplug"
60
+ v-model:enable-cpu-hot-add="enableCpuHotAdd"
61
61
  :disabled="props.enableCpuHotAddDisabled"
62
62
  />
63
63
  <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-max-cpu
64
- v-show="model.cpu.hotplug"
65
- v-model:selected-max-cpu.number="model.cpu.max_vcpus"
64
+ v-show="enableCpuHotAdd"
65
+ v-model:selected-max-cpu.number="selectedMaxCpu"
66
66
  :cpu-options="props.maxCpuOptions"
67
67
  :error-validation-fields="props.errorValidationFields"
68
68
  :disabled="props.isDisabled"
@@ -129,10 +129,15 @@
129
129
  import type { UI_I_Localization } from '~/lib/models/interfaces'
130
130
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
131
131
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
132
- import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
133
-
134
- const model = defineModel<UI_I_CreateVmData>({ required: true })
135
132
 
133
+ const selectedCpu = defineModel<number>('selectedCpu', { required: true })
134
+ const selectedCorePerSocket = defineModel<number>('selectedCorePerSocket', {
135
+ required: true,
136
+ })
137
+ const enableCpuHotAdd = defineModel<boolean>('enableCpuHotAdd', {
138
+ required: true,
139
+ })
140
+ const selectedMaxCpu = defineModel<number>('selectedMaxCpu', { required: true })
136
141
  const reservation = defineModel<string>('reservation', { required: true })
137
142
  const reservationType = defineModel<string>('reservationType', {
138
143
  required: true,