bfg-common 1.3.289 → 1.3.291
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/Add.vue +2 -10
- package/components/common/vm/actions/add/lib/utils.ts +6 -5
- package/components/common/vm/actions/common/lib/models/enums.ts +32 -1
- package/components/common/vm/actions/common/select/lib/models/types.ts +1 -0
- package/components/common/vm/actions/lib/utils.ts +1 -0
- package/package.json +1 -1
|
@@ -416,11 +416,7 @@ const vmFormCash = ref<UI_I_VmFormCash>({
|
|
|
416
416
|
const onChangeName = (name: string, node: UI_I_TreeNode): void => {
|
|
417
417
|
vmForm.value.name = name
|
|
418
418
|
if (isSphere.value) {
|
|
419
|
-
vmForm.value.locationPath =
|
|
420
|
-
node,
|
|
421
|
-
'id',
|
|
422
|
-
'parent'
|
|
423
|
-
)
|
|
419
|
+
vmForm.value.locationPath = node.id
|
|
424
420
|
vmForm.value.dataCenter = $recursion.findParentByValue(
|
|
425
421
|
node,
|
|
426
422
|
'datacenter',
|
|
@@ -434,11 +430,7 @@ const onChangeName = (name: string, node: UI_I_TreeNode): void => {
|
|
|
434
430
|
const computeResourcePath = ref<string>('')
|
|
435
431
|
const onSelectComputeResourceTree = (node: UI_I_TreeNode): void => {
|
|
436
432
|
emits('select-compute-resource-tree', node)
|
|
437
|
-
computeResourcePath.value =
|
|
438
|
-
node,
|
|
439
|
-
'id',
|
|
440
|
-
'parent'
|
|
441
|
-
)
|
|
433
|
+
computeResourcePath.value = node.id
|
|
442
434
|
}
|
|
443
435
|
const onChangeComputeResource = (node: UI_I_TreeNode): void => {
|
|
444
436
|
vmForm.value.computeResource = node
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
2
|
import type { UI_I_VerticalStepItem } from '~/components/atoms/lib/models/interfaces'
|
|
3
3
|
import type { UI_T_Project } from '~/lib/models/types'
|
|
4
|
-
import {
|
|
4
|
+
import { UI_E_FieldsSphere, UI_E_FieldsProcurator } from '~/components/common/vm/actions/common/lib/models/enums'
|
|
5
5
|
import { checkAllField } from '~/components/common/vm/actions/lib/utils'
|
|
6
6
|
|
|
7
|
-
export const getStepPositionByField = (field: string): number => {
|
|
7
|
+
export const getStepPositionByField = (field: string, project: UI_T_Project): number => {
|
|
8
|
+
// TODO refactoring for procurator
|
|
8
9
|
if (checkAllField(field)) {
|
|
9
|
-
return
|
|
10
|
+
return project === 'sphere' ? UI_E_FieldsSphere[field] : UI_E_FieldsProcurator[field]
|
|
10
11
|
} else if (field.includes('disk_devices')) {
|
|
11
|
-
return
|
|
12
|
+
return project === 'sphere' ? UI_E_FieldsSphere.disk_devices : UI_E_FieldsProcurator.disk_devices
|
|
12
13
|
} else if (field.includes('network_devices')) {
|
|
13
|
-
return
|
|
14
|
+
return project === 'sphere' ? UI_E_FieldsSphere.network_devices : UI_E_FieldsProcurator.network_devices
|
|
14
15
|
}
|
|
15
16
|
return 5
|
|
16
17
|
}
|
|
@@ -1,4 +1,34 @@
|
|
|
1
|
-
export enum
|
|
1
|
+
export enum UI_E_FieldsSphere {
|
|
2
|
+
'compute_resource' = 2,
|
|
3
|
+
'storage.id' = 3,
|
|
4
|
+
'storage.name' = 3,
|
|
5
|
+
'storage.type' = 3,
|
|
6
|
+
'storage.pool' = 3,
|
|
7
|
+
'compatibility' = 4,
|
|
8
|
+
'guest_os_family' = 5,
|
|
9
|
+
'guest_os_version' = 5,
|
|
10
|
+
'machine_type' = 5,
|
|
11
|
+
'cpu.vcpus' = 6,
|
|
12
|
+
'cpu.max_vcpus' = 6,
|
|
13
|
+
'cpu.shares' = 6,
|
|
14
|
+
'cpu.core_per_socket' = 6,
|
|
15
|
+
'cpu.model' = 6,
|
|
16
|
+
'memory.size_mb' = 6,
|
|
17
|
+
'memory.limit_mb' = 6,
|
|
18
|
+
'memory.reservation_mb' = 6,
|
|
19
|
+
'video_card.adapter' = 6,
|
|
20
|
+
'video_card.displays' = 6,
|
|
21
|
+
'video_card.memory_mb' = 6,
|
|
22
|
+
'options.remote_console.type' = 6,
|
|
23
|
+
'options.remote_console.spice.img_compression' = 6,
|
|
24
|
+
'options.remote_console.spice.jpeg_compression' = 6,
|
|
25
|
+
'options.remote_console.spice.zlib_glz_compression' = 6,
|
|
26
|
+
'options.remote_console.spice.streaming_mode' = 6,
|
|
27
|
+
'options.boot_options.firmware' = 6,
|
|
28
|
+
'disk_devices' = 6,
|
|
29
|
+
'network_devices' = 6,
|
|
30
|
+
}
|
|
31
|
+
export enum UI_E_FieldsProcurator {
|
|
2
32
|
'storage.id' = 2,
|
|
3
33
|
'storage.name' = 2,
|
|
4
34
|
'storage.type' = 2,
|
|
@@ -28,6 +58,7 @@ export enum UI_E_Fields {
|
|
|
28
58
|
'network_devices' = 5,
|
|
29
59
|
}
|
|
30
60
|
|
|
61
|
+
// TODO remove because not used
|
|
31
62
|
export enum UI_E_GetElemByField {
|
|
32
63
|
'storage.id' = '#none',
|
|
33
64
|
'storage.name' = '#none',
|
|
@@ -194,6 +194,7 @@ const checkCustomizeHardware = (
|
|
|
194
194
|
export const checkAllField = (field: string): field is UI_T_AllField => {
|
|
195
195
|
return (
|
|
196
196
|
checkCustomizeHardware(field) ||
|
|
197
|
+
field === 'compute_resource' ||
|
|
197
198
|
field === 'compatibility' ||
|
|
198
199
|
field === 'guest_os_family' ||
|
|
199
200
|
field === 'guest_os_version' ||
|