bfg-common 1.4.46 → 1.4.48

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 (52) hide show
  1. package/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces.ts +4 -0
  2. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +15 -6
  3. package/components/common/wizards/datastoreNew/add/Add.vue +464 -0
  4. package/components/common/wizards/datastoreNew/add/lib/config/steps.ts +135 -0
  5. package/components/common/wizards/datastoreNew/add/lib/models/enums.ts +5 -0
  6. package/components/common/wizards/datastoreNew/add/lib/models/interfaces.ts +12 -0
  7. package/components/common/wizards/datastoreNew/add/lib/models/types.ts +7 -0
  8. package/components/common/wizards/datastoreNew/add/lib/utils.ts +31 -0
  9. package/components/common/wizards/datastoreNew/add/local/Local.vue +44 -0
  10. package/components/common/wizards/datastoreNew/add/local/createName/CreateName.vue +116 -0
  11. package/components/common/wizards/datastoreNew/add/nfs/Nfs.vue +62 -0
  12. package/components/common/wizards/datastoreNew/add/nfs/_kerberosAuthentication/KerberosAuthentication.vue +55 -0
  13. package/components/common/wizards/datastoreNew/add/nfs/_kerberosAuthentication/lib/config/radioOptions.ts +27 -0
  14. package/components/common/wizards/datastoreNew/add/nfs/accessibility/Accessibility.vue +63 -0
  15. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/config/tabsPannel.ts +24 -0
  16. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/interfaces.ts +9 -0
  17. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/types.ts +5 -0
  18. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/TablesView.vue +85 -0
  19. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -0
  20. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
  21. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/tableKeys.ts +15 -0
  22. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/models/interfaces.ts +11 -0
  23. package/components/common/wizards/datastoreNew/add/nfs/configuration/Configuration.vue +236 -0
  24. package/components/common/wizards/datastoreNew/add/nfs/configuration/_serversList/DeletePopover.vue +100 -0
  25. package/components/common/wizards/datastoreNew/add/nfs/configuration/_serversList/ServersList.vue +123 -0
  26. package/components/common/wizards/datastoreNew/add/nfs/configuration/_serversList/lib/config/serversListConfig.ts +40 -0
  27. package/components/common/wizards/datastoreNew/add/nfs/configuration/_serversList/lib/config/tableKeys.ts +3 -0
  28. package/components/common/wizards/datastoreNew/add/nfs/configuration/_serversList/lib/models/interfaces.ts +3 -0
  29. package/components/common/wizards/datastoreNew/add/nfs/configuration/_serversList/lib/models/types.ts +1 -0
  30. package/components/common/wizards/datastoreNew/add/nfs/configuration/lib/models/interfaces.ts +5 -0
  31. package/components/common/wizards/datastoreNew/add/nfs/version/Version.vue +26 -0
  32. package/components/common/wizards/datastoreNew/add/nfs/version/lib/config/versionOptions.ts +22 -0
  33. package/components/common/wizards/datastoreNew/add/readyComplete/ReadyComplete.vue +88 -0
  34. package/components/common/wizards/datastoreNew/add/readyComplete/lib/config/propertiesDetails.ts +140 -0
  35. package/components/common/wizards/datastoreNew/add/sharedStorm/SharedStorm.vue +83 -0
  36. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/DeviceSelection.vue +262 -0
  37. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +23 -0
  38. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces.ts +48 -0
  39. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/types.ts +8 -0
  40. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/Table.vue +134 -0
  41. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/hostsTable.ts +87 -0
  42. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/tableKeys.ts +11 -0
  43. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +236 -0
  44. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/graphicTooltip/graphicTooltip.vue +64 -0
  45. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/lib/config/selectOptions.ts +46 -0
  46. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/sizeGraphic/sizeGraphic.vue +225 -0
  47. package/components/common/wizards/datastoreNew/add/sharedStorm/version/Version.vue +39 -0
  48. package/components/common/wizards/datastoreNew/add/sharedStorm/version/lib/config/versionOptions.ts +21 -0
  49. package/components/common/wizards/datastoreNew/add/types/Types.vue +78 -0
  50. package/components/common/wizards/datastoreNew/add/types/lib/config/typeOptions.ts +49 -0
  51. package/lib/models/interfaces.ts +1 -0
  52. package/package.json +1 -1
