bfg-common 1.4.87 → 1.4.89
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 +4 -0
- package/assets/localization/local_en.json +4 -0
- package/assets/localization/local_hy.json +4 -0
- package/assets/localization/local_kk.json +4 -0
- package/assets/localization/local_ru.json +4 -0
- package/assets/localization/local_zh.json +4 -0
- package/components/atoms/modal/bySteps/BySteps.vue +253 -253
- package/components/atoms/stack/StackBlock.vue +184 -184
- package/components/common/browse/blocks/Title.vue +91 -91
- package/components/common/browse/blocks/info/Date.vue +21 -21
- package/components/common/context/recursion/Recursion.vue +86 -86
- package/components/common/context/recursion/RecursionNew.vue +198 -198
- package/components/common/context/recursion/RecursionOld.vue +212 -212
- package/components/common/layout/theHeader/TheHeaderNew.vue +81 -36
- package/components/common/layout/theHeader/ThemeSwitch.vue +36 -9
- package/components/common/layout/theHeader/helpMenu/helpMenuNew/HelpMenuNew.vue +35 -16
- package/components/common/layout/theHeader/userMenu/userMenuNew/UserMenuNew.vue +32 -13
- package/components/common/split/horizontal/HorizontalNew.vue +321 -321
- package/components/common/vm/actions/add/Add.vue +609 -609
- package/components/common/vm/actions/clone/Clone.vue +522 -522
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +151 -160
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/lib/config/options.ts +20 -20
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +403 -403
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Hv.vue +99 -99
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +85 -85
- package/components/common/vm/actions/common/lib/models/interfaces.ts +148 -148
- package/components/common/vm/actions/common/lib/utils/capabilities.ts +41 -41
- package/components/common/vm/actions/common/select/lib/models/interfaces.ts +33 -33
- package/components/common/vm/actions/common/select/os/os.vue +227 -227
- package/components/common/vm/actions/editSettings/EditSettings.vue +327 -327
- package/composables/productNameLocal.ts +30 -30
- package/package.json +1 -1
- package/plugins/recursion.ts +311 -311
- package/public/spice-console/lib/images/bitmap.js +203 -203
- package/store/tasks/mappers/recentTasks.ts +45 -45
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
2
|
-
import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
|
|
3
|
-
|
|
4
|
-
export const mapCapabilities = (
|
|
5
|
-
capabilitiesFromApi: UI_I_Capabilities
|
|
6
|
-
): void => {
|
|
7
|
-
const { $binary } = useNuxtApp()
|
|
8
|
-
|
|
9
|
-
// Machine Types
|
|
10
|
-
capabilities.machineTypes = Object.keys(
|
|
11
|
-
capabilitiesFromApi.machine_types
|
|
12
|
-
).map((key) => {
|
|
13
|
-
return {
|
|
14
|
-
text: capabilitiesFromApi.machine_types[key],
|
|
15
|
-
value: key,
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
// CPU Models
|
|
19
|
-
capabilities.cpuModels = Object.keys(capabilitiesFromApi.cpu_models).map(
|
|
20
|
-
(key) => {
|
|
21
|
-
return {
|
|
22
|
-
text: capabilitiesFromApi.cpu_models[key],
|
|
23
|
-
value: key,
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
Object.keys(capabilitiesFromApi.bus_types).forEach(key => {
|
|
29
|
-
capabilities.bus[key] = Object.keys(capabilitiesFromApi.bus_types[key]).map(
|
|
30
|
-
(key2) => {
|
|
31
|
-
return {
|
|
32
|
-
text: capabilitiesFromApi.bus_types[key][key2],
|
|
33
|
-
value: key2,
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
capabilities.maxCpus = capabilitiesFromApi.max_vcpus
|
|
40
|
-
capabilities.maxMemory = $binary.kbToMb(capabilitiesFromApi.max_mem_kib)
|
|
41
|
-
}
|
|
1
|
+
import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
2
|
+
import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
|
|
3
|
+
|
|
4
|
+
export const mapCapabilities = (
|
|
5
|
+
capabilitiesFromApi: UI_I_Capabilities
|
|
6
|
+
): void => {
|
|
7
|
+
const { $binary } = useNuxtApp()
|
|
8
|
+
|
|
9
|
+
// Machine Types
|
|
10
|
+
capabilities.machineTypes = Object.keys(
|
|
11
|
+
capabilitiesFromApi.machine_types
|
|
12
|
+
).map((key) => {
|
|
13
|
+
return {
|
|
14
|
+
text: capabilitiesFromApi.machine_types[key],
|
|
15
|
+
value: key,
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
// CPU Models
|
|
19
|
+
capabilities.cpuModels = Object.keys(capabilitiesFromApi.cpu_models).map(
|
|
20
|
+
(key) => {
|
|
21
|
+
return {
|
|
22
|
+
text: capabilitiesFromApi.cpu_models[key],
|
|
23
|
+
value: key,
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
Object.keys(capabilitiesFromApi.bus_types).forEach(key => {
|
|
29
|
+
capabilities.bus[key] = Object.keys(capabilitiesFromApi.bus_types[key]).map(
|
|
30
|
+
(key2) => {
|
|
31
|
+
return {
|
|
32
|
+
text: capabilitiesFromApi.bus_types[key][key2],
|
|
33
|
+
value: key2,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
capabilities.maxCpus = capabilitiesFromApi.max_vcpus
|
|
40
|
+
capabilities.maxMemory = $binary.kbToMb(capabilitiesFromApi.max_mem_kib)
|
|
41
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
2
|
-
import type { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
|
|
3
|
-
|
|
4
|
-
export interface UI_I_OsChange {
|
|
5
|
-
selectedMachineType: UI_I_OptionItem | null
|
|
6
|
-
selectedOS: UI_I_OptionItem | null
|
|
7
|
-
selectedVersion: UI_I_OptionItem | null
|
|
8
|
-
windowsVirtualization: boolean
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface API_UI_I_CompatibilityCpu {
|
|
12
|
-
max_vcpus: number
|
|
13
|
-
models: UI_I_ArbitraryObject<string>
|
|
14
|
-
}
|
|
15
|
-
export interface API_UI_I_Compatibility {
|
|
16
|
-
compatibility: UI_I_ArbitraryObject<string>
|
|
17
|
-
guest_os_families: UI_I_ArbitraryObject<string>
|
|
18
|
-
guest_os_versions: UI_I_ArbitraryObject<UI_I_ArbitraryObject<string>>
|
|
19
|
-
machine_types: UI_I_ArbitraryObject<string>
|
|
20
|
-
cpu: API_UI_I_CompatibilityCpu
|
|
21
|
-
max_memory_mb: number
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface UI_I_Compatibility {
|
|
25
|
-
compatibility: UI_I_OptionItem[]
|
|
26
|
-
guestOsFamilies: UI_I_OptionItem[]
|
|
27
|
-
guestOsVersions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
|
|
28
|
-
machineTypes: UI_I_OptionItem[]
|
|
29
|
-
cpuModels: UI_I_OptionItem[]
|
|
30
|
-
bus: UI_I_ArbitraryObject<UI_I_OptionItem[]>
|
|
31
|
-
maxCpus: number
|
|
32
|
-
maxMemory: number
|
|
33
|
-
}
|
|
1
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
|
|
3
|
+
|
|
4
|
+
export interface UI_I_OsChange {
|
|
5
|
+
selectedMachineType: UI_I_OptionItem | null
|
|
6
|
+
selectedOS: UI_I_OptionItem | null
|
|
7
|
+
selectedVersion: UI_I_OptionItem | null
|
|
8
|
+
windowsVirtualization: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface API_UI_I_CompatibilityCpu {
|
|
12
|
+
max_vcpus: number
|
|
13
|
+
models: UI_I_ArbitraryObject<string>
|
|
14
|
+
}
|
|
15
|
+
export interface API_UI_I_Compatibility {
|
|
16
|
+
compatibility: UI_I_ArbitraryObject<string>
|
|
17
|
+
guest_os_families: UI_I_ArbitraryObject<string>
|
|
18
|
+
guest_os_versions: UI_I_ArbitraryObject<UI_I_ArbitraryObject<string>>
|
|
19
|
+
machine_types: UI_I_ArbitraryObject<string>
|
|
20
|
+
cpu: API_UI_I_CompatibilityCpu
|
|
21
|
+
max_memory_mb: number
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface UI_I_Compatibility {
|
|
25
|
+
compatibility: UI_I_OptionItem[]
|
|
26
|
+
guestOsFamilies: UI_I_OptionItem[]
|
|
27
|
+
guestOsVersions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
|
|
28
|
+
machineTypes: UI_I_OptionItem[]
|
|
29
|
+
cpuModels: UI_I_OptionItem[]
|
|
30
|
+
bus: UI_I_ArbitraryObject<UI_I_OptionItem[]>
|
|
31
|
+
maxCpus: number
|
|
32
|
+
maxMemory: number
|
|
33
|
+
}
|
|
@@ -1,227 +1,227 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="select-os">
|
|
3
|
-
<p class="select-os-block">
|
|
4
|
-
{{ localization.common.identifyingGuestSystemInstallation }}
|
|
5
|
-
</p>
|
|
6
|
-
<div class="select-os-block os-select-wrap table-row">
|
|
7
|
-
<label for="machine-type-select" class="table-cell"
|
|
8
|
-
>{{ localization.common.machineType }}:</label
|
|
9
|
-
>
|
|
10
|
-
|
|
11
|
-
<atoms-tooltip-error
|
|
12
|
-
:has-error="!!apiErrorMachineType"
|
|
13
|
-
selector="#vm-wizard-machine-type-select"
|
|
14
|
-
@remove="onRemoveValidationError('machine_type')"
|
|
15
|
-
>
|
|
16
|
-
<template #elem>
|
|
17
|
-
<select
|
|
18
|
-
id="vm-wizard-machine-type-select"
|
|
19
|
-
v-model="selectedMachineType"
|
|
20
|
-
data-id="vm-wizard-machine-type-select"
|
|
21
|
-
class="table-cell"
|
|
22
|
-
>
|
|
23
|
-
<option
|
|
24
|
-
v-for="item in machineTypeOptions"
|
|
25
|
-
:key="item.value"
|
|
26
|
-
:value="item"
|
|
27
|
-
>
|
|
28
|
-
{{ item.text }}
|
|
29
|
-
</option>
|
|
30
|
-
</select>
|
|
31
|
-
</template>
|
|
32
|
-
<template #content>{{ apiErrorMachineType }}</template>
|
|
33
|
-
</atoms-tooltip-error>
|
|
34
|
-
</div>
|
|
35
|
-
<div class="select-os-block os-select-wrap table-row">
|
|
36
|
-
<label for="os-select" class="table-cell"
|
|
37
|
-
>{{ localization.common.guestOsFamily }}:</label
|
|
38
|
-
>
|
|
39
|
-
|
|
40
|
-
<atoms-tooltip-error
|
|
41
|
-
:has-error="!!apiErrorGuestOsFamily"
|
|
42
|
-
selector="#vm-wizard-os-select"
|
|
43
|
-
@remove="onRemoveValidationError('guest_os_family')"
|
|
44
|
-
>
|
|
45
|
-
<template #elem>
|
|
46
|
-
<select
|
|
47
|
-
id="vm-wizard-os-select"
|
|
48
|
-
v-model="selectedOS"
|
|
49
|
-
data-id="vm-wizard-os-select"
|
|
50
|
-
class="table-cell"
|
|
51
|
-
@change="onChangeOS"
|
|
52
|
-
>
|
|
53
|
-
<option v-for="item in osOptions" :key="item.value" :value="item">
|
|
54
|
-
{{ item.text }}
|
|
55
|
-
</option>
|
|
56
|
-
</select>
|
|
57
|
-
</template>
|
|
58
|
-
<template #content>{{ apiErrorGuestOsFamily }}</template>
|
|
59
|
-
</atoms-tooltip-error>
|
|
60
|
-
</div>
|
|
61
|
-
<div class="select-os-block os-select-wrap table-row">
|
|
62
|
-
<label for="os-version-select" class="table-cell"
|
|
63
|
-
>{{ localization.common.guestOsVersion }}:</label
|
|
64
|
-
>
|
|
65
|
-
|
|
66
|
-
<atoms-tooltip-error
|
|
67
|
-
:has-error="!!apiErrorGuestOsVersion"
|
|
68
|
-
selector="#vm-wizard-os-version-select"
|
|
69
|
-
@remove="onRemoveValidationError('guest_os_version')"
|
|
70
|
-
>
|
|
71
|
-
<template #elem>
|
|
72
|
-
<select
|
|
73
|
-
id="vm-wizard-os-version-select"
|
|
74
|
-
v-model="selectedVersion"
|
|
75
|
-
data-id="vm-wizard-os-version-select"
|
|
76
|
-
class="table-cell"
|
|
77
|
-
>
|
|
78
|
-
<option
|
|
79
|
-
v-for="item in versionsOptions"
|
|
80
|
-
:key="item.value"
|
|
81
|
-
:value="item"
|
|
82
|
-
>
|
|
83
|
-
{{ item.text }}
|
|
84
|
-
</option>
|
|
85
|
-
</select>
|
|
86
|
-
</template>
|
|
87
|
-
<template #content>{{ apiErrorGuestOsVersion }}</template>
|
|
88
|
-
</atoms-tooltip-error>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</template>
|
|
92
|
-
|
|
93
|
-
<script setup lang="ts">
|
|
94
|
-
import type { UI_I_OsChange } from '~/components/common/vm/actions/common/select/lib/models/interfaces'
|
|
95
|
-
import type {
|
|
96
|
-
UI_I_Localization,
|
|
97
|
-
UI_I_ArbitraryObject,
|
|
98
|
-
} from '~/lib/models/interfaces'
|
|
99
|
-
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
100
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
101
|
-
|
|
102
|
-
const props = defineProps<{
|
|
103
|
-
familiesOptions: UI_I_OptionItem[]
|
|
104
|
-
machineTypesOptions: UI_I_OptionItem[]
|
|
105
|
-
versionsOptions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
|
|
106
|
-
errorValidationFields: UI_I_ErrorValidationField[]
|
|
107
|
-
}>()
|
|
108
|
-
const emits = defineEmits<{
|
|
109
|
-
(event: 'change', value: UI_I_OsChange): void
|
|
110
|
-
(event: 'remove-error-by-title', value: string): void
|
|
111
|
-
}>()
|
|
112
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
113
|
-
|
|
114
|
-
const machineTypeOptions = ref<UI_I_OptionItem[]>(props.machineTypesOptions)
|
|
115
|
-
const selectedMachineType = ref<UI_I_OptionItem | null>(null)
|
|
116
|
-
watch(
|
|
117
|
-
() => props.machineTypesOptions,
|
|
118
|
-
(newValue) => {
|
|
119
|
-
machineTypeOptions.value = [...newValue]
|
|
120
|
-
selectedMachineType.value = newValue[0]
|
|
121
|
-
},
|
|
122
|
-
{ immediate: true }
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
const osOptions = ref<UI_I_OptionItem[]>(props.familiesOptions)
|
|
126
|
-
const selectedOS = ref<UI_I_OptionItem | null>(null)
|
|
127
|
-
watch(
|
|
128
|
-
() => props.familiesOptions,
|
|
129
|
-
(newValue) => {
|
|
130
|
-
osOptions.value = [...newValue]
|
|
131
|
-
selectedOS.value = newValue[0]
|
|
132
|
-
},
|
|
133
|
-
{ immediate: true }
|
|
134
|
-
)
|
|
135
|
-
const onChangeOS = (): void => {
|
|
136
|
-
selectedVersion.value = versionsOptions.value[0]
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const versionsOptions = computed<UI_I_OptionItem[]>(() => {
|
|
140
|
-
if (!selectedOS.value) return []
|
|
141
|
-
|
|
142
|
-
return props.versionsOptions[selectedOS.value.value] || []
|
|
143
|
-
})
|
|
144
|
-
const selectedVersion = ref<UI_I_OptionItem | null>(null)
|
|
145
|
-
watch(
|
|
146
|
-
versionsOptions,
|
|
147
|
-
() => {
|
|
148
|
-
selectedVersion.value = versionsOptions.value[0]
|
|
149
|
-
},
|
|
150
|
-
{ immediate: true }
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
const windowsVirtualization = ref<boolean>(false)
|
|
154
|
-
|
|
155
|
-
// const isShowHelp = ref<boolean>(false)
|
|
156
|
-
|
|
157
|
-
watch(
|
|
158
|
-
[selectedMachineType, selectedOS, selectedVersion, windowsVirtualization],
|
|
159
|
-
() => {
|
|
160
|
-
if (!selectedOS.value) return
|
|
161
|
-
|
|
162
|
-
emits('change', {
|
|
163
|
-
selectedMachineType: selectedMachineType.value,
|
|
164
|
-
selectedOS: selectedOS.value,
|
|
165
|
-
selectedVersion: selectedVersion.value,
|
|
166
|
-
windowsVirtualization: windowsVirtualization.value,
|
|
167
|
-
})
|
|
168
|
-
},
|
|
169
|
-
{ immediate: true }
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
const apiErrorMachineType = computed<string>(() => {
|
|
173
|
-
return (
|
|
174
|
-
props.errorValidationFields?.find(
|
|
175
|
-
(message) => message.field === 'machine_type'
|
|
176
|
-
)?.error_message || ''
|
|
177
|
-
)
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
const apiErrorGuestOsFamily = computed<string>(() => {
|
|
181
|
-
return (
|
|
182
|
-
props.errorValidationFields?.find(
|
|
183
|
-
(message) => message.field === 'guest_os_family'
|
|
184
|
-
)?.error_message || ''
|
|
185
|
-
)
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
const apiErrorGuestOsVersion = computed<string>(() => {
|
|
189
|
-
return (
|
|
190
|
-
props.errorValidationFields?.find(
|
|
191
|
-
(message) => message.field === 'guest_os_version'
|
|
192
|
-
)?.error_message || ''
|
|
193
|
-
)
|
|
194
|
-
})
|
|
195
|
-
|
|
196
|
-
const onRemoveValidationError = (type: string): void => {
|
|
197
|
-
emits('remove-error-by-title', type)
|
|
198
|
-
}
|
|
199
|
-
</script>
|
|
200
|
-
|
|
201
|
-
<style scoped lang="scss">
|
|
202
|
-
.select-os {
|
|
203
|
-
.select-os-block {
|
|
204
|
-
label:not(.windows-virtualization-label) {
|
|
205
|
-
padding: 0 5px 5px 0;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.windows-virtualization-label {
|
|
209
|
-
padding: 0 4px;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
#os-select-help-icon {
|
|
215
|
-
h3 {
|
|
216
|
-
margin-top: 7px;
|
|
217
|
-
font-size: 22px;
|
|
218
|
-
color: #565656;
|
|
219
|
-
}
|
|
220
|
-
p {
|
|
221
|
-
width: 310px;
|
|
222
|
-
margin-top: 24px;
|
|
223
|
-
font-size: 14px;
|
|
224
|
-
color: #565656;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="select-os">
|
|
3
|
+
<p class="select-os-block">
|
|
4
|
+
{{ localization.common.identifyingGuestSystemInstallation }}
|
|
5
|
+
</p>
|
|
6
|
+
<div class="select-os-block os-select-wrap table-row">
|
|
7
|
+
<label for="machine-type-select" class="table-cell"
|
|
8
|
+
>{{ localization.common.machineType }}:</label
|
|
9
|
+
>
|
|
10
|
+
|
|
11
|
+
<atoms-tooltip-error
|
|
12
|
+
:has-error="!!apiErrorMachineType"
|
|
13
|
+
selector="#vm-wizard-machine-type-select"
|
|
14
|
+
@remove="onRemoveValidationError('machine_type')"
|
|
15
|
+
>
|
|
16
|
+
<template #elem>
|
|
17
|
+
<select
|
|
18
|
+
id="vm-wizard-machine-type-select"
|
|
19
|
+
v-model="selectedMachineType"
|
|
20
|
+
data-id="vm-wizard-machine-type-select"
|
|
21
|
+
class="table-cell"
|
|
22
|
+
>
|
|
23
|
+
<option
|
|
24
|
+
v-for="item in machineTypeOptions"
|
|
25
|
+
:key="item.value"
|
|
26
|
+
:value="item"
|
|
27
|
+
>
|
|
28
|
+
{{ item.text }}
|
|
29
|
+
</option>
|
|
30
|
+
</select>
|
|
31
|
+
</template>
|
|
32
|
+
<template #content>{{ apiErrorMachineType }}</template>
|
|
33
|
+
</atoms-tooltip-error>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="select-os-block os-select-wrap table-row">
|
|
36
|
+
<label for="os-select" class="table-cell"
|
|
37
|
+
>{{ localization.common.guestOsFamily }}:</label
|
|
38
|
+
>
|
|
39
|
+
|
|
40
|
+
<atoms-tooltip-error
|
|
41
|
+
:has-error="!!apiErrorGuestOsFamily"
|
|
42
|
+
selector="#vm-wizard-os-select"
|
|
43
|
+
@remove="onRemoveValidationError('guest_os_family')"
|
|
44
|
+
>
|
|
45
|
+
<template #elem>
|
|
46
|
+
<select
|
|
47
|
+
id="vm-wizard-os-select"
|
|
48
|
+
v-model="selectedOS"
|
|
49
|
+
data-id="vm-wizard-os-select"
|
|
50
|
+
class="table-cell"
|
|
51
|
+
@change="onChangeOS"
|
|
52
|
+
>
|
|
53
|
+
<option v-for="item in osOptions" :key="item.value" :value="item">
|
|
54
|
+
{{ item.text }}
|
|
55
|
+
</option>
|
|
56
|
+
</select>
|
|
57
|
+
</template>
|
|
58
|
+
<template #content>{{ apiErrorGuestOsFamily }}</template>
|
|
59
|
+
</atoms-tooltip-error>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="select-os-block os-select-wrap table-row">
|
|
62
|
+
<label for="os-version-select" class="table-cell"
|
|
63
|
+
>{{ localization.common.guestOsVersion }}:</label
|
|
64
|
+
>
|
|
65
|
+
|
|
66
|
+
<atoms-tooltip-error
|
|
67
|
+
:has-error="!!apiErrorGuestOsVersion"
|
|
68
|
+
selector="#vm-wizard-os-version-select"
|
|
69
|
+
@remove="onRemoveValidationError('guest_os_version')"
|
|
70
|
+
>
|
|
71
|
+
<template #elem>
|
|
72
|
+
<select
|
|
73
|
+
id="vm-wizard-os-version-select"
|
|
74
|
+
v-model="selectedVersion"
|
|
75
|
+
data-id="vm-wizard-os-version-select"
|
|
76
|
+
class="table-cell"
|
|
77
|
+
>
|
|
78
|
+
<option
|
|
79
|
+
v-for="item in versionsOptions"
|
|
80
|
+
:key="item.value"
|
|
81
|
+
:value="item"
|
|
82
|
+
>
|
|
83
|
+
{{ item.text }}
|
|
84
|
+
</option>
|
|
85
|
+
</select>
|
|
86
|
+
</template>
|
|
87
|
+
<template #content>{{ apiErrorGuestOsVersion }}</template>
|
|
88
|
+
</atoms-tooltip-error>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
92
|
+
|
|
93
|
+
<script setup lang="ts">
|
|
94
|
+
import type { UI_I_OsChange } from '~/components/common/vm/actions/common/select/lib/models/interfaces'
|
|
95
|
+
import type {
|
|
96
|
+
UI_I_Localization,
|
|
97
|
+
UI_I_ArbitraryObject,
|
|
98
|
+
} from '~/lib/models/interfaces'
|
|
99
|
+
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
100
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
101
|
+
|
|
102
|
+
const props = defineProps<{
|
|
103
|
+
familiesOptions: UI_I_OptionItem[]
|
|
104
|
+
machineTypesOptions: UI_I_OptionItem[]
|
|
105
|
+
versionsOptions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
|
|
106
|
+
errorValidationFields: UI_I_ErrorValidationField[]
|
|
107
|
+
}>()
|
|
108
|
+
const emits = defineEmits<{
|
|
109
|
+
(event: 'change', value: UI_I_OsChange): void
|
|
110
|
+
(event: 'remove-error-by-title', value: string): void
|
|
111
|
+
}>()
|
|
112
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
113
|
+
|
|
114
|
+
const machineTypeOptions = ref<UI_I_OptionItem[]>(props.machineTypesOptions)
|
|
115
|
+
const selectedMachineType = ref<UI_I_OptionItem | null>(null)
|
|
116
|
+
watch(
|
|
117
|
+
() => props.machineTypesOptions,
|
|
118
|
+
(newValue) => {
|
|
119
|
+
machineTypeOptions.value = [...newValue]
|
|
120
|
+
selectedMachineType.value = newValue[0]
|
|
121
|
+
},
|
|
122
|
+
{ immediate: true }
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
const osOptions = ref<UI_I_OptionItem[]>(props.familiesOptions)
|
|
126
|
+
const selectedOS = ref<UI_I_OptionItem | null>(null)
|
|
127
|
+
watch(
|
|
128
|
+
() => props.familiesOptions,
|
|
129
|
+
(newValue) => {
|
|
130
|
+
osOptions.value = [...newValue]
|
|
131
|
+
selectedOS.value = newValue[0]
|
|
132
|
+
},
|
|
133
|
+
{ immediate: true }
|
|
134
|
+
)
|
|
135
|
+
const onChangeOS = (): void => {
|
|
136
|
+
selectedVersion.value = versionsOptions.value[0]
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const versionsOptions = computed<UI_I_OptionItem[]>(() => {
|
|
140
|
+
if (!selectedOS.value) return []
|
|
141
|
+
|
|
142
|
+
return props.versionsOptions[selectedOS.value.value] || []
|
|
143
|
+
})
|
|
144
|
+
const selectedVersion = ref<UI_I_OptionItem | null>(null)
|
|
145
|
+
watch(
|
|
146
|
+
versionsOptions,
|
|
147
|
+
() => {
|
|
148
|
+
selectedVersion.value = versionsOptions.value[0]
|
|
149
|
+
},
|
|
150
|
+
{ immediate: true }
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
const windowsVirtualization = ref<boolean>(false)
|
|
154
|
+
|
|
155
|
+
// const isShowHelp = ref<boolean>(false)
|
|
156
|
+
|
|
157
|
+
watch(
|
|
158
|
+
[selectedMachineType, selectedOS, selectedVersion, windowsVirtualization],
|
|
159
|
+
() => {
|
|
160
|
+
if (!selectedOS.value) return
|
|
161
|
+
|
|
162
|
+
emits('change', {
|
|
163
|
+
selectedMachineType: selectedMachineType.value,
|
|
164
|
+
selectedOS: selectedOS.value,
|
|
165
|
+
selectedVersion: selectedVersion.value,
|
|
166
|
+
windowsVirtualization: windowsVirtualization.value,
|
|
167
|
+
})
|
|
168
|
+
},
|
|
169
|
+
{ immediate: true }
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
const apiErrorMachineType = computed<string>(() => {
|
|
173
|
+
return (
|
|
174
|
+
props.errorValidationFields?.find(
|
|
175
|
+
(message) => message.field === 'machine_type'
|
|
176
|
+
)?.error_message || ''
|
|
177
|
+
)
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
const apiErrorGuestOsFamily = computed<string>(() => {
|
|
181
|
+
return (
|
|
182
|
+
props.errorValidationFields?.find(
|
|
183
|
+
(message) => message.field === 'guest_os_family'
|
|
184
|
+
)?.error_message || ''
|
|
185
|
+
)
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
const apiErrorGuestOsVersion = computed<string>(() => {
|
|
189
|
+
return (
|
|
190
|
+
props.errorValidationFields?.find(
|
|
191
|
+
(message) => message.field === 'guest_os_version'
|
|
192
|
+
)?.error_message || ''
|
|
193
|
+
)
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
const onRemoveValidationError = (type: string): void => {
|
|
197
|
+
emits('remove-error-by-title', type)
|
|
198
|
+
}
|
|
199
|
+
</script>
|
|
200
|
+
|
|
201
|
+
<style scoped lang="scss">
|
|
202
|
+
.select-os {
|
|
203
|
+
.select-os-block {
|
|
204
|
+
label:not(.windows-virtualization-label) {
|
|
205
|
+
padding: 0 5px 5px 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.windows-virtualization-label {
|
|
209
|
+
padding: 0 4px;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
#os-select-help-icon {
|
|
215
|
+
h3 {
|
|
216
|
+
margin-top: 7px;
|
|
217
|
+
font-size: 22px;
|
|
218
|
+
color: #565656;
|
|
219
|
+
}
|
|
220
|
+
p {
|
|
221
|
+
width: 310px;
|
|
222
|
+
margin-top: 24px;
|
|
223
|
+
font-size: 14px;
|
|
224
|
+
color: #565656;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
</style>
|