bfg-common 1.5.118 → 1.5.119

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 (80) hide show
  1. package/assets/scss/common/icons/icons-6.scss +6 -0
  2. package/components/common/details/lib/models/interfaces.ts +1 -0
  3. package/components/common/wizards/datastore/add/Add.vue +77 -167
  4. package/components/common/wizards/datastore/add/New.vue +242 -0
  5. package/components/common/wizards/datastore/add/Old.vue +125 -0
  6. package/components/common/wizards/datastore/add/lib/config/createDatastore.ts +16 -0
  7. package/components/common/wizards/datastore/add/lib/config/steps.ts +174 -138
  8. package/components/common/wizards/datastore/add/lib/models/interfaces.ts +10 -7
  9. package/components/common/wizards/datastore/add/lib/models/types.ts +4 -4
  10. package/components/common/wizards/datastore/add/lib/validations.ts +40 -24
  11. package/components/common/wizards/datastore/add/{nfs → steps}/_kerberosAuthentication/KerberosAuthentication.vue +1 -0
  12. package/components/common/wizards/datastore/add/{local → steps/_local}/Local.vue +4 -3
  13. package/components/common/wizards/datastore/add/{nfs/version/Version.vue → steps/_nfsVersion/NfsVersion.vue} +1 -0
  14. package/components/common/wizards/datastore/add/{sharedStorm/partitionConfiguration → steps/_partitionConfiguration}/PartitionConfiguration.vue +11 -2
  15. package/components/common/wizards/datastore/add/{sharedStorm/_version → steps/_vmfsVersion}/Version.vue +7 -3
  16. package/components/common/wizards/datastore/add/steps/common/tooltipInfo/TooltipInfo.vue +93 -0
  17. package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibility.vue +54 -0
  18. package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibilityNew.vue +48 -0
  19. package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibilityOld.vue +50 -0
  20. package/components/common/wizards/datastore/add/{nfs/accessibility → steps/hostAccessibility}/lib/config/tabsPannel.ts +2 -3
  21. package/components/common/wizards/datastore/add/steps/hostAccessibility/lib/models/types.ts +3 -0
  22. package/components/common/wizards/datastore/add/steps/hostAccessibility/table/Table.vue +41 -0
  23. package/components/common/wizards/datastore/add/{nfs/accessibility/tablesView → steps/hostAccessibility/table}/lib/models/interfaces.ts +1 -1
  24. package/components/common/wizards/datastore/add/steps/hostAccessibility/table/new/New.vue +113 -0
  25. package/components/common/wizards/datastore/add/steps/hostAccessibility/table/new/lib/config/compatibleTable.ts +79 -0
  26. package/components/common/wizards/datastore/add/steps/hostAccessibility/table/old/Old.vue +79 -0
  27. package/components/common/wizards/datastore/add/{nfs/accessibility/tablesView → steps/hostAccessibility/table/old}/lib/config/compatibleTable.ts +7 -11
  28. package/components/common/wizards/datastore/add/{nfs/accessibility/tablesView → steps/hostAccessibility/table/old}/lib/config/incompatibleTable.ts +1 -1
  29. package/components/common/wizards/datastore/add/steps/hostAccessibility/table/old/lib/config/tableKeys.ts +15 -0
  30. package/components/common/wizards/datastore/add/steps/hostAccessibility/table/old/lib/models/types.ts +6 -0
  31. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigure.vue +95 -0
  32. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureNew.vue +210 -0
  33. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureOld.vue +234 -0
  34. package/components/common/wizards/datastore/add/{nfs/configuration → steps/nameAndConfigure}/_serversList/ServersList.vue +2 -1
  35. package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDevice.vue +142 -0
  36. package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceNew.vue +185 -0
  37. package/components/common/wizards/datastore/add/{sharedStorm/deviceSelection/DeviceSelection.vue → steps/nameAndDevice/NameAndDeviceOld.vue} +47 -115
  38. package/components/common/wizards/datastore/add/steps/nameAndDevice/lib/config/selectOptions.ts +13 -0
  39. package/components/common/wizards/datastore/add/{sharedStorm/deviceSelection → steps/nameAndDevice}/lib/models/interfaces.ts +0 -10
  40. package/components/common/wizards/datastore/add/steps/nameAndDevice/table/Table.vue +74 -0
  41. package/components/common/wizards/datastore/add/steps/nameAndDevice/table/lib/models/interfaces.ts +14 -0
  42. package/components/common/wizards/datastore/add/steps/nameAndDevice/table/new/New.vue +137 -0
  43. package/components/common/wizards/datastore/add/steps/nameAndDevice/table/new/lib/config/lunDiskTable.ts +176 -0
  44. package/components/common/wizards/datastore/add/steps/nameAndDevice/table/new/lib/models/enums.ts +16 -0
  45. package/components/common/wizards/datastore/add/{sharedStorm/deviceSelection/table/Table.vue → steps/nameAndDevice/table/old/Old.vue} +18 -57
  46. package/components/common/wizards/datastore/add/{sharedStorm/deviceSelection/table → steps/nameAndDevice/table/old}/lib/config/lunDiskTable.ts +2 -2
  47. package/components/common/wizards/datastore/add/{sharedStorm/deviceSelection/table → steps/nameAndDevice/table/old}/lib/config/tableKeys.ts +1 -1
  48. package/components/common/wizards/datastore/add/steps/readyComplete/ReadyComplete.vue +44 -0
  49. package/components/common/wizards/datastore/add/steps/readyComplete/ReadyCompleteNew.vue +122 -0
  50. package/components/common/wizards/datastore/add/{readyComplete/ReadyComplete.vue → steps/readyComplete/ReadyCompleteOld.vue} +20 -6
  51. package/components/common/wizards/datastore/add/{readyComplete → steps/readyComplete}/lib/config/propertiesDetails.ts +36 -20
  52. package/components/common/wizards/datastore/add/steps/typeMode/TypeMode.vue +35 -0
  53. package/components/common/wizards/datastore/add/steps/typeMode/TypeModeNew.vue +98 -0
  54. package/components/common/wizards/datastore/add/{types/Types.vue → steps/typeMode/TypeModeOld.vue} +7 -15
  55. package/components/common/wizards/datastore/add/{types → steps/typeMode}/lib/config/typeOptions.ts +3 -3
  56. package/package.json +1 -1
  57. package/components/common/wizards/datastore/add/nfs/Nfs.vue +0 -60
  58. package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +0 -60
  59. package/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces.ts +0 -9
  60. package/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types.ts +0 -5
  61. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/TablesView.vue +0 -85
  62. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/tableKeys.ts +0 -15
  63. package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +0 -228
  64. package/components/common/wizards/datastore/add/sharedStorm/SharedStorm.vue +0 -73
  65. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +0 -26
  66. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/types.ts +0 -1
  67. /package/components/common/wizards/datastore/add/{nfs → steps}/_kerberosAuthentication/lib/config/radioOptions.ts +0 -0
  68. /package/components/common/wizards/datastore/add/{local → steps/_local}/createName/CreateName.vue +0 -0
  69. /package/components/common/wizards/datastore/add/{nfs/version → steps/_nfsVersion}/lib/config/versionOptions.ts +0 -0
  70. /package/components/common/wizards/datastore/add/{sharedStorm/partitionConfiguration → steps/_partitionConfiguration}/graphicTooltip/graphicTooltip.vue +0 -0
  71. /package/components/common/wizards/datastore/add/{sharedStorm/partitionConfiguration → steps/_partitionConfiguration}/lib/config/selectOptions.ts +0 -0
  72. /package/components/common/wizards/datastore/add/{sharedStorm/partitionConfiguration → steps/_partitionConfiguration}/sizeGraphic/sizeGraphic.vue +0 -0
  73. /package/components/common/wizards/datastore/add/{sharedStorm/_version → steps/_vmfsVersion}/lib/config/versionOptions.ts +0 -0
  74. /package/components/common/wizards/datastore/add/{nfs/configuration → steps/nameAndConfigure}/_serversList/DeletePopover.vue +0 -0
  75. /package/components/common/wizards/datastore/add/{nfs/configuration → steps/nameAndConfigure}/_serversList/lib/config/serversListConfig.ts +0 -0
  76. /package/components/common/wizards/datastore/add/{nfs/configuration → steps/nameAndConfigure}/_serversList/lib/config/tableKeys.ts +0 -0
  77. /package/components/common/wizards/datastore/add/{nfs/configuration → steps/nameAndConfigure}/_serversList/lib/models/interfaces.ts +0 -0
  78. /package/components/common/wizards/datastore/add/{nfs/configuration → steps/nameAndConfigure}/_serversList/lib/models/types.ts +0 -0
  79. /package/components/common/wizards/datastore/add/{nfs/configuration → steps/nameAndConfigure}/lib/models/interfaces.ts +0 -0
  80. /package/components/common/wizards/datastore/add/{sharedStorm/deviceSelection/table → steps/nameAndDevice/table/old}/lib/models/types.ts +0 -0
