bfg-common 1.4.58 → 1.4.60

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.
Files changed (98) hide show
  1. package/components/common/wizards/datastore/add/Add.vue +232 -362
  2. package/components/common/wizards/{datastoreNew → datastore}/add/lib/config/steps.ts +3 -0
  3. package/components/common/wizards/datastore/add/lib/models/interfaces.ts +11 -30
  4. package/components/common/wizards/datastore/add/lib/models/types.ts +0 -7
  5. package/components/common/wizards/datastore/add/lib/utils.ts +14 -54
  6. package/components/common/wizards/{datastoreNew → datastore}/add/lib/validations.ts +2 -2
  7. package/components/common/wizards/datastore/add/local/Local.vue +19 -45
  8. package/components/common/wizards/datastore/add/local/createName/CreateName.vue +31 -81
  9. package/components/common/wizards/datastore/add/nfs/Nfs.vue +25 -74
  10. package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +15 -56
  11. package/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces.ts +0 -4
  12. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/TablesView.vue +9 -66
  13. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +1 -1
  14. package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +57 -214
  15. package/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces.ts +4 -11
  16. package/components/common/wizards/datastore/add/nfs/version/Version.vue +3 -19
  17. package/components/common/wizards/datastore/add/nfs/version/lib/config/versionOptions.ts +4 -4
  18. package/components/common/wizards/datastore/add/readyComplete/ReadyComplete.vue +3 -10
  19. package/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails.ts +37 -95
  20. package/components/common/wizards/datastore/add/sharedStorm/SharedStorm.vue +32 -45
  21. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/DeviceSelection.vue +64 -267
  22. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +5 -5
  23. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces.ts +1 -11
  24. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/types.ts +1 -14
  25. package/components/common/wizards/{datastoreNew → datastore}/add/sharedStorm/deviceSelection/table/Table.vue +2 -2
  26. package/components/common/wizards/{datastoreNew → datastore}/add/sharedStorm/deviceSelection/table/lib/config/lunDiskTable.ts +1 -1
  27. package/components/common/wizards/{datastoreNew → datastore}/add/sharedStorm/deviceSelection/table/lib/config/tableKeys.ts +1 -1
  28. package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +13 -13
  29. package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/lib/config/selectOptions.ts +8 -8
  30. package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/sizeGraphic/sizeGraphic.vue +2 -2
  31. package/components/common/wizards/datastore/add/types/Types.vue +18 -17
  32. package/components/common/wizards/datastore/add/types/lib/config/typeOptions.ts +7 -16
  33. package/lib/models/enums.ts +1 -0
  34. package/package.json +1 -1
  35. package/components/common/wizards/datastore/add/lib/config/stepItems.ts +0 -225
  36. package/components/common/wizards/datastore/add/local/createName/lib/config/defaultForm.ts +0 -15
  37. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems.ts +0 -53
  38. package/components/common/wizards/datastore/add/nfs/configuration/lib/config/defaultForm.ts +0 -33
  39. package/components/common/wizards/datastore/add/nfs/configuration/serversList/DeletePopover.vue +0 -100
  40. package/components/common/wizards/datastore/add/nfs/configuration/serversList/ServersList.vue +0 -124
  41. package/components/common/wizards/datastore/add/nfs/configuration/serversList/lib/config/serversListConfig.ts +0 -40
  42. package/components/common/wizards/datastore/add/nfs/configuration/serversList/lib/config/tableKeys.ts +0 -3
  43. package/components/common/wizards/datastore/add/nfs/configuration/serversList/lib/models/interfaces.ts +0 -11
  44. package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +0 -55
  45. package/components/common/wizards/datastore/add/readyComplete/lib/models/interfaces.ts +0 -4
  46. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/HostTable.vue +0 -144
  47. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/lib/config/hostsTable.ts +0 -87
  48. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/lib/config/tableKeys.ts +0 -11
  49. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/defaultForm.ts +0 -18
  50. package/components/common/wizards/datastore/add/sharedStorm/version/Version.vue +0 -39
  51. package/components/common/wizards/datastoreNew/add/Add.vue +0 -307
  52. package/components/common/wizards/datastoreNew/add/lib/models/interfaces.ts +0 -19
  53. package/components/common/wizards/datastoreNew/add/lib/models/types.ts +0 -7
  54. package/components/common/wizards/datastoreNew/add/lib/utils.ts +0 -64
  55. package/components/common/wizards/datastoreNew/add/local/Local.vue +0 -45
  56. package/components/common/wizards/datastoreNew/add/local/createName/CreateName.vue +0 -116
  57. package/components/common/wizards/datastoreNew/add/nfs/Nfs.vue +0 -63
  58. package/components/common/wizards/datastoreNew/add/nfs/_kerberosAuthentication/lib/config/radioOptions.ts +0 -27
  59. package/components/common/wizards/datastoreNew/add/nfs/accessibility/Accessibility.vue +0 -63
  60. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/config/tabsPannel.ts +0 -24
  61. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/interfaces.ts +0 -9
  62. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/types.ts +0 -5
  63. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/TablesView.vue +0 -85
  64. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +0 -62
  65. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/incompatibleTable.ts +0 -68
  66. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/tableKeys.ts +0 -15
  67. package/components/common/wizards/datastoreNew/add/nfs/configuration/Configuration.vue +0 -236
  68. package/components/common/wizards/datastoreNew/add/nfs/configuration/_serversList/lib/models/types.ts +0 -1
  69. package/components/common/wizards/datastoreNew/add/nfs/configuration/lib/models/interfaces.ts +0 -5
  70. package/components/common/wizards/datastoreNew/add/nfs/version/Version.vue +0 -26
  71. package/components/common/wizards/datastoreNew/add/nfs/version/lib/config/versionOptions.ts +0 -22
  72. package/components/common/wizards/datastoreNew/add/readyComplete/ReadyComplete.vue +0 -88
  73. package/components/common/wizards/datastoreNew/add/readyComplete/lib/config/propertiesDetails.ts +0 -140
  74. package/components/common/wizards/datastoreNew/add/sharedStorm/SharedStorm.vue +0 -84
  75. package/components/common/wizards/datastoreNew/add/sharedStorm/_version/lib/config/versionOptions.ts +0 -21
  76. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/DeviceSelection.vue +0 -276
  77. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +0 -23
  78. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces.ts +0 -48
  79. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/types.ts +0 -1
  80. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +0 -236
  81. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/graphicTooltip/graphicTooltip.vue +0 -64
  82. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/lib/config/selectOptions.ts +0 -46
  83. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/sizeGraphic/sizeGraphic.vue +0 -225
  84. package/components/common/wizards/datastoreNew/add/types/Types.vue +0 -83
  85. package/components/common/wizards/datastoreNew/add/types/lib/config/typeOptions.ts +0 -41
  86. /package/components/common/wizards/{datastoreNew → datastore}/add/lib/models/enums.ts +0 -0
  87. /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/_kerberosAuthentication/KerberosAuthentication.vue +0 -0
  88. /package/components/common/wizards/datastore/add/nfs/{kerberosAuthentication → _kerberosAuthentication}/lib/config/radioOptions.ts +0 -0
  89. /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/accessibility/tablesView/lib/models/interfaces.ts +0 -0
  90. /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/configuration/_serversList/DeletePopover.vue +0 -0
  91. /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/configuration/_serversList/ServersList.vue +0 -0
  92. /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/configuration/_serversList/lib/config/serversListConfig.ts +0 -0
  93. /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/configuration/_serversList/lib/config/tableKeys.ts +0 -0
  94. /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/configuration/_serversList/lib/models/interfaces.ts +0 -0
  95. /package/components/common/wizards/datastore/add/nfs/configuration/{serversList → _serversList}/lib/models/types.ts +0 -0
  96. /package/components/common/wizards/{datastoreNew → datastore}/add/sharedStorm/_version/Version.vue +0 -0
  97. /package/components/common/wizards/datastore/add/sharedStorm/{version → _version}/lib/config/versionOptions.ts +0 -0
  98. /package/components/common/wizards/{datastoreNew → datastore}/add/sharedStorm/deviceSelection/table/lib/models/types.ts +0 -0