@@ -4,6 +4,10 @@ export interface I_CompatibleHostsTable {
4
4
  cluster: string
5
5
  }
6
6
 
7
+
8
+
9
+
10
+
7
11
  export interface I_IncompatibleHostsTable extends I_CompatibleHostsTable{
8
12
  host_incompatibility_reason: string
9
13
  }
@@ -1,14 +1,23 @@
1
1
  import type { UI_I_Localization } from '~/lib/models/interfaces'
2
2
  import type { UI_I_SelectHostOptions } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
3
3
 
4
+ const constructHostListFunc = (
5
+ data: { name: string; id: string }[]
6
+ ): UI_I_SelectHostOptions[] => {
7
+ return data.map((item) => ({
8
+ text: item.name,
9
+ value: item.id,
10
+ disabled: false,
11
+ }))
12
+ }
13
+
4
14
  export const hostsOptionsFunc = (
5
15
  localization: UI_I_Localization,
6
- data: UI_I_SelectHostOptions[] | undefined
16
+ hosts: { name: string; id: string }[] | undefined
7
17
  ): UI_I_SelectHostOptions[] => {
8
- if(!data) return []
18
+ if (!hosts) return []
19
+
20
+ const data = constructHostListFunc(hosts)
9
21
 
10
- return [
11
- { text: localization.common.selectHost, value: '', disabled: true },
12
- ...data,
13
- ]
22
+ return [{ text: localization.common.selectHost, value: '', disabled: true }, ...data]
14
23
  }
