bfg-common 1.3.295 → 1.3.297

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,17 +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
8
  // TODO refactoring for procurator
9
9
  if (checkAllField(field)) {
10
- return UI_E_Fields[field]
10
+ return project === 'sphere' ? UI_E_FieldsSphere[field] : UI_E_FieldsProcurator[field]
11
11
  } else if (field.includes('disk_devices')) {
12
- return UI_E_Fields.disk_devices
12
+ return project === 'sphere' ? UI_E_FieldsSphere.disk_devices : UI_E_FieldsProcurator.disk_devices
13
13
  } else if (field.includes('network_devices')) {
14
- return UI_E_Fields.network_devices
14
+ return project === 'sphere' ? UI_E_FieldsSphere.network_devices : UI_E_FieldsProcurator.network_devices
15
15
  }
16
16
  return 5
17
17
  }
@@ -1,32 +1,64 @@
1
- export enum UI_E_Fields {
1
+ export enum UI_E_FieldsSphere {
2
+ 'location' = 2,
2
3
  'compute_resource' = 3,
3
4
  'storage.id' = 4,
4
5
  'storage.name' = 4,
5
6
  'storage.type' = 4,
6
7
  'storage.pool' = 4,
7
8
  'compatibility' = 5,
9
+ 'guest_os_family' = 7,
10
+ 'guest_os_version' = 7,
11
+ 'machine_type' = 7,
12
+ 'cpu.vcpus' = 8,
13
+ 'cpu.max_vcpus' = 8,
14
+ 'cpu.shares' = 8,
15
+ 'cpu.core_per_socket' = 8,
16
+ 'cpu.model' = 8,
17
+ 'memory.size_mb' = 8,
18
+ 'memory.limit_mb' = 8,
19
+ 'memory.reservation_mb' = 8,
20
+ 'video_card.adapter' = 8,
21
+ 'video_card.displays' = 8,
22
+ 'video_card.memory_mb' = 8,
23
+ 'options.remote_console.type' = 8,
24
+ 'options.remote_console.spice.img_compression' = 8,
25
+ 'options.remote_console.spice.jpeg_compression' = 8,
26
+ 'options.remote_console.spice.zlib_glz_compression' = 8,
27
+ 'options.remote_console.spice.streaming_mode' = 8,
28
+ 'options.boot_options.firmware' = 8,
29
+ 'disk_devices' = 8,
30
+ 'network_devices' = 8,
31
+ }
32
+ export enum UI_E_FieldsProcurator {
33
+ 'location' = 2, // Только для Сфере
34
+ 'compute_resource' = 3, // Только для Сфере
35
+ 'storage.id' = 4,
36
+ 'storage.name' = 4,
37
+ 'storage.type' = 4,
38
+ 'storage.pool' = 4,
39
+ 'compatibility' = 5,
8
40
  'guest_os_family' = 6,
9
41
  'guest_os_version' = 6,
10
42
  'machine_type' = 6,
11
- 'cpu.vcpus' = 7,
12
- 'cpu.max_vcpus' = 7,
13
- 'cpu.shares' = 7,
14
- 'cpu.core_per_socket' = 7,
15
- 'cpu.model' = 7,
16
- 'memory.size_mb' = 7,
17
- 'memory.limit_mb' = 7,
18
- 'memory.reservation_mb' = 7,
19
- 'video_card.adapter' = 7,
20
- 'video_card.displays' = 7,
21
- 'video_card.memory_mb' = 7,
22
- 'options.remote_console.type' = 7,
23
- 'options.remote_console.spice.img_compression' = 7,
24
- 'options.remote_console.spice.jpeg_compression' = 7,
25
- 'options.remote_console.spice.zlib_glz_compression' = 7,
26
- 'options.remote_console.spice.streaming_mode' = 7,
27
- 'options.boot_options.firmware' = 7,
28
- 'disk_devices' = 7,
29
- 'network_devices' = 7,
43
+ 'cpu.vcpus' = 8,
44
+ 'cpu.max_vcpus' = 8,
45
+ 'cpu.shares' = 8,
46
+ 'cpu.core_per_socket' = 8,
47
+ 'cpu.model' = 8,
48
+ 'memory.size_mb' = 8,
49
+ 'memory.limit_mb' = 8,
50
+ 'memory.reservation_mb' = 8,
51
+ 'video_card.adapter' = 8,
52
+ 'video_card.displays' = 8,
53
+ 'video_card.memory_mb' = 8,
54
+ 'options.remote_console.type' = 8,
55
+ 'options.remote_console.spice.img_compression' = 8,
56
+ 'options.remote_console.spice.jpeg_compression' = 8,
57
+ 'options.remote_console.spice.zlib_glz_compression' = 8,
58
+ 'options.remote_console.spice.streaming_mode' = 8,
59
+ 'options.boot_options.firmware' = 8,
60
+ 'disk_devices' = 8,
61
+ 'network_devices' = 8,
30
62
  }
31
63
 
32
64
  // TODO remove because not used
@@ -19,6 +19,7 @@ export type UI_T_CustomizeHardwareField =
19
19
 
20
20
  export type UI_T_AllField =
21
21
  | UI_T_CustomizeHardwareField
22
+ | 'location'
22
23
  | 'compute_resource'
23
24
  | 'compatibility'
24
25
  | 'guest_os_family'
@@ -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 === 'location' ||
197
198
  field === 'compute_resource' ||
198
199
  field === 'compatibility' ||
199
200
  field === 'guest_os_family' ||
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.295",
4
+ "version": "1.3.297",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",