bfg-common 1.3.459 → 1.3.460

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.
@@ -83,12 +83,7 @@ import {
83
83
 
84
84
  import type { UI_I_Localization } from '~/lib/models/interfaces'
85
85
  import type { UI_T_Project } from '~/lib/models/types'
86
- // import { UI_I_VerticalStepItem } from '~/components/atoms/lib/models/interfaces'
87
- import type {
88
- UI_T_DatastoreType,
89
- UI_T_NfsType,
90
- // UI_T_WizardDatastoreMode,
91
- } from '~/components/common/wizards/datastore/add/lib/models/types'
86
+ import type { UI_T_DatastoreType } from '~/components/common/wizards/datastoreNew/add/lib/models/types'
92
87
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastoreNew/add/lib/models/interfaces'
93
88
  import type {
94
89
  UI_I_LunDisk,
@@ -101,11 +96,6 @@ import { checkValidityName } from '~/components/common/wizards/datastoreNew/add/
101
96
 
102
97
  const props = defineProps<{
103
98
  project: UI_T_Project
104
- finishFunc: (
105
- datastoreForm: UI_I_CreateDatastoreForm,
106
- datastoreType: UI_T_DatastoreType,
107
- version: UI_T_NfsType
108
- ) => Promise<void>
109
99
  datacenterHosts?: UI_I_SelectHostOptions[]
110
100
  nfsHosts?: any
111
101
  isMainFilter?: boolean
@@ -130,10 +120,8 @@ const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
130
120
  const datastoreType = ref<UI_T_DatastoreType>(
131
121
  props.project === 'procurator' ? 'local' : 'shared-storm'
132
122
  )
133
- // const nfsVersion = ref<UI_T_NfsType>('nfs-3')
134
- // const dataReadyView = ref<any>([])
135
123
 
136
- const form = ref<any>({
124
+ const form = ref<UI_I_CreateDatastoreForm>({
137
125
  name: '',
138
126
  lunDisk: [],
139
127
  type_code: E_DatastoreTypeKode[datastoreType.value],
@@ -373,11 +361,7 @@ watch(
373
361
  )
374
362
 
375
363
  const dataReadyView = computed<UI_I_DetailsItem>(() =>
376
- constructDataReadyViewFunc(
377
- localization.value,
378
- datastoreType.value,
379
- form.value
380
- )
364
+ constructDataReadyViewFunc(localization.value, form.value)
381
365
  )
382
366
  const onNextStep = (_force = false): void => {}
383
367
 
@@ -1,38 +1,11 @@
1
- import { UI_T_NfsType } from '~/components/common/wizards/datastore/add/lib/models/types'
2
-
3
- // TODO refactoring
4
- export interface UI_I_NfsPoolNameForm<T = number> {
1
+ import type { UI_T_NfsType } from '~/components/common/wizards/datastoreNew/add/lib/models/types'
2
+ export interface UI_I_CreateDatastoreForm {
3
+ name: string
4
+ lunDisk: any
5
+ nfsVersion: UI_T_NfsType
6
+ type_code: 1 | 2 | 4
7
+ readonly: boolean
5
8
  server: string
6
9
  folder: string
7
- version: T
8
- readonly: boolean
9
- hosts: string[]
10
- }
11
- export interface UI_I_CreateDatastoreBodyRequest {
12
- name: string
13
- pool_name: string
14
- type_code: number
15
- }
16
- interface I_NfsForm extends UI_I_NfsPoolNameForm<UI_T_NfsType> {
17
- name: string
18
- type_code: number
19
- }
20
- interface I_SharedStorm extends UI_I_CreateDatastoreBodyRequest {
21
- dev_names: string[]
22
- hosts: string[]
23
- }
24
-
25
- export interface UI_I_CreateDatastoreForm {
26
- local: {
27
- name: string
28
- hosts: string[]
29
- type_code: number
30
- }
31
- sharedStorm: I_SharedStorm
32
- nfs: I_NfsForm
33
- }
34
-
35
- export interface UI_I_CreateStorageUuid {
36
- code: number
37
- pool_name: string
10
+ hosts?: string[]
38
11
  }
@@ -1,9 +1,7 @@
1
1
  import type { UI_I_Localization } from '~/lib/models/interfaces'
2
2
  import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
3
3
  import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces'
4
- import { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
5
- // import { UI_I_ReadyDataForLocal } from '~/components/common/wizards/datastore/add/readyComplete/lib/models/interfaces'
6
-
4
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastoreNew/add/lib/models/interfaces'
7
5
  const constructLunDiskItems = (
8
6
  disks: UI_I_CreateStorageLunDiskItem[]
9
7
  ): string => {
@@ -19,7 +17,7 @@ const constructLunDiskItems = (
19
17
 
20
18
  const nfsDetailsFunc = (
21
19
  localization: UI_I_Localization,
22
- data: any,
20
+ data: UI_I_CreateDatastoreForm,
23
21
  isSphereWizard: boolean
24
22
  ): UI_I_DetailsItem[] => {
25
23
  const { name, server, folder, nfsVersion, hosts } = data
@@ -88,9 +86,9 @@ const nfsDetailsFunc = (
88
86
 
89
87
  const localDetailsFunc = (
90
88
  localization: UI_I_Localization,
91
- event: any
89
+ data: UI_I_CreateDatastoreForm
92
90
  ): UI_I_DetailsItem[] => {
93
- const { name } = event
91
+ const { name } = data
94
92
 
95
93
  return [
96
94
  {
@@ -110,7 +108,7 @@ const localDetailsFunc = (
110
108
 
111
109
  const sharedStormDetailsFunc = (
112
110
  localization: UI_I_Localization,
113
- data: { name: string; lunDisk: UI_I_CreateStorageLunDiskItem[] } // пока так ставляем тип но надо будет поменять когда будем добавлять осталние настройки
111
+ data: UI_I_CreateDatastoreForm
114
112
  ): UI_I_DetailsItem[] => {
115
113
  const { name, lunDisk } = data
116
114
 
@@ -164,14 +162,13 @@ const sharedStormDetailsFunc = (
164
162
 
165
163
  export const constructDataReadyViewFunc = (
166
164
  localization: UI_I_Localization,
167
- type: UI_T_DatastoreType,
168
- data: any
165
+ data: UI_I_CreateDatastoreForm
169
166
  ): UI_I_DetailsItem[] => {
170
167
  const details = {
171
- local: localDetailsFunc,
172
- 'shared-storm': sharedStormDetailsFunc,
173
- nfs: nfsDetailsFunc,
168
+ 1: localDetailsFunc,
169
+ 2: sharedStormDetailsFunc,
170
+ 4: nfsDetailsFunc,
174
171
  }
175
172
 
176
- return details[type](localization, data, false)
173
+ return details[data.type_code](localization, data, false)
177
174
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.459",
4
+ "version": "1.3.460",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -1,4 +0,0 @@
1
- export interface UI_I_ReadyDataForLocal {
2
- name: string
3
- host: string
4
- }