@@ -0,0 +1,125 @@
1
+ <template>
2
+ <div class="new-datastore">
3
+ <atoms-wizard
4
+ show
5
+ :wizard="props.wizard"
6
+ :selected-scheme="props.selectedScheme"
7
+ :title="props.title"
8
+ :localization="localization"
9
+ class="add-datastore"
10
+ test-id="add-datastore-wizard"
11
+ @change-steps="onChangeSteps"
12
+ @hide="onHideModal"
13
+ @submit="onCreateDatastore"
14
+ >
15
+ <template #modalBody="{ selectedStep }">
16
+ <common-wizards-datastore-add-steps-type-mode
17
+ v-if="selectedStep.id === dynamicSteps.type"
18
+ v-model="formModelLocal.type_code"
19
+ />
20
+
21
+ <common-wizards-datastore-add-steps-name-and-device
22
+ v-if="selectedStep.id === dynamicSteps.nameAndDevice"
23
+ v-model="formModelLocal"
24
+ :project="props.project"
25
+ :alert-messages="props.alertMessages[dynamicSteps.nameAndDevice]"
26
+ :messages-fields="selectedStep.fields"
27
+ :hosts="props.nfsHosts"
28
+ :host-id="props.hostId"
29
+ :is-main-filter="props.isMainFilter"
30
+ @hide-alert="(e) => emits('hide-alert', e)"
31
+ @main-filter="(e) => emits('main-filter', e)"
32
+ />
33
+
34
+ <common-wizards-datastore-add-steps-name-and-configure
35
+ v-if="selectedStep.id === dynamicSteps.nameAndConfigure"
36
+ v-model="formModelLocal"
37
+ :project="props.project"
38
+ :alert-messages="props.alertMessages[dynamicSteps.nameAndConfigure]"
39
+ :messages-fields="selectedStep.fields"
40
+ @hide-alert="(e) => emits('hide-alert', e)"
41
+ />
42
+
43
+ <common-wizards-datastore-add-steps-host-accessibility
44
+ v-if="selectedStep.id === dynamicSteps.hostAccessibility"
45
+ v-model="formModelLocal.hosts"
46
+ :alert-messages="props.alertMessages[dynamicSteps.hostAccessibility]"
47
+ :hosts="props.nfsHosts"
48
+ @hide-alert="(e) => emits('hide-alert', e)"
49
+ />
50
+
51
+ <common-wizards-datastore-add-steps-ready-complete
52
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
53
+ :form="formModelLocal"
54
+ :hosts="props.nfsHosts"
55
+ :host-id="props.hostId"
56
+ :project="props.project"
57
+ />
58
+ </template>
59
+ </atoms-wizard>
60
+ </div>
61
+ </template>
62
+
63
+ <script setup lang="ts">
64
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
65
+ import type Wizard from '~/components/atoms/wizard/lib/utils/utils'
66
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
67
+ import type { UI_T_Project } from '~/lib/models/types'
68
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
69
+ import type { UI_I_CompatibleHosts } from '~/components/common/wizards/datastore/add/steps/hostAccessibility/table/lib/models/interfaces'
70
+ import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
71
+
72
+ const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
73
+ const props = defineProps<{
74
+ project: UI_T_Project
75
+ wizard: Wizard
76
+ selectedScheme: number[]
77
+ alertMessages: string[][]
78
+ title: string
79
+ nfsHosts?: UI_I_CompatibleHosts
80
+ hostId?: string
81
+ isMainFilter?: boolean
82
+ }>()
83
+ const emits = defineEmits<{
84
+ (event: 'change-steps', value: UI_I_WizardStep[]): void
85
+ (event: 'hide-alert', value: number): void
86
+ (event: 'hide'): void
87
+ (event: 'submit'): void
88
+ (event: 'main-filter', value: string): void
89
+ }>()
90
+
91
+ const localization = computed<UI_I_Localization>(() => useLocal())
92
+
93
+ const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
94
+ emits('change-steps', value)
95
+
96
+ const onHideAlert = (stepId: number): void => {
97
+ emits('hide-alert', stepId)
98
+ }
99
+ const onHideModal = (): void => emits('hide')
100
+ const onCreateDatastore = (): void => emits('submit')
101
+ </script>
102
+
103
+ <style scoped lang="scss">
104
+ @import 'assets/scss/common/mixins.scss';
105
+ .new-datastore {
106
+ &__body {
107
+ @include flex($dir: column);
108
+ height: 100%;
109
+ padding-left: 24px;
110
+ }
111
+ }
112
+
113
+ .finish-block {
114
+ padding: 18px 24px 24px 24px;
115
+
116
+ .add-hosts-ready-to-complete-mt-12 {
117
+ margin-top: 12px;
118
+
119
+ .add-hosts-ready-to-complete-bold {
120
+ line-height: 18px;
121
+ font-weight: 700;
122
+ }
123
+ }
124
+ }
125
+ </style>
@@ -0,0 +1,16 @@
1
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
2
+
3
+ export const datastoreDefaultFormFunc = (
4
+ hostId?: string
5
+ ): UI_I_CreateDatastoreForm => {
6
+ return {
7
+ name: 'Datastore',
8
+ dev_names: [],
9
+ hosts: hostId ? [hostId] : [],
10
+ type_code: 2,
11
+ version: 4.1,
12
+ readonly: false,
13
+ server: '',
14
+ folder: '',
15
+ }
16
+ }
@@ -1,138 +1,174 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
3
- import { UI_E_WIZARD_STATUS } from '~/components/atoms/wizard/lib/models/enums'
4
-
5
- export const stepsFunc = (
6
- localization: UI_I_Localization
7
- ): UI_I_WizardStep[] => [
8
- {
9
- id: 0,
10
- title: localization.common.type,
11
- status: UI_E_WIZARD_STATUS.SELECTED,
12
- fields: {},
13
- isValid: true,
14
- testId: 'create-datastore-select-type',
15
- },
16
-
17
- {
18
- id: 1,
19
- title: localization.common.selectDatastoreName,
20
- status: UI_E_WIZARD_STATUS.INACTIVE,
21
- fields: {
22
- datastoreName: {
23
- alert: '',
24
- field: '',
25
- },
26
- },
27
- isValid: true,
28
- testId: 'select-datastore-name',
29
- },
30
- {
31
- id: 2,
32
- title: localization.common.nameAndDeviceSelection,
33
- subTitle: localization.common.nameAndDeviceSelectionDesc,
34
- status: UI_E_WIZARD_STATUS.INACTIVE,
35
- fields: {
36
- datastoreName: {
37
- alert: '',
38
- field: '',
39
- },
40
- lunDisk: {
41
- alert: '',
42
- field: '',
43
- },
44
- },
45
- isValid: true,
46
- testId: 'create-datastore-name-and-device-selection',
47
- },
48
-
49
- {
50
- id: 3,
51
- title: localization.common.partitionConfiguration,
52
- subTitle: localization.common.partitionConfigurationDesc,
53
- status: UI_E_WIZARD_STATUS.INACTIVE,
54
- fields: {},
55
- isValid: true,
56
- testId: 'create-datastore-partition-configuration',
57
- },
58
-
59
- // {
60
- // id: 4,
61
- // title: localization.common.nfsVersion,
62
- // subTitle: localization.common.selectNfsVersion,
63
- // status: UI_E_WIZARD_STATUS.INACTIVE,
64
- // fields: {},
65
- // isValid: true,
66
- // testId: 'create-datastore-select-nfs-version',
67
- // },
68
- {
69
- id: 4,
70
- title: localization.common.nameAndConfiguration,
71
- subTitle: localization.common.nameAndConfigurationDesc,
72
- status: UI_E_WIZARD_STATUS.INACTIVE,
73
- fields: {
74
- name: {
75
- alert: '',
76
- field: '',
77
- },
78
- folder: {
79
- alert: '',
80
- field: '',
81
- },
82
- server: {
83
- alert: '',
84
- field: '',
85
- },
86
- },
87
- isValid: true,
88
- testId: 'create-datastore-name-and-configuration',
89
- },
90
-
91
- {
92
- id: 5,
93
- title: localization.common.hostsAccessibility,
94
- subTitle: localization.common.hostsAccessibilityDesc,
95
- status: UI_E_WIZARD_STATUS.INACTIVE,
96
- fields: {
97
- hostsAccessibility: {
98
- alert: '',
99
- field: '',
100
- },
101
- },
102
- isValid: true,
103
- testId: 'create-datastore-hosts-accessibility',
104
- },
105
-
106
- // { // TODO Пока что не будет чут попоже
107
- // id: 7,
108
- // title: localization.kerberosAuthentication,
109
- // subTitle: localization.kerberosAuthenticationDesc.replace(
110
- // '{0}',
111
- // 'version'?.toUpperCase() || ''
112
- // ),
113
- // status: UI_E_WIZARD_STATUS.INACTIVE,
114
- // fields: {},
115
- // isValid: true,
116
- // testId: 'select-kerberos-authentication',
117
- // },
118
- {
119
- id: 11,
120
- title: localization.common.readyComplete,
121
- subTitle: localization.common.readyCompleteDesc,
122
- status: UI_E_WIZARD_STATUS.INACTIVE,
123
- fields: {},
124
- isValid: true,
125
- testId: 'create-datastore-ready-complete',
126
- // testId: 'create-datastore-storm-ready-complete',
127
- // testId: 'create-datastore-nfs-ready-complete',
128
- // testId: 'create-datastore-local-ready-complete',
129
- },
130
- ]
131
-
132
- export const stepsSchemeInitial: number[][] = [
133
- [0, 1, 11], // Procurator Scheme for "local" type
134
- [0, 2, 11], // Procurator Scheme for "shared-storm" type
135
- [0, 4, 11], // Procurator Scheme for "nfs" type
136
- [0, 2, 11], // Sphere Scheme for "shared-storm" type
137
- [0, 4, 5, 11], // Sphere Scheme for "nfs" type
138
- ]
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_T_Project } from '~/lib/models/types'
3
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
4
+ import { UI_E_WIZARD_STATUS } from '~/components/atoms/wizard/lib/models/enums'
5
+ import type { UI_I_ChangeStepsSchemes } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
6
+ import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datastore/add/lib/models/types'
7
+ export const dynamicSteps = {
8
+ type: 0,
9
+ nameAndDevice: 1,
10
+ nameAndConfigure: 2,
11
+ hostAccessibility: 3,
12
+ readyComplete: 4,
13
+ }
14
+ export const stepsFunc = (
15
+ localization: UI_I_Localization
16
+ ): UI_I_WizardStep[] => [
17
+ {
18
+ id: dynamicSteps.type,
19
+ title: localization.common.type,
20
+ subTitle: localization.common.specifyDatastoreType,
21
+ status: UI_E_WIZARD_STATUS.SELECTED,
22
+ fields: {},
23
+ isValid: true,
24
+ testId: 'create-datastore-select-type',
25
+ },
26
+
27
+ // {
28
+ // // TODO Этот шаг использовался раньше, сейчас не используется
29
+ // id: dynamicSteps.local,
30
+ // title: localization.common.selectDatastoreName,
31
+ // status: UI_E_WIZARD_STATUS.INACTIVE,
32
+ // fields: {
33
+ // datastoreName: {
34
+ // alert: '',
35
+ // field: '',
36
+ // },
37
+ // },
38
+ // isValid: true,
39
+ // testId: 'select-datastore-name',
40
+ // },
41
+ {
42
+ id: dynamicSteps.nameAndDevice,
43
+ title: localization.common.nameAndDeviceSelection,
44
+ subTitle: localization.common.nameAndDeviceSelectionDesc,
45
+ status: UI_E_WIZARD_STATUS.INACTIVE,
46
+ fields: {
47
+ datastoreName: {
48
+ alert: '',
49
+ field: '',
50
+ },
51
+ lunDisk: {
52
+ alert: '',
53
+ field: '',
54
+ },
55
+ },
56
+ isValid: true,
57
+ testId: 'create-datastore-name-and-device-selection',
58
+ },
59
+
60
+ // { // TODO Этот шаг использовался раньше, сейчас не используется
61
+ // id: dynamicSteps.partitionConfiguration,
62
+ // title: localization.common.partitionConfiguration,
63
+ // subTitle: localization.common.partitionConfigurationDesc,
64
+ // status: UI_E_WIZARD_STATUS.INACTIVE,
65
+ // fields: {},
66
+ // isValid: true,
67
+ // testId: 'create-datastore-partition-configuration',
68
+ // },
69
+
70
+ // {
71
+ // // TODO Этот шаг использовался раньше, сейчас не используется
72
+ // id: dynamicSteps.nfsVersion,
73
+ // title: localization.common.nfsVersion,
74
+ // subTitle: localization.common.selectNfsVersion,
75
+ // status: UI_E_WIZARD_STATUS.INACTIVE,
76
+ // fields: {},
77
+ // isValid: true,
78
+ // testId: 'create-datastore-select-nfs-version',
79
+ // },
80
+ {
81
+ id: dynamicSteps.nameAndConfigure,
82
+ title: localization.common.nameAndConfiguration,
83
+ subTitle: localization.common.nameAndConfigurationDesc,
84
+ status: UI_E_WIZARD_STATUS.INACTIVE,
85
+ fields: {
86
+ name: {
87
+ alert: '',
88
+ field: '',
89
+ },
90
+ folder: {
91
+ alert: '',
92
+ field: '',
93
+ },
94
+ server: {
95
+ alert: '',
96
+ field: '',
97
+ },
98
+ },
99
+ isValid: true,
100
+ testId: 'create-datastore-name-and-configuration',
101
+ },
102
+
103
+ {
104
+ id: dynamicSteps.hostAccessibility,
105
+ title: localization.common.hostsAccessibility,
106
+ subTitle: localization.common.hostsAccessibilityDesc,
107
+ status: UI_E_WIZARD_STATUS.INACTIVE,
108
+ fields: {
109
+ hostsAccessibility: {
110
+ alert: '',
111
+ field: '',
112
+ },
113
+ },
114
+ isValid: true,
115
+ testId: 'create-datastore-hosts-accessibility',
116
+ },
117
+
118
+ // { // TODO Пока что не будет чут попоже
119
+ // id: 7,
120
+ // title: localization.kerberosAuthentication,
121
+ // subTitle: localization.kerberosAuthenticationDesc.replace(
122
+ // '{0}',
123
+ // 'version'?.toUpperCase() || ''
124
+ // ),
125
+ // status: UI_E_WIZARD_STATUS.INACTIVE,
126
+ // fields: {},
127
+ // isValid: true,
128
+ // testId: 'select-kerberos-authentication',
129
+ // },
130
+ {
131
+ id: dynamicSteps.readyComplete,
132
+ title: localization.common.readyComplete,
133
+ subTitle: localization.common.readyCompleteDesc,
134
+ status: UI_E_WIZARD_STATUS.INACTIVE,
135
+ fields: {},
136
+ isValid: true,
137
+ testId: 'create-datastore-ready-complete',
138
+ },
139
+ ]
140
+
141
+ export const stepsSchemeInitial: number[][] = [
142
+ [dynamicSteps.type, dynamicSteps.nameAndDevice, dynamicSteps.readyComplete], // Procurator Scheme for "shared-storm" type
143
+ [
144
+ dynamicSteps.type,
145
+ dynamicSteps.nameAndConfigure,
146
+ dynamicSteps.readyComplete,
147
+ ], // Procurator Scheme for "nfs" type
148
+ [dynamicSteps.type, dynamicSteps.nameAndDevice, dynamicSteps.readyComplete], // Sphere Scheme for "shared-storm" type
149
+ [
150
+ dynamicSteps.type,
151
+ dynamicSteps.nameAndConfigure,
152
+ dynamicSteps.hostAccessibility,
153
+ dynamicSteps.readyComplete,
154
+ ], // Sphere Scheme for "nfs" type (not used from <host Context Menu>)
155
+ ]
156
+
157
+ export const getStepScheme = (
158
+ project: UI_T_Project,
159
+ typeCode: UI_T_DatastoreTypeCode,
160
+ hostId?: string
161
+ ): number | undefined => {
162
+ const schemes: UI_I_ChangeStepsSchemes = {
163
+ procurator: {
164
+ '2': 0,
165
+ '4': 1,
166
+ },
167
+ sphere: {
168
+ '2': 2,
169
+ '4': !hostId ? 3 : 1,
170
+ },
171
+ }
172
+
173
+ return schemes[project]?.[typeCode]
174
+ }
@@ -1,11 +1,14 @@
1
- import type { UI_T_NfsType } from '~/components/common/wizards/datastore/add/lib/models/types'
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'
1
+ import type {
2
+ UI_T_NfsType,
3
+ UI_T_DatastoreTypeCode,
4
+ } from '~/components/common/wizards/datastore/add/lib/models/types'
5
+ import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/steps/nameAndDevice/table/lib/models/interfaces'
6
+
4
7
  export interface UI_I_CreateDatastoreForm {
5
8
  name: string
6
- lunDisk: UI_I_CreateStorageLunDiskItem[]
7
- nfsVersion: UI_T_NfsType
8
- type_code: 1 | 2 | 4
9
+ dev_names: UI_I_CreateStorageLunDiskItem[]
10
+ version: UI_T_NfsType
11
+ type_code: UI_T_DatastoreTypeCode
9
12
  readonly: boolean
10
13
  server: string
11
14
  folder: string
@@ -14,6 +17,6 @@ export interface UI_I_CreateDatastoreForm {
14
17
 
15
18
  export interface UI_I_ChangeStepsSchemes {
16
19
  [key: string]: {
17
- [key in UI_T_DatastoreType]?: number
20
+ [key in UI_T_DatastoreTypeCode]?: number
18
21
  }
19
22
  }
@@ -1,7 +1,7 @@
1
- export type UI_T_DatastoreType = 'local' | 'shared-storm' | 'nfs'
2
- export type UI_T_NfsType = 'nfs-3' | 'nfs-4.1'
3
- export type UI_T_VmfsType = 'vmfs-6' | 'vmfs-5'
1
+ export type UI_T_DatastoreTypeCode = 2 | 4
2
+ export type UI_T_NfsType = 4.1 | 3.0
3
+ export type UI_T_VmfsType = 'vmfs-6' | 'vmfs-5' // сейчас этот тип не используется
4
4
  export type UI_T_KerberosAuthentication =
5
5
  | 'dont-use'
6
6
  | 'use-only-krb5'
7
- | 'use-integrity'
7
+ | 'use-integrity' // сейчас этот тип не используется
@@ -8,7 +8,7 @@ import type Wizard from '~/components/atoms/wizard/lib/utils/utils'
8
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
10
  import { checkValidityName } from '~/components/common/wizards/datastore/add/lib/utils'
11
-
11
+ import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
12
12
  const checkName = async (
13
13
  form: UI_I_CreateDatastoreForm,
14
14
  localization: UI_I_Localization,
@@ -17,9 +17,9 @@ const checkName = async (
17
17
  ): Promise<UI_I_AsyncCheckReturn> => {
18
18
  const typeCode = form.type_code
19
19
 
20
- let help: boolean = form.type_code === 1
20
+ let help: boolean = false
21
21
  if (typeCode === 2) {
22
- help = !!form.lunDisk.length
22
+ help = !!form.dev_names.length
23
23
  }
24
24
  if (typeCode === 4) {
25
25
  help = !!form.folder && !!form.server
@@ -72,7 +72,7 @@ export const checkDatastoreNameAsync = async (
72
72
  }
73
73
  export const checkSelectedLunDiskSync = (
74
74
  localization: UI_I_Localization,
75
- { lunDisk, name, hosts }: UI_I_CreateDatastoreForm,
75
+ { dev_names, name, hosts }: UI_I_CreateDatastoreForm,
76
76
  wizard: Wizard,
77
77
  value: UI_I_WizardStep[],
78
78
  project: UI_T_Project,
@@ -80,17 +80,17 @@ export const checkSelectedLunDiskSync = (
80
80
  ): UI_I_ValidationReturn => {
81
81
  let stepHasError = false
82
82
 
83
- if (!lunDisk.length && name) {
83
+ if (!dev_names.length && name) {
84
84
  const isErrorTextForSphere =
85
85
  project === 'sphere' && !hostId && !hosts.length
86
- stepHasError = wizard.setValidation(2, 'lunDisk', {
86
+ stepHasError = wizard.setValidation(dynamicSteps.nameAndDevice, 'lunDisk', {
87
87
  fieldMessage: '',
88
88
  alertMessage: isErrorTextForSphere
89
89
  ? localization.common.selectHostToContinueAlert
90
90
  : localization.common.selectDiskToContinueAlert,
91
91
  })
92
- } else if (wizard.hasMessage(2, 'lunDisk')) {
93
- value = wizard.removeValidation(2, 'lunDisk', value)
92
+ } else if (wizard.hasMessage(dynamicSteps.nameAndDevice, 'lunDisk')) {
93
+ value = wizard.removeValidation(dynamicSteps.nameAndDevice, 'lunDisk', value)
94
94
  }
95
95
 
96
96
  return {
@@ -108,12 +108,20 @@ export const checkNfsFolderSync = (
108
108
  let stepHasError = false
109
109
 
110
110
  if (!name) {
111
- stepHasError = wizard.setValidation(4, 'folder', {
112
- fieldMessage: localization.common.specifyFolderName,
113
- alertMessage: '',
114
- })
115
- } else if (wizard.hasMessage(4, 'folder')) {
116
- value = wizard.removeValidation(4, 'folder', value)
111
+ stepHasError = wizard.setValidation(
112
+ dynamicSteps.nameAndConfigure,
113
+ 'folder',
114
+ {
115
+ fieldMessage: localization.common.specifyFolderName,
116
+ alertMessage: '',
117
+ }
118
+ )
119
+ } else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'folder')) {
120
+ value = wizard.removeValidation(
121
+ dynamicSteps.nameAndConfigure,
122
+ 'folder',
123
+ value
124
+ )
117
125
  }
118
126
 
119
127
  return {
@@ -131,12 +139,20 @@ export const checkNfsServerSync = (
131
139
  let stepHasError = false
132
140
 
133
141
  if (!name) {
134
- stepHasError = wizard.setValidation(4, 'server', {
135
- fieldMessage: localization.common.specifyServerName,
136
- alertMessage: '',
137
- })
138
- } else if (wizard.hasMessage(4, 'server')) {
139
- value = wizard.removeValidation(4, 'server', value)
142
+ stepHasError = wizard.setValidation(
143
+ dynamicSteps.nameAndConfigure,
144
+ 'server',
145
+ {
146
+ fieldMessage: localization.common.specifyServerName,
147
+ alertMessage: '',
148
+ }
149
+ )
150
+ } else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'server')) {
151
+ value = wizard.removeValidation(
152
+ dynamicSteps.nameAndConfigure,
153
+ 'server',
154
+ value
155
+ )
140
156
  }
141
157
 
142
158
  return {
@@ -147,19 +163,19 @@ export const checkNfsServerSync = (
147
163
 
148
164
  export const checkHostsAccessibilitySync = (
149
165
  localization: UI_I_Localization,
150
- hosts: any,
166
+ hosts: string[],
151
167
  wizard: Wizard,
152
168
  value: UI_I_WizardStep[]
153
169
  ): UI_I_ValidationReturn => {
154
170
  let stepHasError = false
155
171
 
156
172
  if (!hosts.length) {
157
- stepHasError = wizard.setValidation(5, 'hostsAccessibility', {
173
+ stepHasError = wizard.setValidation(dynamicSteps.hostAccessibility, 'hostsAccessibility', {
158
174
  fieldMessage: '',
159
175
  alertMessage: localization.common.selectLeastEntityContinue,
160
176
  })
161
- } else if (wizard.hasMessage(5, 'hostsAccessibility')) {
162
- value = wizard.removeValidation(5, 'hostsAccessibility', value)
177
+ } else if (wizard.hasMessage(dynamicSteps.hostAccessibility, 'hostsAccessibility')) {
178
+ value = wizard.removeValidation(dynamicSteps.hostAccessibility, 'hostsAccessibility', value)
163
179
  }
164
180
 
165
181
  return {
@@ -1,4 +1,5 @@
1
1
  <template>
2
+ <!-- TODO: если использовать этот компонент, нужно отрефакторить весь код — сейчас всё по-старому -->
2
3
  <div class="kerberos-auth">
3
4
  <atoms-alert
4
5
  v-show="isShowAlert"
@@ -1,6 +1,7 @@
1
1
  <template>
2
+ <!-- TODO: если использовать этот компонент, нужно отрефакторить весь код — сейчас всё по-старому -->
2
3
  <div class="local-step">
3
- <common-wizards-datastore-add-local-create-name
4
+ <common-wizards-datastore-add-steps-local-create-name
4
5
  v-if="isShowCreateLocalNameBlock"
5
6
  v-model="model.name"
6
7
  :alert-messages="props.alertMessages"
@@ -13,14 +14,14 @@
13
14
  <script lang="ts" setup>
14
15
  import type { UI_T_Project } from '~/lib/models/types'
15
16
  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_T_DatastoreTypeCode } from '~/components/common/wizards/datastore/add/lib/models/types'
17
18
  import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
18
19
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
19
20
 
20
21
  const props = defineProps<{
21
22
  project: UI_T_Project
22
23
  stepId: number
23
- datastoreType: UI_T_DatastoreType
24
+ datastoreType: UI_T_DatastoreTypeCode
24
25
  alertMessages: string[]
25
26
  messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
26
27
  }>()