@@ -1,38 +1,19 @@
1
1
  import type { UI_T_NfsType } from '~/components/common/wizards/datastore/add/lib/models/types'
2
-
3
- // TODO refactoring
4
- export interface UI_I_NfsPoolNameForm<T = number> {
2
+ import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
3
+ import type { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
4
+ export interface UI_I_CreateDatastoreForm {
5
+ name: string
6
+ lunDisk: UI_I_CreateStorageLunDiskItem[]
7
+ nfsVersion: UI_T_NfsType
8
+ type_code: 1 | 2 | 4
9
+ readonly: boolean
5
10
  server: string
6
11
  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
12
  hosts: string[]
23
13
  }
24
14
 
25
- export interface UI_I_CreateDatastoreForm {
26
- local: {
27
- name: string
28
- hosts: string[]
29
- type_code: number
15
+ export interface UI_I_ChangeStepsSchemes {
16
+ [key: string]: {
17
+ [key in UI_T_DatastoreType]?: number
30
18
  }
31
- sharedStorm: I_SharedStorm
32
- nfs: I_NfsForm
33
- }
34
-
35
- export interface UI_I_CreateStorageUuid {
36
- code: number
37
- pool_name: string
38
19
  }
@@ -5,10 +5,3 @@ export type UI_T_KerberosAuthentication =
5
5
  | 'dont-use'
6
6
  | 'use-only-krb5'
7
7
  | 'use-integrity'
8
-
9
- export type UI_T_WizardDatastoreMode = 'procurator' | 'sphere'
10
-
11
- export interface UI_I_DatastoreValidityName {
12
- valid: boolean
13
- msg: any
14
- }
@@ -1,45 +1,32 @@
1
1
  import type { API_UI_I_Error } from '~/lib/models/store/interfaces'
2
- import type {
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
- // }
2
+ import type { UI_T_Project } from '~/lib/models/types'
3
+ import Wizard from '~/components/atoms/wizard/lib/utils/utils'
4
+ import { UI_E_Kind } from '~/lib/models/enums'
19
5
 
20
6
  export const checkValidityName = async (
21
7
  name: string,
22
- mode: UI_T_WizardDatastoreMode = 'procurator'
23
- ): Promise<UI_I_DatastoreValidityName> => {
24
- // TODO move to projects!!!
8
+ wizard: Wizard,
9
+ project: UI_T_Project,
10
+ sendMessage: (message: string) => void
11
+ ): Promise<void> => {
25
12
 
26
- const kind = 10 // TODO move in global space
13
+ wizard.setLoader(true)
27
14
  const url =
28
- mode === 'procurator'
15
+ project === 'procurator'
29
16
  ? `/ui/ds/validate?name=${name}`
30
- : `/ui/object/validate_name?name=${name}&kind=${kind}`
17
+ : `/ui/object/validate_name?name=${name}&kind=${UI_E_Kind.STORAGE_VALIDATION_NAME}`
31
18
  // @ts-ignore
32
19
  const { error } = await useMyFetch<null, API_UI_I_Error>(url, {
33
20
  method: 'GET',
34
21
  })
22
+ wizard.setLoader(false)
35
23
 
36
24
  if (error.value && error.value.data.error_code !== 0) {
37
25
  const existError = error.value.data?.error_message || error.value.data
38
-
39
- return { valid: false, msg: existError }
26
+ sendMessage(existError)
27
+ return
40
28
  }
41
-
42
- return { valid: true, msg: null }
29
+ sendMessage('')
43
30
  }
44
31
 
45
32
  export const validateNameAndGenerateDataId = (
@@ -74,30 +61,3 @@ export const validateNameAndGenerateDataId = (
74
61
 
75
62
  return baseDataId
76
63
  }
77
-
78
- // export const getStoragePoolName = async <T>(
79
- // url: string,
80
- // params: T
81
- // ): Promise<T_NullableStoragePoolNameResult> => {
82
- // const { data, error } = await useMyFetch<I_CreateStorageUuid, API_UI_I_Error>(
83
- // url,
84
- // {
85
- // method: 'POST',
86
- // body: params,
87
- // }
88
- // )
89
- //
90
- // if (error.value) return { data: null, msg: error.value }
91
- //
92
- // return { data: data.value, msg: null }
93
- // }
94
-
95
- // export const createDatastore = async <T = UI_I_CreateDatastoreBodyRequest>(
96
- // params: T
97
- // ): Promise<API_UI_I_Error> => {
98
- // const { error } = await useMyFetch<any, API_UI_I_Error>('/api/v1/pn/ds', {
99
- // method: 'POST',
100
- // body: params,
101
- // })
102
- // return error.value
103
- // }
@@ -5,9 +5,9 @@ import type {
5
5
  UI_I_WizardStep,
6
6
  } from '~/components/atoms/wizard/lib/models/interfaces'
7
7
  import type Wizard from '~/components/atoms/wizard/lib/utils/utils'
8
- import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastoreNew/add/lib/models/interfaces'
8
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
9
9
  import type { UI_T_Project } from '~/lib/models/types'
10
- import { checkValidityName } from '~/components/common/wizards/datastoreNew/add/lib/utils'
10
+ import { checkValidityName } from '~/components/common/wizards/datastore/add/lib/utils'
11
11
 
12
12
  const checkName = async (
13
13
  form: UI_I_CreateDatastoreForm,
@@ -1,63 +1,37 @@
1
1
  <template>
2
2
  <div class="local-step">
3
- <span
4
- v-if="mode === 'sphere' && props.stepPosition === 1"
5
- class="vmfs-container__desc"
6
- >
7
- {{ localization.common.nameAndDeviceSelectionDesc }}
8
- </span>
9
-
10
3
  <common-wizards-datastore-add-local-create-name
11
- v-show="mode === 'procurator' && props.stepPosition === 1"
12
- :local-create-name-submit="props.localCreateNameSubmit"
13
- @loading="(e) => emits('loading', e)"
14
- @submit="(e) => emits('submit', e)"
15
- />
16
-
17
- <common-wizards-datastore-add-shared-storm-device-selection
18
- v-if="mode === 'sphere' && props.stepPosition === 1"
19
- v-model:lun-disk="selectedLunDisk"
20
- mode="sphere"
21
- :device-selection-submit="props.localCreateNameSubmit"
22
- :step-position="props.stepPosition"
23
- :datastore-type="props.datastoreType"
24
- :datacenter-hosts="props.datacenterHosts"
25
- :is-main-filter="props.isMainFilter"
26
- @loading="(e) => emits('loading', e)"
27
- @submit="(e) => emits('submit', e)"
28
- @main-filter="emits('main-filter', $event)"
4
+ v-if="isShowCreateLocalNameBlock"
5
+ v-model="model.name"
6
+ :alert-messages="props.alertMessages"
7
+ :messages-fields="props.messagesFields"
8
+ @hide-alert="(e) => emits('hide-alert', e)"
29
9
  />
30
10
  </div>
31
11
  </template>
32
12
 
33
13
  <script lang="ts" setup>
34
- import type {
35
- UI_I_CreateStorageLunDiskItem,
36
- UI_I_SelectHostOptions,
37
- } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
38
- import type {
39
- UI_T_WizardDatastoreMode,
40
- UI_T_DatastoreType,
41
- } from '~/components/common/wizards/datastore/add/lib/models/types'
42
- import type { UI_I_Localization } from '~/lib/models/interfaces'
14
+ import type { UI_T_Project } from '~/lib/models/types'
15
+ import type { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
16
+ import type { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
17
+ import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
18
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
43
19
 
44
20
  const props = defineProps<{
45
- stepPosition: number
46
- localCreateNameSubmit: number
21
+ project: UI_T_Project
22
+ stepId: number
47
23
  datastoreType: UI_T_DatastoreType
48
- mode: UI_T_WizardDatastoreMode
49
- datacenterHosts?: UI_I_SelectHostOptions[]
50
- isMainFilter?: boolean
24
+ alertMessages: string[]
25
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
51
26
  }>()
27
+ const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
52
28
  const emits = defineEmits<{
53
- (event: 'loading', value: boolean): void
54
- (event: 'submit', value: string): void
55
- (event: 'main-filter', value: string): void
29
+ (event: 'hide-alert', value: number): void
56
30
  }>()
57
31
 
58
- const localization = computed<UI_I_Localization>(() => useLocal())
59
-
60
- const selectedLunDisk = ref<UI_I_CreateStorageLunDiskItem[]>([])
32
+ const isShowCreateLocalNameBlock = computed<boolean>(
33
+ () => props.project === 'procurator' && props.stepId === 1
34
+ )
61
35
  </script>
62
36
 
63
37
  <style lang="scss" scoped>
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <div class="create-datastore-name">
3
3
  <atoms-alert
4
- v-show="errors.length"
5
- :test-id="errorAlertDataId"
4
+ v-show="props.alertMessages.length"
5
+ test-id="create-storage-name-alert-error"
6
6
  status="alert-danger"
7
- :items="errors"
8
- @remove="onRemoveValidationErrors"
7
+ :items="props.alertMessages"
8
+ @remove="onHideAlert"
9
9
  />
10
10
 
11
11
  <div class="clr-form-control clr-row">
@@ -17,12 +17,12 @@
17
17
  <div class="flex-align-center">
18
18
  <input
19
19
  id="datastore-name"
20
- v-model.trim="form.name.value"
20
+ v-model.trim="createDatastoreNameLocal"
21
21
  data-id="datastore-name-input"
22
22
  type="text"
23
23
  class="clr-input"
24
- @blur="onBlurInputName"
25
- @input="onInputName"
24
+ @blur="initValidation(true)"
25
+ @input="initValidation(false)"
26
26
  />
27
27
  <atoms-the-icon class="error-icon" name="info-circle" />
28
28
  </div>
@@ -36,96 +36,46 @@
36
36
  </template>
37
37
 
38
38
  <script lang="ts" setup>
39
- import type { UI_I_ValidationTouchResult } from '~/lib/models/plugins/validation/interfaces'
40
- import type { UI_I_Localization } from '~/lib/models/interfaces'
41
- import type { UI_I_FormValidationDataStore } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
42
- import { defaultFormFunc } from '~/components/common/wizards/datastore/add/local/createName/lib/config/defaultForm'
43
- import { checkValidityName } from '~/components/common/wizards/datastore/add/lib/utils'
44
- import { validateNameAndGenerateDataId } from '~/components/common/wizards/datastore/add/lib/utils'
39
+ import type {
40
+ UI_I_Localization,
41
+ UI_I_ArbitraryObject,
42
+ } from '~/lib/models/interfaces'
43
+ import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
45
44
 
46
45
  const props = defineProps<{
47
- localCreateNameSubmit: number
46
+ alertMessages: string[]
47
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
48
48
  }>()
49
+ const createDatastoreNameLocal = defineModel<string>()
49
50
  const emits = defineEmits<{
50
- (event: 'loading', value: boolean): void
51
- (event: 'submit', value: string): void
51
+ (event: 'hide-alert', value: number): void
52
52
  }>()
53
53
 
54
54
  const localization = computed<UI_I_Localization>(() => useLocal())
55
- const { $validation } = useNuxtApp()
56
-
57
- const validation = $validation.call({})
58
- const defaultForm: UI_I_FormValidationDataStore = defaultFormFunc(
59
- localization.value
60
- )
61
- const form = ref<UI_I_FormValidationDataStore>(useDeepCopy(defaultForm))
62
-
63
- const setForm = () => {
64
- form.value = useDeepCopy(defaultForm)
65
- validation.setForm(form)
66
- }
67
- setForm()
68
-
69
- const validForm = ref<UI_I_ValidationTouchResult | null>(null)
70
55
 
71
56
  /* Validation for Name input */
72
57
  const isInitNameValidation = ref<boolean>(false)
73
- const onBlurInputName = (): void => {
74
- validForm.value = validation.touch()
75
- isInitNameValidation.value = true
76
- }
77
- const onInputName = () => {
78
- validForm.value = validation.touch()
79
- }
80
- const nameErrorText = computed<string>(() => {
81
- if (!isInitNameValidation.value) return ''
82
- return validForm.value?.errors?.name?.[0] || ''
83
- })
84
- /* Validation Name input end */
85
-
86
- const errorAlertDataId = ref<string>('')
87
- const errors = ref<string[]>([])
88
- const showValidationErrors = (data: string[]): void => {
89
- errors.value = data
90
- errorAlertDataId.value = validateNameAndGenerateDataId(
91
- form.value.name.value,
92
- data[0]
93
- )
58
+ const initValidation = (onlyBlur = false): void => {
59
+ onlyBlur && (isInitNameValidation.value = true)
94
60
  }
95
- const onRemoveValidationErrors = (): void => {
96
- errors.value = []
97
- }
98
- const submit = async (): Promise<void> => {
99
- const name = form.value.name.value
100
61
 
101
- if (!name) {
102
- validForm.value = validation.touch()
103
- isInitNameValidation.value = true
104
- if (nameErrorText.value) return
62
+ const nameErrorText = computed<string>(() => {
63
+ if (
64
+ props.messagesFields?.datastoreName?.field &&
65
+ !createDatastoreNameLocal.value
66
+ ) {
67
+ return props.messagesFields.datastoreName.field
105
68
  }
106
69
 
107
- if (name) {
108
- emits('loading', true)
109
-
110
- const { valid, msg } = await checkValidityName(name)
111
-
112
- emits('loading', false)
113
-
114
- if (!valid) {
115
- showValidationErrors([msg])
116
- return
117
- }
118
- }
70
+ if (!isInitNameValidation.value) return ''
71
+ return !createDatastoreNameLocal.value
72
+ ? localization.value.common.specifyDatastoreName
73
+ : ''
74
+ })
119
75
 
120
- onRemoveValidationErrors()
121
- emits('submit', name)
76
+ const onHideAlert = (): void => {
77
+ emits('hide-alert', 1)
122
78
  }
123
- watch(
124
- () => props.localCreateNameSubmit,
125
- () => {
126
- submit()
127
- }
128
- )
129
79
  </script>
130
80
 
131
81
  <style lang="scss" scoped>
@@ -1,111 +1,62 @@
1
1
  <template>
2
2
  <div class="nfs-container">
3
- <span class="nfs-container__desc">{{ stepSubTitle }}</span>
4
-
5
3
  <common-wizards-datastore-add-nfs-version
6
- v-show="props.stepPosition === 1"
7
- v-model:version="nfsVersion"
4
+ v-if="props.stepId === 4"
5
+ v-model="model.nfsVersion"
8
6
  />
9
7
 
10
8
  <common-wizards-datastore-add-nfs-configuration
11
- v-show="props.stepPosition === 2"
12
- :mode="props.mode"
13
- :nfs-version="nfsVersion"
14
- :nfs-configuration-submit="nfsConfigurationSubmit"
15
- @loading="(e) => emits('loading', e)"
16
- @next="onChangeConfigurationAndNext"
9
+ v-show="props.stepId === 5"
10
+ v-model="model"
11
+ :project="props.project"
12
+ :alert-messages="props.alertMessages"
13
+ :messages-fields="props.messagesFields"
14
+ @hide-alert="(e) => emits('hide-alert', e)"
17
15
  />
18
16
 
19
- <!-- <templates-home-datastore-actions-add-nfs-kerberos-authentication-->
20
- <!-- v-show="nfsVersion === 'nfs-4.1' && props.stepPosition === 3"-->
21
- <!-- :nfs-version="nfsVersion"-->
22
- <!-- />--><!-- TODO Он будет когда будем делать групповое -->
23
-
24
17
  <common-wizards-datastore-add-nfs-accessibility
25
18
  v-if="showHostAccessibility"
26
- :host-accessibility-submit="props.hostAccessibilitySubmit"
19
+ v-model="model.hosts"
20
+ :alert-messages="props.alertMessages"
27
21
  :hosts="props.hosts"
28
- @next="onChangeAccessibilityAndNext"
22
+ @hide-alert="(e) => emits('hide-alert', e)"
29
23
  />
30
- <!-- TODO Он будет когда будем делать групповое -->
31
24
  </div>
32
25
  </template>
33
26
 
34
27
  <script lang="ts" setup>
35
- import type { UI_I_Localization } from '~/lib/models/interfaces'
36
28
  import type {
37
- UI_T_DatastoreType,
38
- UI_T_NfsType,
39
- UI_T_WizardDatastoreMode,
40
- } from '~/components/common/wizards/datastore/add/lib/models/types'
41
- import type { UI_I_ConfigurationSendDataNfs } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces'
42
- import { subTitleFunc } from '~/components/common/wizards/datastore/add/lib/config/stepItems'
29
+ UI_I_Localization,
30
+ UI_I_ArbitraryObject,
31
+ } from '~/lib/models/interfaces'
32
+ import type { UI_T_Project } from '~/lib/models/types'
33
+ import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
34
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
43
35
 
44
36
  const props = defineProps<{
45
- mode: UI_T_WizardDatastoreMode
46
- stepPosition: number
47
- datastoreType: UI_T_DatastoreType
48
- nfsConfigurationSubmit: number
49
- hostAccessibilitySubmit: number
37
+ project: UI_T_Project
38
+ stepId: number
39
+ alertMessages: string[]
40
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
50
41
  hosts?: any
51
42
  }>()
43
+ const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
52
44
  const emits = defineEmits<{
53
- (event: 'loading', value: boolean): void
54
- (event: 'submit', value: UI_I_ConfigurationSendDataNfs): void
55
- (event: 'change-nfs-version', value: UI_T_NfsType): void
45
+ (event: 'hide-alert', value: number): void
56
46
  }>()
57
47
 
58
48
  const localization = computed<UI_I_Localization>(() => useLocal())
59
49
 
60
- const nfsVersion = ref<UI_T_NfsType>('nfs-3')
61
-
62
- const stepSubTitle = computed<string>(() => {
63
- const { datastoreType, stepPosition } = props
64
- return subTitleFunc(
65
- localization.value,
66
- datastoreType,
67
- stepPosition,
68
- nfsVersion.value
69
- )
70
- })
71
-
72
- // const showHostAccessibility = computed<boolean>(() => {
73
- // return (
74
- // (props.stepPosition === 4 && nfsVersion.value === 'nfs-4.1') ||
75
- // (props.stepPosition === 3 && nfsVersion.value === 'nfs-3')
76
- // )
77
- // })
78
50
  const showHostAccessibility = computed<boolean>(() => {
79
- return props.mode === 'sphere' && props.stepPosition === 3
51
+ return props.project === 'sphere' && props.stepId === 6
80
52
  })
81
-
82
- watch(nfsVersion, (newValue: UI_T_NfsType) => {
83
- emits('change-nfs-version', newValue)
84
- })
85
-
86
- let sendData: any = null
87
- const onChangeConfigurationAndNext = (
88
- event: UI_I_ConfigurationSendDataNfs
89
- ): void => {
90
- sendData = {
91
- name: event.name,
92
- folder: event.folder,
93
- server: event.server,
94
- hosts: [],
95
- }
96
- emits('submit', sendData)
97
- }
98
- const onChangeAccessibilityAndNext = (hosts: string[]): void => {
99
- sendData.hosts = hosts
100
- emits('submit', sendData)
101
- }
102
53
  </script>
103
54
 
104
55
  <style lang="scss" scoped>
105
56
  @import '~/assets/scss/common/mixins.scss';
106
57
  .nfs-container {
107
58
  @include flex($dir: column);
108
- height: 100%;
59
+ height: inherit;
109
60
  &__desc {
110
61
  }
111
62
  }
@@ -1,11 +1,11 @@
1
1
  <template>
2
- <div>
2
+ <div class="host-accessibility">
3
3
  <atoms-alert
4
- v-show="errors.length"
4
+ v-show="props.alertMessages?.length"
5
5
  test-id="accessibility"
6
6
  status="alert-danger"
7
- :items="errors"
8
- @remove="removeValidationErrors"
7
+ :items="props.alertMessages"
8
+ @remove="onHideAlert"
9
9
  />
10
10
 
11
11
  <div>
@@ -18,14 +18,11 @@
18
18
  </div>
19
19
  <div>
20
20
  <common-wizards-datastore-add-nfs-accessibility-tables-view
21
- v-model:selected-row="selectedHosts"
21
+ v-model="modelHosts"
22
22
  :data-table="dataTable?.items || []"
23
23
  :total-items="dataTable?.total_items || 0"
24
24
  :total-pages="dataTable?.total_pages || 1"
25
- :pagination="pagination"
26
25
  :table-type="activeTab"
27
- @pagination="updatePagination"
28
- @sort="sortTable"
29
26
  />
30
27
  </div>
31
28
  </div>
@@ -34,20 +31,21 @@
34
31
  <script lang="ts" setup>
35
32
  import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
36
33
  import type { UI_I_Localization } from '~/lib/models/interfaces'
37
- import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
38
34
  import type { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
35
+ import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
39
36
  import { hostAccessibilityTabsFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/config/tabsPannel'
40
- // import { hostsAccessibilityTablesFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems'
41
37
 
42
38
  const props = defineProps<{
43
- hostAccessibilitySubmit: number
44
- hosts?: any
39
+ alertMessages: string[]
40
+ hosts?: UI_I_CreateDatastoreHosts
45
41
  }>()
46
- const localization = computed<UI_I_Localization>(() => useLocal())
42
+ const modelHosts = defineModel<string[]>()
47
43
  const emits = defineEmits<{
48
- (event: 'next', value: string[]): void
44
+ (event: 'hide-alert', value: number): void
49
45
  }>()
50
46
 
47
+ const localization = computed<UI_I_Localization>(() => useLocal())
48
+
51
49
  const activeTab = ref<T_HostsAccessibilityTab>('compatible-hosts')
52
50
  const tabs = computed<UI_I_CollapseNavItem[]>(() =>
53
51
  hostAccessibilityTabsFunc(localization.value, [
@@ -56,49 +54,10 @@ const tabs = computed<UI_I_CollapseNavItem[]>(() =>
56
54
  ])
57
55
  )
58
56
 
59
- // const dataTable = computed(() => hostsAccessibilityTablesFunc(activeTab.value))
60
- // TODO refactoring
61
- const dataTable = computed<any>(() => props.hosts)
62
-
63
- const pagination = ref<UI_I_Pagination>({
64
- page: 1,
65
- pageSize: 35,
66
- })
67
- const sort = ref<string | null>(null)
68
-
69
- const selectedHosts = ref<string[]>([])
70
-
71
- const updatePagination = (event: UI_I_Pagination): void => {
72
- pagination.value = event
73
- }
74
- const sortTable = (event: string): void => {
75
- sort.value = event
76
- }
77
-
78
- const errors = ref<string[]>([])
79
-
80
- const showValidationErrors = (text: string): void => {
81
- errors.value = [text]
82
- }
83
- const removeValidationErrors = (): void => {
84
- errors.value = []
57
+ const dataTable = computed<UI_I_CreateDatastoreHosts>(() => props.hosts)
58
+ const onHideAlert = (): void => {
59
+ emits('hide-alert', 6)
85
60
  }
86
- const submit = async () => {
87
- if (!selectedHosts.value.length) {
88
- const text = localization.value.common.selectLeastEntityContinue
89
- showValidationErrors(text)
90
- return
91
- }
92
-
93
- removeValidationErrors()
94
- emits('next', selectedHosts.value)
95
- }
96
- watch(
97
- () => props.hostAccessibilitySubmit,
98
- () => {
99
- submit()
100
- }
101
- )
102
61
  </script>
103
62
 
104
63
  <style lang="scss" scoped></style>
@@ -4,10 +4,6 @@ export interface I_CompatibleHostsTable {
4
4
  cluster: string
5
5
  }
6
6
 
7
-
8
-
9
-
10
-
11
7
  export interface I_IncompatibleHostsTable extends I_CompatibleHostsTable{
12
8
  host_incompatibility_reason: string
13
9
  }