bfg-common 1.1.80 → 1.1.81
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/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/CoresPerSocket.vue
CHANGED
|
@@ -48,7 +48,7 @@ const localization = computed<UI_I_Localization>(() => useLocal())
|
|
|
48
48
|
|
|
49
49
|
const props = defineProps<{
|
|
50
50
|
cpuOptions: UI_I_OptionItem[]
|
|
51
|
-
|
|
51
|
+
selectedCpus: number[]
|
|
52
52
|
selectedCorePerSocket: number
|
|
53
53
|
isEdit: boolean
|
|
54
54
|
disabled: boolean
|
|
@@ -71,7 +71,7 @@ const socketOptions = computed<number[]>(() => {
|
|
|
71
71
|
const result = []
|
|
72
72
|
const cpus = props.cpuOptions[1].value
|
|
73
73
|
for (let i = 1; i <= cpus; i++) {
|
|
74
|
-
const isCommonDivisor = props.
|
|
74
|
+
const isCommonDivisor = props.selectedCpus.every(
|
|
75
75
|
(cpu) => i <= cpu && (cpu % i === 0 || i === 1)
|
|
76
76
|
)
|
|
77
77
|
if (isCommonDivisor) {
|
|
@@ -89,7 +89,7 @@ watch(
|
|
|
89
89
|
{ deep: true }
|
|
90
90
|
)
|
|
91
91
|
const socketsCount = computed<number>(() => {
|
|
92
|
-
return props.
|
|
92
|
+
return props.selectedCpus[0] / props.selectedCorePerSocket
|
|
93
93
|
})
|
|
94
94
|
const selectedCorePerSocketLocal = computed<number>({
|
|
95
95
|
get() {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<template #stackChildren>
|
|
44
44
|
<common-vm-actions-add-customize-hardware-virtual-hardware-cpu-cores-per-socket
|
|
45
45
|
v-model:selected-core-per-socket="selectedCorePerSocket"
|
|
46
|
-
:selected-
|
|
46
|
+
:selected-cpus="selectedCpus"
|
|
47
47
|
:cpu-options="cpuOptions"
|
|
48
48
|
:is-edit="props.isEdit"
|
|
49
49
|
:disabled="isDisabled"
|
|
@@ -192,6 +192,12 @@ watch(
|
|
|
192
192
|
}
|
|
193
193
|
)
|
|
194
194
|
|
|
195
|
+
const selectedCpus = computed<number[]>(() =>
|
|
196
|
+
enableCpuHotAdd.value
|
|
197
|
+
? [selectedCpu.value, selectedMaxCpu.value]
|
|
198
|
+
: [selectedCpu.value]
|
|
199
|
+
)
|
|
200
|
+
|
|
195
201
|
const selectedCorePerSocket = ref<number>(1)
|
|
196
202
|
|
|
197
203
|
const cpuErrorLocalText = computed<string>(() => {
|
|
@@ -345,8 +351,9 @@ watch(
|
|
|
345
351
|
limit.value = '' + newValue.limit_mhz
|
|
346
352
|
shares.value = '' + newValue.shares
|
|
347
353
|
cpuModel.value =
|
|
348
|
-
props.cpuModels.find(
|
|
349
|
-
|
|
354
|
+
props.cpuModels.find(
|
|
355
|
+
(model) => model.value.substr(4) === props.cpu?.model
|
|
356
|
+
)?.value || cpuModel.value
|
|
350
357
|
},
|
|
351
358
|
{ immediate: true }
|
|
352
359
|
)
|