bfg-common 1.3.497 → 1.3.498

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