bfg-common 1.3.328 → 1.3.329
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.
|
@@ -105,7 +105,7 @@ const emits = defineEmits<{
|
|
|
105
105
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
106
106
|
|
|
107
107
|
const loading = ref<boolean>(false)
|
|
108
|
-
const datastoreType = ref<UI_T_DatastoreType>('local')
|
|
108
|
+
const datastoreType = ref<UI_T_DatastoreType>(props.mode === 'procurator' ? 'local' : 'shared-storm')
|
|
109
109
|
const nfsVersion = ref<UI_T_NfsType>('nfs-3')
|
|
110
110
|
|
|
111
111
|
const stepPosition = ref<number>(0)
|
|
@@ -1,67 +1,70 @@
|
|
|
1
|
-
import { API_UI_I_Error } from '~/lib/models/store/interfaces'
|
|
2
|
-
import {
|
|
3
|
-
UI_I_DatastoreValidityName,
|
|
4
|
-
UI_T_WizardDatastoreMode,
|
|
5
|
-
} from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
6
|
-
// import {
|
|
7
|
-
// UI_I_CreateDatastoreBodyRequest,
|
|
8
|
-
// I_CreateStorageUuid,
|
|
9
|
-
// } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
10
|
-
|
|
11
|
-
// type T_StoragePoolNameResult = {
|
|
12
|
-
// data: I_CreateStorageUuid
|
|
13
|
-
// msg: API_UI_I_Error
|
|
14
|
-
// }
|
|
15
|
-
|
|
16
|
-
// type T_NullableStoragePoolNameResult = {
|
|
17
|
-
// [K in keyof T_StoragePoolNameResult]: T_StoragePoolNameResult[K] | null
|
|
18
|
-
// }
|
|
19
|
-
|
|
20
|
-
export const checkValidityName = async (
|
|
21
|
-
name: string,
|
|
22
|
-
|
|
23
|
-
): Promise<UI_I_DatastoreValidityName> => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
// }
|
|
58
|
-
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
// }
|
|
66
|
-
//
|
|
67
|
-
//
|
|
1
|
+
import { API_UI_I_Error } from '~/lib/models/store/interfaces'
|
|
2
|
+
import {
|
|
3
|
+
UI_I_DatastoreValidityName,
|
|
4
|
+
UI_T_WizardDatastoreMode,
|
|
5
|
+
} from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
6
|
+
// import {
|
|
7
|
+
// UI_I_CreateDatastoreBodyRequest,
|
|
8
|
+
// I_CreateStorageUuid,
|
|
9
|
+
// } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
10
|
+
|
|
11
|
+
// type T_StoragePoolNameResult = {
|
|
12
|
+
// data: I_CreateStorageUuid
|
|
13
|
+
// msg: API_UI_I_Error
|
|
14
|
+
// }
|
|
15
|
+
|
|
16
|
+
// type T_NullableStoragePoolNameResult = {
|
|
17
|
+
// [K in keyof T_StoragePoolNameResult]: T_StoragePoolNameResult[K] | null
|
|
18
|
+
// }
|
|
19
|
+
|
|
20
|
+
export const checkValidityName = async (
|
|
21
|
+
name: string,
|
|
22
|
+
mode: UI_T_WizardDatastoreMode = 'procurator'
|
|
23
|
+
): Promise<UI_I_DatastoreValidityName> => {
|
|
24
|
+
// TODO move to projects!!!
|
|
25
|
+
|
|
26
|
+
const kind = 10 // TODO move in global space
|
|
27
|
+
const url =
|
|
28
|
+
mode === 'procurator'
|
|
29
|
+
? `/ui/ds/validate?name=${name}`
|
|
30
|
+
: `/ui/object/validate_name?name=${name}&kind=${kind}`
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
const { error } = await useMyFetch<null, API_UI_I_Error>(url, {
|
|
33
|
+
method: 'GET',
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
if (error.value && error.value.data.error_code !== 0) {
|
|
37
|
+
const existError = error.value.data?.error_message || error.value.data
|
|
38
|
+
|
|
39
|
+
return { valid: false, msg: existError }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return { valid: true, msg: null }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// export const getStoragePoolName = async <T>(
|
|
46
|
+
// url: string,
|
|
47
|
+
// params: T
|
|
48
|
+
// ): Promise<T_NullableStoragePoolNameResult> => {
|
|
49
|
+
// const { data, error } = await useMyFetch<I_CreateStorageUuid, API_UI_I_Error>(
|
|
50
|
+
// url,
|
|
51
|
+
// {
|
|
52
|
+
// method: 'POST',
|
|
53
|
+
// body: params,
|
|
54
|
+
// }
|
|
55
|
+
// )
|
|
56
|
+
//
|
|
57
|
+
// if (error.value) return { data: null, msg: error.value }
|
|
58
|
+
//
|
|
59
|
+
// return { data: data.value, msg: null }
|
|
60
|
+
// }
|
|
61
|
+
|
|
62
|
+
// export const createDatastore = async <T = UI_I_CreateDatastoreBodyRequest>(
|
|
63
|
+
// params: T
|
|
64
|
+
// ): Promise<API_UI_I_Error> => {
|
|
65
|
+
// const { error } = await useMyFetch<any, API_UI_I_Error>('/api/v1/pn/ds', {
|
|
66
|
+
// method: 'POST',
|
|
67
|
+
// body: params,
|
|
68
|
+
// })
|
|
69
|
+
// return error.value
|
|
70
|
+
// }
|