bfg-common 1.5.847 → 1.5.848
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.
|
@@ -1,170 +1,176 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="">
|
|
3
|
-
<atoms-stack-block :has-children="false">
|
|
4
|
-
<template #stackBlockKey>
|
|
5
|
-
{{ localization.common.schedulingAffinity }}
|
|
6
|
-
</template>
|
|
7
|
-
<template #stackBlockContent>
|
|
8
|
-
<div class="flex-space-between">
|
|
9
|
-
<div class="flex-align-center">
|
|
10
|
-
<atoms-tooltip-error
|
|
11
|
-
:has-error="!!errorText"
|
|
12
|
-
selector="#sa-edit-setting-input"
|
|
13
|
-
@remove="onRemoveValidationError"
|
|
14
|
-
>
|
|
15
|
-
<template #elem>
|
|
16
|
-
<input
|
|
17
|
-
id="sa-edit-setting-input"
|
|
18
|
-
v-model="schedulingAffinity"
|
|
19
|
-
data-id="sa-edit-setting-input"
|
|
20
|
-
type="text"
|
|
21
|
-
class="edit-setting-input"
|
|
22
|
-
@blur="onBlur"
|
|
23
|
-
/>
|
|
24
|
-
</template>
|
|
25
|
-
<template #content>{{ errorText }}</template>
|
|
26
|
-
</atoms-tooltip-error>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<div id="sa-help-icon">
|
|
30
|
-
<atoms-the-icon
|
|
31
|
-
fill="#0072a3"
|
|
32
|
-
width="24px"
|
|
33
|
-
height="24px"
|
|
34
|
-
name="info-circle"
|
|
35
|
-
data-id="show-sa-help-icon"
|
|
36
|
-
@click.stop="isShowSaHelp = !isShowSaHelp"
|
|
37
|
-
/>
|
|
38
|
-
<Teleport to="body">
|
|
39
|
-
<atoms-tooltip-signpost
|
|
40
|
-
v-if="isShowSaHelp"
|
|
41
|
-
elem-id="sa-help-icon"
|
|
42
|
-
@hide="isShowSaHelp = false"
|
|
43
|
-
>
|
|
44
|
-
<h3 class="sa-help-title">
|
|
45
|
-
{{ localization.mainNavigation.help }}
|
|
46
|
-
</h3>
|
|
47
|
-
|
|
48
|
-
<p class="sa-help-text">
|
|
49
|
-
{{ localization.common.schedulingAffinityHelpDescription1 }}
|
|
50
|
-
</p>
|
|
51
|
-
<p class="sa-help-text">
|
|
52
|
-
{{ localization.common.schedulingAffinityHelpDescription2 }}
|
|
53
|
-
</p>
|
|
54
|
-
<p class="sa-help-text">
|
|
55
|
-
{{ localization.common.schedulingAffinityHelpDescription3 }}
|
|
56
|
-
</p>
|
|
57
|
-
<p class="sa-help-text">
|
|
58
|
-
<strong
|
|
59
|
-
>{{ localization.common.hyperthreadingStatus }}:
|
|
60
|
-
</strong>
|
|
61
|
-
{{ localization.common.inactive }}
|
|
62
|
-
</p>
|
|
63
|
-
<!-- <p class="sa-help-text">-->
|
|
64
|
-
<!-- <strong>{{ localization.common.availableCpus }}: </strong>-->
|
|
65
|
-
<!-- 8({{ localization.common.physicalCpus }})-->
|
|
66
|
-
<!-- </p>-->
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
import {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
margin-top:
|
|
162
|
-
font-size:
|
|
163
|
-
color: #565656;
|
|
164
|
-
}
|
|
165
|
-
p.sa-help-text
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="">
|
|
3
|
+
<atoms-stack-block :has-children="false">
|
|
4
|
+
<template #stackBlockKey>
|
|
5
|
+
{{ localization.common.schedulingAffinity }}
|
|
6
|
+
</template>
|
|
7
|
+
<template #stackBlockContent>
|
|
8
|
+
<div class="flex-space-between">
|
|
9
|
+
<div class="flex-align-center">
|
|
10
|
+
<atoms-tooltip-error
|
|
11
|
+
:has-error="!!errorText"
|
|
12
|
+
selector="#sa-edit-setting-input"
|
|
13
|
+
@remove="onRemoveValidationError"
|
|
14
|
+
>
|
|
15
|
+
<template #elem>
|
|
16
|
+
<input
|
|
17
|
+
id="sa-edit-setting-input"
|
|
18
|
+
v-model="schedulingAffinity"
|
|
19
|
+
data-id="sa-edit-setting-input"
|
|
20
|
+
type="text"
|
|
21
|
+
class="edit-setting-input"
|
|
22
|
+
@blur="onBlur"
|
|
23
|
+
/>
|
|
24
|
+
</template>
|
|
25
|
+
<template #content>{{ errorText }}</template>
|
|
26
|
+
</atoms-tooltip-error>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div id="sa-help-icon">
|
|
30
|
+
<atoms-the-icon
|
|
31
|
+
fill="#0072a3"
|
|
32
|
+
width="24px"
|
|
33
|
+
height="24px"
|
|
34
|
+
name="info-circle"
|
|
35
|
+
data-id="show-sa-help-icon"
|
|
36
|
+
@click.stop="isShowSaHelp = !isShowSaHelp"
|
|
37
|
+
/>
|
|
38
|
+
<Teleport to="body">
|
|
39
|
+
<atoms-tooltip-signpost
|
|
40
|
+
v-if="isShowSaHelp"
|
|
41
|
+
elem-id="sa-help-icon"
|
|
42
|
+
@hide="isShowSaHelp = false"
|
|
43
|
+
>
|
|
44
|
+
<h3 class="sa-help-title">
|
|
45
|
+
{{ localization.mainNavigation.help }}
|
|
46
|
+
</h3>
|
|
47
|
+
|
|
48
|
+
<p class="sa-help-text">
|
|
49
|
+
{{ localization.common.schedulingAffinityHelpDescription1 }}
|
|
50
|
+
</p>
|
|
51
|
+
<p class="sa-help-text">
|
|
52
|
+
{{ localization.common.schedulingAffinityHelpDescription2 }}
|
|
53
|
+
</p>
|
|
54
|
+
<p class="sa-help-text">
|
|
55
|
+
{{ localization.common.schedulingAffinityHelpDescription3 }}
|
|
56
|
+
</p>
|
|
57
|
+
<p class="sa-help-text">
|
|
58
|
+
<strong
|
|
59
|
+
>{{ localization.common.hyperthreadingStatus }}:
|
|
60
|
+
</strong>
|
|
61
|
+
{{ localization.common.inactive }}
|
|
62
|
+
</p>
|
|
63
|
+
<!-- <p class="sa-help-text">-->
|
|
64
|
+
<!-- <strong>{{ localization.common.availableCpus }}: </strong>-->
|
|
65
|
+
<!-- 8({{ localization.common.physicalCpus }})-->
|
|
66
|
+
<!-- </p>-->
|
|
67
|
+
<template v-if="numsLocal">
|
|
68
|
+
<div
|
|
69
|
+
v-for="item in numsLocal"
|
|
70
|
+
:key="item.label"
|
|
71
|
+
class="sa-help-text"
|
|
72
|
+
>
|
|
73
|
+
<strong>{{ item.label }} </strong>
|
|
74
|
+
<p>{{ item.value }}</p>
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
|
77
|
+
</atoms-tooltip-signpost>
|
|
78
|
+
</Teleport>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</template>
|
|
82
|
+
</atoms-stack-block>
|
|
83
|
+
</div>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<script setup lang="ts">
|
|
87
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
88
|
+
import { validateAffinityInput } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/sa/lib/utils/validation'
|
|
89
|
+
import { groupConsecutiveNumbers } from '~/lib/utils/nums'
|
|
90
|
+
|
|
91
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
92
|
+
|
|
93
|
+
const schedulingAffinity = defineModel<string>({
|
|
94
|
+
required: true,
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
const props = defineProps<{
|
|
98
|
+
nums?: any // для прокуратора
|
|
99
|
+
}>()
|
|
100
|
+
const emits = defineEmits<{
|
|
101
|
+
(event: 'invalid', value: boolean): void
|
|
102
|
+
(event: 'remove-error-by-title', value: string): void
|
|
103
|
+
}>()
|
|
104
|
+
|
|
105
|
+
const isShowSaHelp = ref<boolean>(false)
|
|
106
|
+
|
|
107
|
+
const numsLocal = computed<any>(() => {
|
|
108
|
+
if (!props.nums) return []
|
|
109
|
+
|
|
110
|
+
const cpuTopology = []
|
|
111
|
+
for (const key in props.nums.cpu) {
|
|
112
|
+
cpuTopology.push({
|
|
113
|
+
label: `CPU NUMA ${+key + 1}`,
|
|
114
|
+
value:
|
|
115
|
+
'cores: ' +
|
|
116
|
+
groupConsecutiveNumbers(props.nums.cpu[key]) +
|
|
117
|
+
'; memory: ' +
|
|
118
|
+
props.nums.ram[key],
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
return cpuTopology
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
const errorText = ref<string>('')
|
|
125
|
+
const onBlur = (): void => {
|
|
126
|
+
let cpuNums = []
|
|
127
|
+
if (props.nums) {
|
|
128
|
+
for (const key in props.nums.cpu) {
|
|
129
|
+
cpuNums.push(...props.nums.cpu[key])
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
const validation = validateAffinityInput(
|
|
133
|
+
schedulingAffinity.value,
|
|
134
|
+
localization.value,
|
|
135
|
+
cpuNums
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
errorText.value = ''
|
|
139
|
+
|
|
140
|
+
if (!validation.isValid) {
|
|
141
|
+
errorText.value = validation.error
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const isInvalid = computed<boolean>(() => !!errorText.value)
|
|
146
|
+
watch(
|
|
147
|
+
isInvalid,
|
|
148
|
+
(newValue) => {
|
|
149
|
+
emits('invalid', newValue)
|
|
150
|
+
},
|
|
151
|
+
{ immediate: true }
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
const onRemoveValidationError = (): void => {
|
|
155
|
+
emits('remove-error-by-title', 'cpu.temp') // TODO
|
|
156
|
+
}
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
<style scoped lang="scss">
|
|
160
|
+
h3.sa-help-title {
|
|
161
|
+
margin-top: 7px;
|
|
162
|
+
font-size: 22px;
|
|
163
|
+
color: #565656;
|
|
164
|
+
}
|
|
165
|
+
p.sa-help-text {
|
|
166
|
+
width: 310px;
|
|
167
|
+
margin-top: 24px;
|
|
168
|
+
font-size: 14px;
|
|
169
|
+
color: #565656;
|
|
170
|
+
}
|
|
171
|
+
p.sa-help-text strong {
|
|
172
|
+
font-size: 14px;
|
|
173
|
+
font-weight: bold;
|
|
174
|
+
color: #565656;
|
|
175
|
+
}
|
|
176
|
+
</style>
|
|
@@ -152,7 +152,7 @@ export const validateAffinityInput = (
|
|
|
152
152
|
if (singleRegex.test(part)) {
|
|
153
153
|
const cpuNum = parseInt(part, 10)
|
|
154
154
|
|
|
155
|
-
if (!availableCPUSet.has(cpuNum)) {
|
|
155
|
+
if (!availableCPUSet.has(cpuNum) && availableCPUs.length) {
|
|
156
156
|
const availableList =
|
|
157
157
|
availableCPUs.length > 0
|
|
158
158
|
? groupConsecutiveNumbers(availableCPUs.sort((a, b) => a - b))
|
|
@@ -189,7 +189,7 @@ export const validateAffinityInput = (
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
// Проверяем доступность начала диапазона
|
|
192
|
-
if (!availableCPUSet.has(start)) {
|
|
192
|
+
if (!availableCPUSet.has(start) && availableCPUs.length) {
|
|
193
193
|
const availableList =
|
|
194
194
|
availableCPUs.length > 0
|
|
195
195
|
? availableCPUs.sort((a, b) => a - b).join(', ')
|
|
@@ -204,7 +204,7 @@ export const validateAffinityInput = (
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
// Проверяем доступность конца диапазона
|
|
207
|
-
if (!availableCPUSet.has(end)) {
|
|
207
|
+
if (!availableCPUSet.has(end) && availableCPUs.length) {
|
|
208
208
|
const availableList =
|
|
209
209
|
availableCPUs.length > 0
|
|
210
210
|
? availableCPUs.sort((a, b) => a - b).join(', ')
|
|
@@ -221,7 +221,7 @@ export const validateAffinityInput = (
|
|
|
221
221
|
// Проверяем все процессоры в диапазоне
|
|
222
222
|
let hasInvalidInRange = false
|
|
223
223
|
for (let cpu = start; cpu <= end; cpu++) {
|
|
224
|
-
if (!availableCPUSet.has(cpu)) {
|
|
224
|
+
if (!availableCPUSet.has(cpu) && availableCPUs.length) {
|
|
225
225
|
const availableList =
|
|
226
226
|
availableCPUs.length > 0
|
|
227
227
|
? availableCPUs.sort((a, b) => a - b).join(', ')
|