@@ -0,0 +1,464 @@
1
+ <template>
2
+ <div class="new-datastore">
3
+ <atoms-wizard
4
+ show
5
+ :wizard="wizard"
6
+ :selected-scheme="selectedScheme"
7
+ :title="localization.newDatastore"
8
+ :localization="localization"
9
+ class="add-datastore"
10
+ test-id="add-datastore-wizard"
11
+ @change-steps="onChangeSteps"
12
+ @hide="onHideModal"
13
+ @submit="onFinish"
14
+ >
15
+ <template #modalBody="{ selectedStep }">
16
+ <common-wizards-datastore-new-add-types
17
+ v-if="selectedStep.id === 0"
18
+ v-model="form.type_code"
19
+ v-model:datastore-type="datastoreType"
20
+ :project="props.project"
21
+ />
22
+
23
+ <common-wizards-datastore-new-add-local
24
+ v-show="selectedStep.id === 1"
25
+ v-model="form"
26
+ :project="props.project"
27
+ :step-id="selectedStep.id"
28
+ :datastore-type="datastoreType"
29
+ :alert-messages="alertMessages[1]"
30
+ :messages-fields="selectedStep.fields"
31
+ @hide-alert="onHideAlert"
32
+ />
33
+
34
+ <common-wizards-datastore-new-add-shared-storm
35
+ v-show="datastoreType === 'shared-storm'"
36
+ v-model="form"
37
+ :project="props.project"
38
+ :step-id="selectedStep.id"
39
+ :datastore-type="datastoreType"
40
+ :alert-messages="alertMessages[selectedStep.id]"
41
+ :messages-fields="selectedStep.fields"
42
+ :hosts="props.nfsHosts"
43
+ :is-main-filter="props.isMainFilter"
44
+ :host-id="props.hostId"
45
+ @hide-alert="onHideAlert"
46
+ @main-filter="emits('main-filter', $event)"
47
+ />
48
+
49
+ <common-wizards-datastore-new-add-nfs
50
+ v-show="datastoreType === 'nfs'"
51
+ v-model="form"
52
+ :project="props.project"
53
+ :step-id="selectedStep.id"
54
+ :alert-messages="alertMessages[selectedStep.id]"
55
+ :messages-fields="selectedStep.fields"
56
+ :hosts="props.nfsHosts"
57
+ />
58
+
59
+ <common-wizards-datastore-new-add-ready-complete
60
+ v-show="selectedStep.id === 11"
61
+ :data-ready-view="dataReadyView"
62
+ />
63
+ </template>
64
+ </atoms-wizard>
65
+ </div>
66
+ </template>
67
+
68
+ <script setup lang="ts">
69
+ import type {
70
+ UI_I_WizardStep,
71
+ UI_I_ValidationReturn,
72
+ UI_I_AsyncCheckReturn,
73
+ } from '~/components/atoms/wizard/lib/models/interfaces'
74
+ import Wizard from '~/components/atoms/wizard/lib/utils/utils'
75
+ import {
76
+ stepsFunc,
77
+ stepsSchemeInitial,
78
+ } from '~/components/common/wizards/datastoreNew/add/lib/config/steps'
79
+
80
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
81
+ import type { UI_T_Project } from '~/lib/models/types'
82
+ import type { UI_T_DatastoreType } from '~/components/common/wizards/datastoreNew/add/lib/models/types'
83
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastoreNew/add/lib/models/interfaces'
84
+ import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
85
+ import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/models/interfaces'
86
+ import { E_DatastoreTypeKode } from '~/components/common/wizards/datastoreNew/add/lib/models/enums'
87
+ import { constructDataReadyViewFunc } from '~/components/common/wizards/datastoreNew/add/readyComplete/lib/config/propertiesDetails'
88
+ import { checkValidityName } from '~/components/common/wizards/datastoreNew/add/lib/utils'
89
+
90
+ const props = defineProps<{
91
+ project: UI_T_Project
92
+ nfsHosts?: UI_I_CreateDatastoreHosts
93
+ hostId?: string
94
+ isMainFilter?: boolean
95
+ }>()
96
+ const emits = defineEmits<{
97
+ (event: 'hide'): void
98
+ (event: 'finish', value: any): void
99
+ (event: 'main-filter', value: string): void
100
+ }>()
101
+
102
+ const localization = computed<UI_I_Localization>(() => useLocal())
103
+
104
+ const wizard: Wizard = new Wizard(
105
+ stepsFunc(localization.value),
106
+ stepsSchemeInitial
107
+ )
108
+
109
+ const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
110
+ const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
111
+
112
+ // const datastoreType = ref<UI_T_DatastoreType>(
113
+ // props.project === 'procurator' ? 'local' : 'shared-storm'
114
+ // )
115
+ const datastoreType = ref<UI_T_DatastoreType>('shared-storm')
116
+
117
+ const form = ref<UI_I_CreateDatastoreForm>({
118
+ name: '',
119
+ lunDisk: [],
120
+ hosts: props.hostId ? [props?.hostId] : [],
121
+ type_code: E_DatastoreTypeKode[datastoreType.value],
122
+ nfsVersion: 'nfs-3',
123
+ readonly: false,
124
+ server: '',
125
+ folder: '',
126
+ })
127
+
128
+ const checkName = async (
129
+ label: string,
130
+ localization: UI_I_Localization,
131
+ wizard: Wizard
132
+ // emits: UI_I_AddNetworkingEmits
133
+ ): Promise<UI_I_AsyncCheckReturn> => {
134
+ const typeCode = form.value.type_code
135
+
136
+ let help = typeCode === 1
137
+ if (typeCode === 2) {
138
+ help = form.value.lunDisk.length
139
+ }
140
+ if (typeCode === 4) {
141
+ help = form.value.folder && form.value.server
142
+ }
143
+ if (label && help) {
144
+ return new Promise((resolve, _reject) =>
145
+ checkValidityName(label, wizard, props.project, (message: string) => {
146
+ resolve({
147
+ isValid: message === '',
148
+ message: message === '' ? '' : message,
149
+ })
150
+ })
151
+ )
152
+ } else {
153
+ return {
154
+ isValid: false,
155
+ message: !label ? localization.common.specifyDatastoreName : '',
156
+ }
157
+ }
158
+ }
159
+ const checkDatastoreNameAsync = async (
160
+ localization: UI_I_Localization,
161
+ value: UI_I_WizardStep[],
162
+ label: string,
163
+ stepId: number,
164
+ fieldName: string,
165
+ wizard: Wizard
166
+ ): Promise<UI_I_ValidationReturn> => {
167
+ let stepHasError = false
168
+
169
+ const labelValidation: {
170
+ isValid: boolean
171
+ message: string
172
+ } = await checkName(label, localization, wizard)
173
+
174
+ if (!labelValidation.isValid) {
175
+ stepHasError = wizard.setValidation(stepId, fieldName, {
176
+ fieldMessage: labelValidation.message,
177
+ alertMessage: label ? labelValidation.message : '',
178
+ })
179
+ } else if (wizard.hasMessage(stepId, fieldName)) {
180
+ value = wizard.removeValidation(stepId, fieldName, value)
181
+ }
182
+
183
+ return {
184
+ newValue: value,
185
+ stepHasError,
186
+ }
187
+ }
188
+
189
+ const checkSelectedLunDiskSync = (
190
+ localization: UI_I_Localization,
191
+ { lunDisk, name, hosts }: UI_I_CreateDatastoreForm,
192
+ wizard: Wizard,
193
+ value: UI_I_WizardStep[]
194
+ ): UI_I_ValidationReturn => {
195
+ let stepHasError = false
196
+
197
+ if (!lunDisk.length && name) {
198
+ const isErrorTextForSphere =
199
+ props.project === 'sphere' && !props.hostId && !hosts.length
200
+ stepHasError = wizard.setValidation(2, 'lunDisk', {
201
+ fieldMessage: '',
202
+ alertMessage: isErrorTextForSphere
203
+ ? localization.common.selectHostToContinueAlert
204
+ : localization.common.selectDiskToContinueAlert,
205
+ })
206
+ } else if (wizard.hasMessage(2, 'lunDisk')) {
207
+ value = wizard.removeValidation(2, 'lunDisk', value)
208
+ }
209
+
210
+ return {
211
+ newValue: value,
212
+ stepHasError,
213
+ }
214
+ }
215
+
216
+ const checkNfsFolderSync = (
217
+ localization: UI_I_Localization,
218
+ name: string,
219
+ wizard: Wizard,
220
+ value: UI_I_WizardStep[]
221
+ ): UI_I_ValidationReturn => {
222
+ let stepHasError = false
223
+
224
+ if (!name) {
225
+ stepHasError = wizard.setValidation(5, 'folder', {
226
+ fieldMessage: localization.common.specifyFolderName,
227
+ alertMessage: '',
228
+ })
229
+ } else if (wizard.hasMessage(5, 'folder')) {
230
+ value = wizard.removeValidation(5, 'folder', value)
231
+ }
232
+
233
+ return {
234
+ newValue: value,
235
+ stepHasError,
236
+ }
237
+ }
238
+ const checkNfsServerSync = (
239
+ localization: UI_I_Localization,
240
+ name: string,
241
+ wizard: Wizard,
242
+ value: UI_I_WizardStep[]
243
+ ): UI_I_ValidationReturn => {
244
+ let stepHasError = false
245
+
246
+ if (!name) {
247
+ stepHasError = wizard.setValidation(5, 'server', {
248
+ fieldMessage: localization.common.specifyServerName,
249
+ alertMessage: '',
250
+ })
251
+ } else if (wizard.hasMessage(5, 'server')) {
252
+ value = wizard.removeValidation(5, 'server', value)
253
+ }
254
+
255
+ return {
256
+ newValue: value,
257
+ stepHasError,
258
+ }
259
+ }
260
+
261
+ const checkHostsAccessibilitySync = (
262
+ localization: UI_I_Localization,
263
+ hosts: any,
264
+ wizard: Wizard,
265
+ value: UI_I_WizardStep[]
266
+ ): UI_I_ValidationReturn => {
267
+ let stepHasError = false
268
+
269
+ if (!hosts.length) {
270
+ stepHasError = wizard.setValidation(6, 'hostsAccessibility', {
271
+ fieldMessage: '',
272
+ alertMessage: localization.common.selectLeastEntityContinue,
273
+ })
274
+ } else if (wizard.hasMessage(6, 'hostsAccessibility')) {
275
+ value = wizard.removeValidation(6, 'hostsAccessibility', value)
276
+ }
277
+
278
+ return {
279
+ newValue: value,
280
+ stepHasError,
281
+ }
282
+ }
283
+
284
+ const validationFunc = async (
285
+ value: UI_I_WizardStep[],
286
+ currentStep: UI_I_WizardStep,
287
+ nextStep: UI_I_WizardStep
288
+ ): Promise<UI_I_ValidationReturn> => {
289
+ let stepHasError = false
290
+
291
+ if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
292
+ const nameValidation = await checkDatastoreNameAsync(
293
+ localization.value,
294
+ value,
295
+ form.value.name,
296
+ 1,
297
+ 'datastoreName',
298
+ wizard
299
+ )
300
+
301
+ value = nameValidation.newValue
302
+
303
+ stepHasError = nameValidation.stepHasError
304
+ }
305
+
306
+ if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
307
+ const nameValidation = await checkDatastoreNameAsync(
308
+ localization.value,
309
+ value,
310
+ form.value.name,
311
+ 2,
312
+ 'datastoreName',
313
+ wizard
314
+ )
315
+
316
+ value = nameValidation.newValue
317
+
318
+ const lunDiskValidation = checkSelectedLunDiskSync(
319
+ localization.value,
320
+ form.value,
321
+ wizard,
322
+ value
323
+ )
324
+
325
+ value = lunDiskValidation.newValue
326
+
327
+ stepHasError = nameValidation.stepHasError || lunDiskValidation.stepHasError
328
+ }
329
+
330
+ if (wizard.isValidateForStep(5, currentStep.id, nextStep.id)) {
331
+ const nameValidation = await checkDatastoreNameAsync(
332
+ localization.value,
333
+ value,
334
+ form.value.name,
335
+ 5,
336
+ 'name',
337
+ wizard
338
+ )
339
+ value = nameValidation.newValue
340
+
341
+ const folderValidation = checkNfsFolderSync(
342
+ localization.value,
343
+ form.value.folder,
344
+ wizard,
345
+ value
346
+ )
347
+ value = folderValidation.newValue
348
+
349
+ const serverValidation = checkNfsServerSync(
350
+ localization.value,
351
+ form.value.server,
352
+ wizard,
353
+ value
354
+ )
355
+ value = serverValidation.newValue
356
+
357
+ stepHasError =
358
+ nameValidation.stepHasError ||
359
+ folderValidation.stepHasError ||
360
+ serverValidation.stepHasError
361
+ }
362
+
363
+ if (wizard.isValidateForStep(6, currentStep.id, nextStep.id)) {
364
+ const nameValidation = await checkHostsAccessibilitySync(
365
+ localization.value,
366
+ form.value.hosts,
367
+ wizard,
368
+ value
369
+ )
370
+
371
+ value = nameValidation.newValue
372
+
373
+ stepHasError = nameValidation.stepHasError
374
+ }
375
+
376
+ return {
377
+ newValue: value,
378
+ stepHasError,
379
+ }
380
+ }
381
+
382
+ const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
383
+ wizard.changeSteps(value, validationFunc)
384
+
385
+ // Choosing Scheme
386
+ watch(
387
+ datastoreType,
388
+ (newValue: UI_T_DatastoreType) => {
389
+ if (props.project === 'procurator') {
390
+ if (newValue === 'local') {
391
+ wizard.changeScheme(0)
392
+ }
393
+
394
+ if (newValue === 'shared-storm') {
395
+ wizard.changeScheme(1)
396
+ }
397
+
398
+ if (newValue === 'nfs') {
399
+ wizard.changeScheme(2)
400
+ }
401
+ }
402
+ if (props.project === 'sphere') {
403
+ if (newValue === 'shared-storm') {
404
+ wizard.changeScheme(3)
405
+ }
406
+
407
+ if (newValue === 'nfs') {
408
+ wizard.changeScheme(4)
409
+ }
410
+ }
411
+ },
412
+ { deep: true, immediate: true }
413
+ )
414
+
415
+ const dataReadyView = computed<UI_I_DetailsItem>(() =>
416
+ constructDataReadyViewFunc(
417
+ localization.value,
418
+ form.value,
419
+ props.project,
420
+ props.nfsHosts
421
+ )
422
+ )
423
+
424
+ const onHideAlert = (stepId: number): void => {
425
+ wizard.hideAlertMessagesByStepId(stepId)
426
+ }
427
+ const onHideModal = (): void => {
428
+ emits('hide')
429
+ }
430
+ const onFinish = (): void => {
431
+ emits('finish', form.value)
432
+ }
433
+ // watch(
434
+ // () => props.isLoading,
435
+ // (newValue) => {
436
+ // wizard.setLoader(newValue)
437
+ // },
438
+ // { immediate: true }
439
+ // )
440
+ </script>
441
+
442
+ <style scoped lang="scss">
443
+ @import 'assets/scss/common/mixins.scss';
444
+ .new-datastore {
445
+ &__body {
446
+ @include flex($dir: column);
447
+ height: 100%;
448
+ padding-left: 24px;
449
+ }
450
+ }
451
+
452
+ .finish-block {
453
+ padding: 18px 24px 24px 24px;
454
+
455
+ .add-hosts-ready-to-complete-mt-12 {
456
+ margin-top: 12px;
457
+
458
+ .add-hosts-ready-to-complete-bold {
459
+ line-height: 18px;
460
+ font-weight: 700;
461
+ }
462
+ }
463
+ }
464
+ </style>
@@ -0,0 +1,135 @@
1
+ import { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import { 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: 5,
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: 6,
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
+ },
127
+ ]
128
+
129
+ export const stepsSchemeInitial: number[][] = [
130
+ [0, 1, 11], // Procurator Scheme for "local" type
131
+ [0, 2, 3, 11], // Procurator Scheme for "shared-storm" type
132
+ [0, 4, 5, 11], // Procurator Scheme for "nfs" type
133
+ [0, 2, 11], // Sphere Scheme for "shared-storm" type
134
+ [0, 4, 5, 6, 11], // Sphere Scheme for "nfs" type
135
+ ]
@@ -0,0 +1,5 @@
1
+ export enum E_DatastoreTypeKode {
2
+ local = 1,
3
+ 'shared-storm' = 2,
4
+ nfs = 4,
5
+ }
@@ -0,0 +1,12 @@
1
+ import type { UI_T_NfsType } from '~/components/common/wizards/datastoreNew/add/lib/models/types'
2
+ import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces'
3
+ export interface UI_I_CreateDatastoreForm {
4
+ name: string
5
+ lunDisk: UI_I_CreateStorageLunDiskItem[]
6
+ nfsVersion: UI_T_NfsType
7
+ type_code: 2 | 4
8
+ readonly: boolean
9
+ server: string
10
+ folder: string
11
+ hosts: string[]
12
+ }
@@ -0,0 +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'
4
+ export type UI_T_KerberosAuthentication =
5
+ | 'dont-use'
6
+ | 'use-only-krb5'
7
+ | 'use-integrity'
@@ -0,0 +1,31 @@
1
+ import type { API_UI_I_Error } from '~/lib/models/store/interfaces'
2
+ import type { UI_T_Project } from '~/lib/models/types'
3
+ import Wizard from '~/components/atoms/wizard/lib/utils/utils'
4
+
5
+ export const checkValidityName = async (
6
+ name: string,
7
+ wizard: Wizard,
8
+ project: UI_T_Project,
9
+ sendMessage: (message: string) => void,
10
+ ): Promise<void> => {
11
+ // TODO move to projects!!!
12
+
13
+ wizard.setLoader(true)
14
+ const kind = 10 // TODO move in global space
15
+ const url =
16
+ project === 'procurator'
17
+ ? `/ui/ds/validate?name=${name}`
18
+ : `/ui/object/validate_name?name=${name}&kind=${kind}`
19
+ // @ts-ignore
20
+ const { error } = await useMyFetch<null, API_UI_I_Error>(url, {
21
+ method: 'GET',
22
+ })
23
+ wizard.setLoader(false)
24
+
25
+ if (error.value && error.value.data.error_code !== 0) {
26
+ const existError = error.value.data?.error_message || error.value.data
27
+ sendMessage(existError)
28
+ return
29
+ }
30
+ sendMessage('')
31
+ }