bfg-common 1.5.572 → 1.5.573
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.
- package/assets/localization/local_be.json +6 -29
- package/assets/localization/local_en.json +6 -29
- package/assets/localization/local_hy.json +6 -29
- package/assets/localization/local_kk.json +6 -29
- package/assets/localization/local_ru.json +6 -29
- package/assets/localization/local_zh.json +7 -30
- package/components/common/diagramMain/DiagramMain.vue +1 -1
- package/components/common/modals/confirmByInput/ConfirmByInput.vue +1 -9
- package/components/common/modals/confirmByInput/ConfirmByInputNew.vue +2 -7
- package/components/common/monitor/overview/filters/lib/config/filterOptions.ts +0 -1
- package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +1 -1
- package/components/common/pages/backups/modals/createBackup/New.vue +2 -8
- package/components/common/pages/backups/modals/createBackup/lib/config/steps.ts +1 -2
- package/components/common/pages/backups/modals/restore/Restore.vue +5 -9
- package/components/common/pages/backups/modals/restore/RestoreNew.vue +3 -13
- package/components/common/pages/backups/modals/restore/RestoreOld.vue +18 -6
- package/components/common/pages/scheduledTasks/table/Table.vue +1 -1
- package/components/common/vm/actions/add/Add.vue +52 -127
- package/components/common/vm/actions/add/New.vue +16 -54
- package/components/common/vm/actions/add/Old.vue +16 -55
- package/components/common/vm/actions/clone/Clone.vue +48 -121
- package/components/common/vm/actions/clone/new/New.vue +14 -50
- package/components/common/vm/actions/clone/old/Old.vue +16 -52
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +14 -81
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +7 -56
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +8 -56
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +208 -206
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +223 -120
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +218 -118
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +66 -53
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/lib/config/options.ts +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +139 -159
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +8 -15
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuOld.vue +8 -13
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +62 -75
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +241 -149
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +3 -4
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +2 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +58 -96
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +6 -17
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +6 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerOld.vue +6 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +17 -39
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +6 -5
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +6 -5
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options.ts +4 -4
- package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +6 -93
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +8 -62
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +8 -60
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +5 -69
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +12 -32
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsOld.vue +12 -33
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +114 -132
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +41 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderOld.vue +44 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +8 -23
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +21 -31
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +26 -34
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +28 -34
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/Old.vue +24 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +8 -112
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +3 -3
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapNew.vue → New.vue} +6 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapOld.vue → Old.vue} +5 -5
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +6 -7
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +4 -38
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsNew.vue +7 -26
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsOld.vue +24 -50
- package/components/common/vm/actions/common/lib/models/interfaces.ts +57 -25
- package/components/common/vm/actions/common/select/os/New.vue +0 -19
- package/components/common/vm/actions/common/select/os/Old.vue +0 -34
- package/components/common/vm/actions/common/select/os/Os.vue +0 -25
- package/components/common/vm/actions/editSettings/EditSettings.vue +32 -90
- package/components/common/vm/actions/editSettings/EditSettingsOld.vue +14 -41
- package/components/common/vm/actions/editSettings/new/New.vue +14 -41
- package/components/common/vm/actions/lib/models/interfaces.ts +4 -29
- package/components/common/vm/actions/lib/utils.ts +64 -36
- package/package.json +1 -3
- package/store/tasks/mappers/recentTasks.ts +0 -4
- /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordNew.vue → New.vue} +0 -0
- /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordOld.vue → Old.vue} +0 -0
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<common-vm-actions-common-customize-hardware-virtual-hardware-cpu-new
|
|
3
3
|
v-if="isNewView"
|
|
4
|
-
v-model
|
|
5
|
-
v-model:selected-core-per-socket="selectedCorePerSocket"
|
|
6
|
-
v-model:enable-cpu-hot-add="enableCpuHotAdd"
|
|
7
|
-
v-model:selected-max-cpu="selectedMaxCpu"
|
|
4
|
+
v-model="model"
|
|
8
5
|
v-model:reservation="reservation"
|
|
9
6
|
v-model:reservation-type="reservationType"
|
|
10
7
|
v-model:limit="limit"
|
|
@@ -14,7 +11,6 @@
|
|
|
14
11
|
v-model:cpu-model="cpuModel"
|
|
15
12
|
v-model:passthrough-host-cpu="passthroughHostCpu"
|
|
16
13
|
v-model:host-model-cpu="hostModelCpu"
|
|
17
|
-
:max-cpus="props.maxCpus"
|
|
18
14
|
:cpu-models="props.cpuModels"
|
|
19
15
|
:is-edit="props.isEdit"
|
|
20
16
|
:error-validation-fields="props.errorValidationFields"
|
|
@@ -36,10 +32,7 @@
|
|
|
36
32
|
/>
|
|
37
33
|
<common-vm-actions-common-customize-hardware-virtual-hardware-cpu-old
|
|
38
34
|
v-else
|
|
39
|
-
v-model
|
|
40
|
-
v-model:selected-core-per-socket="selectedCorePerSocket"
|
|
41
|
-
v-model:enable-cpu-hot-add="enableCpuHotAdd"
|
|
42
|
-
v-model:selected-max-cpu="selectedMaxCpu"
|
|
35
|
+
v-model="model"
|
|
43
36
|
v-model:reservation="reservation"
|
|
44
37
|
v-model:reservation-type="reservationType"
|
|
45
38
|
v-model:limit="limit"
|
|
@@ -49,7 +42,6 @@
|
|
|
49
42
|
v-model:cpu-model="cpuModel"
|
|
50
43
|
v-model:passthrough-host-cpu="passthroughHostCpu"
|
|
51
44
|
v-model:host-model-cpu="hostModelCpu"
|
|
52
|
-
:max-cpus="props.maxCpus"
|
|
53
45
|
:cpu-models="props.cpuModels"
|
|
54
46
|
:is-edit="props.isEdit"
|
|
55
47
|
:error-validation-fields="props.errorValidationFields"
|
|
@@ -72,30 +64,27 @@
|
|
|
72
64
|
</template>
|
|
73
65
|
|
|
74
66
|
<script setup lang="ts">
|
|
75
|
-
import type { UI_I_SendDataCpu } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
76
67
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
77
68
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
78
69
|
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
79
|
-
import type {
|
|
70
|
+
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
80
71
|
import { cpuOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/lib/config/cpuOptions'
|
|
81
72
|
|
|
73
|
+
const model = defineModel<UI_I_CreateVmData>({ required: true })
|
|
74
|
+
|
|
82
75
|
const props = withDefaults(
|
|
83
76
|
defineProps<{
|
|
84
|
-
maxCpus: number
|
|
85
77
|
cpuModels: UI_I_OptionItem[]
|
|
86
78
|
isEdit: boolean
|
|
87
|
-
errorValidationFields: UI_I_ErrorValidationField
|
|
79
|
+
errorValidationFields: UI_I_ErrorValidationField[]
|
|
88
80
|
vmCpuHelpTextSecond?: string
|
|
89
81
|
state?: string | number
|
|
90
|
-
cpu?: API_UI_I_VmEditCpu
|
|
91
82
|
}>(),
|
|
92
83
|
{
|
|
93
84
|
state: undefined,
|
|
94
|
-
cpu: undefined,
|
|
95
85
|
}
|
|
96
86
|
)
|
|
97
87
|
const emits = defineEmits<{
|
|
98
|
-
(event: 'send-data', value: UI_I_SendDataCpu): void
|
|
99
88
|
(event: 'invalid', value: boolean): void
|
|
100
89
|
(event: 'remove-error-by-title', value: string): void
|
|
101
90
|
}>()
|
|
@@ -110,74 +99,85 @@ const isDisabled = computed<boolean>(() => {
|
|
|
110
99
|
})
|
|
111
100
|
|
|
112
101
|
const cpuOptions = computed<UI_I_OptionItem[]>(() =>
|
|
113
|
-
cpuOptionsFunc(localization.value, 1,
|
|
102
|
+
cpuOptionsFunc(localization.value, 1, model.value.cpu.max_vcpus)
|
|
114
103
|
)
|
|
115
104
|
|
|
116
|
-
const enableCpuHotAdd = ref<boolean>(false)
|
|
105
|
+
// const enableCpuHotAdd = ref<boolean>(false)
|
|
106
|
+
|
|
117
107
|
const enableCpuHotAddDisabled = computed<boolean>(
|
|
118
|
-
// () =>
|
|
108
|
+
// () => model.value.cpu.vcpus >= model.value.cpu.max_vcpus || isDisabled.value
|
|
119
109
|
() => isDisabled.value // pc-1766
|
|
120
110
|
)
|
|
121
|
-
watch(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
|
125
124
|
}
|
|
125
|
+
)
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
|
130
132
|
|
|
131
|
-
const selectedCpu = ref<number>(
|
|
132
|
-
isDisabled.value && enableCpuHotAdd.value ? props.maxCpus : 2
|
|
133
|
-
)
|
|
134
133
|
const isCpuDisabled = computed<boolean>(
|
|
135
|
-
() => isDisabled.value && !
|
|
134
|
+
() => isDisabled.value && !model.value.cpu.hotplug
|
|
136
135
|
)
|
|
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)
|
|
157
136
|
watch(
|
|
158
|
-
() =>
|
|
137
|
+
() => model.value.cpu.vcpus,
|
|
159
138
|
(newValue) => {
|
|
160
|
-
|
|
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
|
|
161
146
|
}
|
|
162
147
|
)
|
|
163
148
|
|
|
149
|
+
const maxCpuOptions = computed<UI_I_OptionItem[]>(() =>
|
|
150
|
+
cpuOptionsFunc(
|
|
151
|
+
localization.value,
|
|
152
|
+
model.value.cpu.vcpus,
|
|
153
|
+
model.value.cpu.max_vcpus
|
|
154
|
+
)
|
|
155
|
+
)
|
|
156
|
+
// const selectedMaxCpu = ref<number>(1)
|
|
157
|
+
// watch(
|
|
158
|
+
// () => props.maxCpus,
|
|
159
|
+
// (newValue) => {
|
|
160
|
+
// model.value.cpu.max_vcpus = newValue
|
|
161
|
+
// }
|
|
162
|
+
// )
|
|
163
|
+
|
|
164
164
|
const selectedCpus = computed<number[]>(() =>
|
|
165
|
-
|
|
166
|
-
? [
|
|
167
|
-
: [
|
|
165
|
+
model.value.cpu.hotplug
|
|
166
|
+
? [model.value.cpu.vcpus, model.value.cpu.max_vcpus]
|
|
167
|
+
: [model.value.cpu.vcpus]
|
|
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(
|
|
173
|
+
const validValue = /^\d+(\.\d+)?$/.test(model.value.cpu.vcpus + '')
|
|
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 (
|
|
180
|
+
if (model.value.cpu.vcpus < min || model.value.cpu.vcpus > 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
|
-
(
|
|
220
|
-
//
|
|
219
|
+
(model.value.cpu.hotplug &&
|
|
220
|
+
// model.value.cpu.vcpus < model.value.cpu.max_vcpus && // pc-1766
|
|
221
221
|
maxCpuInvalid.value)
|
|
222
222
|
)
|
|
223
223
|
watch(
|
|
@@ -230,12 +230,65 @@ 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
|
+
)
|
|
233
253
|
|
|
234
254
|
const limit = ref<string>('Unlimited')
|
|
235
255
|
const limitType = ref<string>('mhz')
|
|
256
|
+
if (model.value.cpu.limit_mhz !== null) {
|
|
257
|
+
if (typeof model.value.cpu.limit_mhz === 'string')
|
|
258
|
+
limit.value = model.value.cpu.limit_mhz
|
|
259
|
+
else {
|
|
260
|
+
const limitInGhz = $binary.mhzToGhz(model.value.cpu.limit_mhz)
|
|
261
|
+
if (limitInGhz < 1) {
|
|
262
|
+
limit.value = model.value.cpu.limit_mhz.toString()
|
|
263
|
+
limitType.value = 'mhz'
|
|
264
|
+
} else {
|
|
265
|
+
limit.value = limitInGhz
|
|
266
|
+
limitType.value = 'ghz'
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
watch(
|
|
271
|
+
[limit, limitType],
|
|
272
|
+
() => {
|
|
273
|
+
model.value.cpu.limit_mhz =
|
|
274
|
+
limit.value === 'Unlimited'
|
|
275
|
+
? limit.value
|
|
276
|
+
: limitType.value === 'ghz'
|
|
277
|
+
? $binary.ghzToMhz(+limit.value)
|
|
278
|
+
: +limit.value
|
|
279
|
+
},
|
|
280
|
+
{ deep: true, immediate: true }
|
|
281
|
+
)
|
|
236
282
|
|
|
237
|
-
const shares = ref<string>('2000')
|
|
238
|
-
const sharesType = ref<string>('2000')
|
|
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
|
+
)
|
|
239
292
|
|
|
240
293
|
// const hardwareVirtualization = ref<boolean>(false)
|
|
241
294
|
//
|
|
@@ -254,111 +307,38 @@ watch(
|
|
|
254
307
|
}
|
|
255
308
|
)
|
|
256
309
|
const passthroughHostCpu = ref<boolean>(false)
|
|
257
|
-
const hostModelCpu = ref<boolean>(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
+
}
|
|
261
329
|
watch(
|
|
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
|
-
],
|
|
330
|
+
[cpuModel, passthroughHostCpu, hostModelCpu],
|
|
276
331
|
() => {
|
|
277
|
-
|
|
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
|
|
332
|
+
model.value.cpu.model = passthroughHostCpu.value
|
|
288
333
|
? 'host-passthrough'
|
|
289
334
|
: hostModelCpu.value
|
|
290
335
|
? 'host-model'
|
|
291
336
|
: 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
|
-
})
|
|
303
337
|
},
|
|
304
|
-
{
|
|
305
|
-
immediate: true,
|
|
306
|
-
}
|
|
338
|
+
{ deep: true, immediate: true }
|
|
307
339
|
)
|
|
308
340
|
|
|
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
|
-
)
|
|
341
|
+
// const isShowCpuHelp = ref<boolean>(false)
|
|
362
342
|
|
|
363
343
|
const onRemoveValidationError = (): void => {
|
|
364
344
|
emits('remove-error-by-title', 'cpu.vcpus')
|
package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue
CHANGED
|
@@ -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="
|
|
27
|
+
v-model.number="model.cpu.vcpus"
|
|
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="
|
|
73
|
+
v-model:selected-core-per-socket="model.cpu.core_per_socket"
|
|
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="
|
|
82
|
+
v-model:enable-cpu-hot-add="model.cpu.hotplug"
|
|
83
83
|
:disabled="props.enableCpuHotAddDisabled"
|
|
84
84
|
/>
|
|
85
85
|
<common-vm-actions-common-customize-hardware-virtual-hardware-cpu-max-cpu
|
|
86
|
-
v-show="
|
|
87
|
-
v-model:selected-max-cpu.number="
|
|
86
|
+
v-show="model.cpu.hotplug"
|
|
87
|
+
v-model:selected-max-cpu.number="model.cpu.max_vcpus"
|
|
88
88
|
:cpu-options="props.maxCpuOptions"
|
|
89
89
|
:error-validation-fields="props.errorValidationFields"
|
|
90
90
|
:disabled="props.isDisabled"
|
|
@@ -150,17 +150,10 @@
|
|
|
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 })
|
|
153
156
|
|
|
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
|
-
})
|
|
164
157
|
const reservation = defineModel<string>('reservation', { required: true })
|
|
165
158
|
const reservationType = defineModel<string>('reservationType', {
|
|
166
159
|
required: true,
|
package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuOld.vue
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<template #elem>
|
|
29
29
|
<atoms-combobox
|
|
30
30
|
id="vm-wizard-vcpus-field"
|
|
31
|
-
v-model.number="
|
|
31
|
+
v-model.number="model.cpu.vcpus"
|
|
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="
|
|
51
|
+
v-model:selected-core-per-socket="model.cpu.core_per_socket"
|
|
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="
|
|
60
|
+
v-model:enable-cpu-hot-add="model.cpu.hotplug"
|
|
61
61
|
:disabled="props.enableCpuHotAddDisabled"
|
|
62
62
|
/>
|
|
63
63
|
<common-vm-actions-common-customize-hardware-virtual-hardware-cpu-max-cpu
|
|
64
|
-
v-show="
|
|
65
|
-
v-model:selected-max-cpu.number="
|
|
64
|
+
v-show="model.cpu.hotplug"
|
|
65
|
+
v-model:selected-max-cpu.number="model.cpu.max_vcpus"
|
|
66
66
|
:cpu-options="props.maxCpuOptions"
|
|
67
67
|
:error-validation-fields="props.errorValidationFields"
|
|
68
68
|
:disabled="props.isDisabled"
|
|
@@ -129,15 +129,10 @@
|
|
|
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 })
|
|
132
135
|
|
|
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 })
|
|
141
136
|
const reservation = defineModel<string>('reservation', { required: true })
|
|
142
137
|
const reservationType = defineModel<string>('reservationType', {
|
|
143
138
|
required: true,
|