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.
@@ -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 = $recursion.createAbsolutePathRecursion(
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 = $recursion.createAbsolutePathRecursion(
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 { UI_E_Fields } from '~/components/common/vm/actions/common/lib/models/enums'
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 UI_E_Fields[field]
10
+ return project === 'sphere' ? UI_E_FieldsSphere[field] : UI_E_FieldsProcurator[field]
10
11
  } else if (field.includes('disk_devices')) {
11
- return UI_E_Fields.disk_devices
12
+ return project === 'sphere' ? UI_E_FieldsSphere.disk_devices : UI_E_FieldsProcurator.disk_devices
12
13
  } else if (field.includes('network_devices')) {
13
- return UI_E_Fields.network_devices
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 UI_E_Fields {
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',
@@ -19,6 +19,7 @@ export type UI_T_CustomizeHardwareField =
19
19
 
20
20
  export type UI_T_AllField =
21
21
  | UI_T_CustomizeHardwareField
22
+ | 'compute_resource'
22
23
  | 'compatibility'
23
24
  | 'guest_os_family'
24
25
  | 'guest_os_version'
@@ -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' ||
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.289",
4
+ "version": "1.3.291",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",