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,11 +1,11 @@
1
1
  <template>
2
- <div class="device-selection">
2
+ <div class="device-selection-step">
3
3
  <atoms-alert
4
- v-show="errors.length"
4
+ v-show="props.alertMessages?.length"
5
5
  :test-id="errorAlertDataId"
6
6
  status="alert-danger"
7
- :items="errors"
8
- @remove="onCloseAlertDanger"
7
+ :items="props.alertMessages"
8
+ @remove="onHideAlert"
9
9
  />
10
10
 
11
11
  <div class="clr-form-control clr-row">
@@ -13,28 +13,21 @@
13
13
  {{ localization.common.name }}
14
14
  </label>
15
15
 
16
- <div
17
- class="clr-control-container"
18
- :class="formErrors.errors?.name?.length && 'clr-error'"
19
- >
16
+ <div class="clr-control-container" :class="nameErrorText && 'clr-error'">
20
17
  <div class="flex-align-center">
21
18
  <input
22
19
  id="device-selection-input"
23
- v-model="form.name.value"
20
+ v-model="model.name"
24
21
  data-id="device-selection-input"
25
22
  type="text"
26
23
  class="clr-input"
27
- @blur="initValidation"
28
- @input="onInput"
24
+ @blur="initValidation(true)"
25
+ @input="initValidation(false)"
29
26
  />
30
27
  <atoms-the-icon class="error-icon" name="info-circle" />
31
28
  </div>
32
29
 
33
- <div
34
- v-if="nameErrorText"
35
- class="clr-subtext"
36
- data-id="storm-datastore-name-field-require"
37
- >
30
+ <div class="clr-subtext" data-id="storm-datastore-name-field-require">
38
31
  {{ nameErrorText }}
39
32
  </div>
40
33
  </div>
@@ -43,14 +36,14 @@
43
36
  <atoms-alert
44
37
  v-if="alertInfo"
45
38
  test-id="device-selection-information-alert"
46
- class="device-selection__alert-info"
39
+ class="device-selection-step__alert-info"
47
40
  status="alert-info"
48
41
  :items="[localization.common.nameAndDeviceSelectionAlertInfo]"
49
42
  @remove="onHideAlertInfo"
50
43
  />
51
44
 
52
45
  <div
53
- v-if="props.mode === 'sphere' && !props.hostId"
46
+ v-if="props.project === 'sphere' && !props.hostId"
54
47
  class="clr-form-control clr-row"
55
48
  >
56
49
  <label class="clr-control-label clr-col-12 clr-col-md-2">
@@ -61,7 +54,7 @@
61
54
  <div class="clr-select-wrapper">
62
55
  <select
63
56
  id="device-host-select"
64
- v-model="selectedHost"
57
+ v-model="model.hosts"
65
58
  data-id="device-host-select"
66
59
  class="dropdown-toggle"
67
60
  @change="onSelectHost"
@@ -69,7 +62,7 @@
69
62
  <option
70
63
  v-for="(item, index) in hostOptions"
71
64
  :key="index"
72
- :value="item.value"
65
+ :value="[item.value]"
73
66
  :disabled="item.disabled"
74
67
  >
75
68
  {{ item.text }}
@@ -82,9 +75,9 @@
82
75
  </div>
83
76
  </div>
84
77
 
85
- <div class="device-selection__disk-list">
86
- <common-wizards-datastore-add-shared-storm-device-selection-host-table
87
- v-model:selected="selectedLunDisk"
78
+ <div class="device-selection-step__disk-list">
79
+ <common-wizards-datastore-add-shared-storm-device-selection-table
80
+ v-model="model.lunDisk"
88
81
  :data-table="dataTable?.items || []"
89
82
  :total-items="dataTable?.total_items || 0"
90
83
  :total-pages="dataTable?.total_pages || 1"
@@ -100,97 +93,78 @@
100
93
  </template>
101
94
 
102
95
  <script lang="ts" setup>
103
- import type { UI_I_ValidationTouchResult } from '~/lib/models/plugins/validation/interfaces'
104
- // import type { UI_I_SchemaTablePayload } from '~/lib/models/store/interfaces'
105
- import type { UI_I_Localization } from '~/lib/models/interfaces'
96
+ import type { UI_T_Project } from '~/lib/models/types'
106
97
  import type {
98
+ UI_I_Localization,
99
+ UI_I_ArbitraryObject,
100
+ } from '~/lib/models/interfaces'
101
+ import {
107
102
  API_UI_I_DataTable,
108
103
  UI_I_Pagination,
109
104
  UI_I_DataTableQuery,
110
105
  } from '~/lib/models/table/interfaces'
111
106
  import type {
112
107
  UI_I_CreateStorageLunDiskItem,
113
- UI_I_DeviceSelectionSendData,
114
- UI_I_FormValidationDataStore,
115
108
  UI_I_LunDiskSpherePayload,
116
109
  UI_I_SelectHostOptions,
117
110
  } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
118
- // import type { UI_T_HostSelectedType } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/types'
119
- import type {
120
- UI_T_DatastoreType,
121
- UI_T_WizardDatastoreMode,
122
- } from '~/components/common/wizards/datastore/add/lib/models/types'
123
- import { defaultFormFunc } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/defaultForm'
111
+ import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
112
+ import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
113
+ import type { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
124
114
  import { hostsOptionsFunc } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/selectOptions'
125
- import { checkValidityName } from '~/components/common/wizards/datastore/add/lib/utils'
126
115
  import { validateNameAndGenerateDataId } from '~/components/common/wizards/datastore/add/lib/utils'
127
116
 
128
117
  const props = defineProps<{
129
- mode: UI_T_WizardDatastoreMode
130
- deviceSelectionSubmit: number
131
- lunDisk: UI_I_CreateStorageLunDiskItem[]
132
- stepPosition: number
118
+ project: UI_T_Project
119
+ stepId: number
120
+ alertMessages: string[]
121
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
133
122
  datastoreType: UI_T_DatastoreType
134
- datacenterHosts?: UI_I_SelectHostOptions[] | undefined
123
+ hosts?: UI_I_CreateDatastoreHosts | undefined
135
124
  isMainFilter?: boolean
136
125
  hostId?: string
137
126
  }>()
127
+ const model = defineModel<any>()
138
128
  const emits = defineEmits<{
139
- (event: 'loading', value: boolean): void
140
- (event: 'submit', value: UI_I_DeviceSelectionSendData): void
141
- (
142
- event: 'update:lun-disk',
143
- value: UI_I_CreateStorageLunDiskItem[] | null
144
- ): void
129
+ (event: 'hide-alert', value: number): void
145
130
  (event: 'main-filter', value: string): void
146
131
  }>()
147
132
 
148
133
  const localization = computed<UI_I_Localization>(() => useLocal())
149
134
  const { $store } = useNuxtApp()
150
- const { $validation } = useNuxtApp()
151
135
 
152
136
  const isInitDatastoreNameValidation = ref<boolean>(false)
153
- const initValidation = (): void => {
154
- isInitDatastoreNameValidation.value = true
155
- const valid = validation.touch()
156
- if (!valid.isValid) {
157
- showValidationErrors(valid)
158
- }
159
- }
160
- const onInput = (): void => {
161
- const valid = validation.touch()
162
-
163
- if (!isInitDatastoreNameValidation.value) return
164
-
165
- valid.isValid ? removeInputValidation() : showValidationErrors(valid)
137
+ const initValidation = (onlyBlur: boolean): void => {
138
+ onlyBlur && (isInitDatastoreNameValidation.value = true)
166
139
  }
167
140
 
168
- const nameErrorText = computed<string>(
169
- () => formErrors.value?.errors?.name?.[0] || ''
170
- )
141
+ const nameErrorText = computed<string>(() => {
142
+ if (props.messagesFields?.datastoreName?.field && !model.value.name) {
143
+ return props.messagesFields.datastoreName.field
144
+ }
171
145
 
172
- const validation = $validation.call({})
173
- const defaultForm: UI_I_FormValidationDataStore = defaultFormFunc(
174
- localization.value
175
- )
176
- const form = ref<UI_I_FormValidationDataStore>(useDeepCopy(defaultForm))
146
+ if (!isInitDatastoreNameValidation.value) return ''
147
+ return !model.value.name ? localization.value.common.specifyDatastoreName : ''
148
+ })
177
149
 
178
- const setForm = (): void => {
179
- form.value = useDeepCopy(defaultForm)
180
- validation.setForm(form)
181
- }
182
- setForm()
150
+ const defaultDataId = ref<string>('device-selection-alert-error')
151
+ const errorAlertDataId = computed<string>(() => {
152
+ if (!props.alertMessages?.length) return
153
+
154
+ return !model.value.lunDisk.length
155
+ ? `${defaultDataId.value}-not-selected-lundisk`
156
+ : validateNameAndGenerateDataId(
157
+ model.value.name,
158
+ props.alertMessages[0],
159
+ defaultDataId.value
160
+ )
161
+ })
183
162
 
184
163
  const alertInfo = ref<boolean>(true)
185
164
  const onHideAlertInfo = (): void => {
186
165
  alertInfo.value = false
187
166
  }
188
167
 
189
- const errors = ref<string[]>([])
190
- const errorAlertDataId = ref<string>('')
191
- const defaultDataId = ref<string>('device-selection-alert-error')
192
- const formErrors = ref<UI_I_ValidationTouchResult[]>([])
193
-
194
168
  /* Lun disk table */
195
169
 
196
170
  const pagination = ref<UI_I_Pagination>({
@@ -199,22 +173,6 @@ const pagination = ref<UI_I_Pagination>({
199
173
  })
200
174
  const sort = ref<string | null>(null)
201
175
 
202
- const selectedLunDisk = ref<number[]>([])
203
-
204
- watch(
205
- selectedLunDisk,
206
- (newValue: number[] | null) => {
207
- if (newValue === null || !dataTable.value) return null
208
-
209
- const lunDisk = dataTable.value.items.filter((_: any, key: number) =>
210
- newValue.includes(key)
211
- )
212
-
213
- emits('update:lun-disk', lunDisk)
214
- },
215
- { deep: true }
216
- )
217
-
218
176
  const updatePagination = (event: UI_I_Pagination): void => {
219
177
  pagination.value = event
220
178
  }
@@ -229,165 +187,20 @@ const loading = computed<boolean>(() =>
229
187
  const dataTable = computed<API_UI_I_DataTable<
230
188
  UI_I_CreateStorageLunDiskItem[]
231
189
  > | null>(() => {
232
- // if (props.mode === 'procurator')
233
190
  return $store.getters['storage/getNewDatastoreHosts']
234
-
235
- // if (props.datastoreType === 'local') return []
236
- //
237
- // if (props.datastoreType === 'shared-storm') return []
238
- //
239
- // if (props.datastoreType === 'nfs') return []
240
191
  })
241
192
 
242
193
  /* Select host */
243
- // const hostData = ref<UI_I_SelectHostOptions[] | null>(null)
244
- const selectedHost = ref<string>(props.hostId || '')
245
194
  const hostOptions = computed<UI_I_SelectHostOptions[]>(() =>
246
- hostsOptionsFunc(localization.value, props.datacenterHosts)
247
- ) // <!-- TODO Нам сейчас он не нужен. Мы монтируем nfs только на один хост ( procurator )-->
195
+ hostsOptionsFunc(localization.value, props.hosts?.items)
196
+ )
248
197
 
249
198
  const onSelectHost = (): void => {
250
- if (props.datastoreType !== 'shared-storm') return
251
-
252
- initLunDisksForSphere(selectedHost.value)
253
- }
254
-
255
- const showValidationErrors = (
256
- data: UI_I_ValidationTouchResult[],
257
- errorText = '',
258
- alert = false
259
- ): void => {
260
- if (alert) {
261
- errors.value = [errorText]
262
- errorAlertDataId.value = !selectedLunDisk.value.length
263
- ? `${defaultDataId.value}-not-selected-lundisk`
264
- : validateNameAndGenerateDataId(
265
- form.value.name.value,
266
- errorText,
267
- defaultDataId.value
268
- )
269
- }
270
- formErrors.value = data
271
- }
272
-
273
- const resetValidation = (): void => {
274
- errors.value = []
275
- formErrors.value = []
276
- }
277
- const removeInputValidation = (): void => {
278
- formErrors.value = []
279
- }
280
- const onCloseAlertDanger = (): void => {
281
- errors.value = []
282
- }
283
- const validatePropertiesForSphere = (): boolean => {
284
- if (props.datastoreType === 'local') {
285
- return !selectedHost.value
286
- }
287
-
288
- if (props.datastoreType === 'shared-storm') {
289
- return !selectedHost.value || !selectedLunDisk.value.length
290
- }
199
+ if (props.datastoreType !== 'shared-storm') return // TODO рефакторинг ( удалить проверку )
291
200
 
292
- return false
201
+ initLunDisksForSphere(model.value.hosts[0])
293
202
  }
294
- const validationTextForSphere = (): string => {
295
- if (props.datastoreType === 'local') {
296
- return 'selectHostToContinueAlert'
297
- }
298
-
299
- if (props.datastoreType === 'shared-storm') {
300
- return !selectedHost.value
301
- ? 'selectHostToContinueAlert'
302
- : 'selectDiskToContinueAlert'
303
- }
304
203
 
305
- return ''
306
- }
307
-
308
- const collectDataForReview = (
309
- name: string,
310
- mode: UI_T_WizardDatastoreMode
311
- ): UI_I_DeviceSelectionSendData => {
312
- const data: UI_I_DeviceSelectionSendData = {
313
- name,
314
- }
315
-
316
- if (mode === 'procurator') {
317
- data.lunDisk = props.lunDisk.map((lun) => {
318
- return { name: lun.name, capacity: lun.capacity_mb }
319
- })
320
- }
321
-
322
- if (mode === 'sphere') {
323
- if (props.datastoreType === 'local') {
324
- data.host = selectedHost.value
325
- }
326
-
327
- if (props.datastoreType === 'shared-storm') {
328
- data.host = selectedHost.value
329
- data.lunDisk = props.lunDisk.map((lun) => {
330
- return { name: lun.name, capacity: lun.capacity_mb }
331
- })
332
- }
333
- }
334
-
335
- return data
336
- }
337
-
338
- const submit = async (): Promise<void> => {
339
- const name = form.value.name.value
340
- const { mode } = props
341
-
342
- const valid = validation.touch()
343
- const isShowAlertDanger =
344
- mode === 'procurator'
345
- ? !selectedLunDisk.value.length
346
- : validatePropertiesForSphere()
347
-
348
- if (!valid.isValid || isShowAlertDanger) {
349
- const isModeSphere = mode === 'sphere'
350
-
351
- const errorText =
352
- localization.value.common[
353
- isModeSphere ? validationTextForSphere() : 'selectDiskToContinueAlert'
354
- ]
355
-
356
- showValidationErrors(valid, errorText, isShowAlertDanger)
357
- return
358
- }
359
-
360
- if (!isShowAlertDanger) {
361
- emits('loading', true)
362
-
363
- const { valid: validName, msg } = await checkValidityName(name, props.mode)
364
-
365
- emits('loading', false)
366
-
367
- if (!validName) {
368
- showValidationErrors(valid, msg, true)
369
- return
370
- }
371
- }
372
-
373
- resetValidation()
374
-
375
- const eventData = collectDataForReview(name, mode)
376
- emits('submit', eventData)
377
- }
378
-
379
- watch(
380
- () => props.deviceSelectionSubmit,
381
- () => {
382
- submit()
383
- }
384
- )
385
-
386
- // const initHostData = async (): Promise<void> => {
387
- // hostData.value = await $store.dispatch('storage/A_GET_DATACENTER_HOSTS', {
388
- // schema: 'short',
389
- // } as UI_I_SchemaTablePayload)
390
- // }
391
204
  const initLunDisksForSphere = async (host: string): Promise<void> => {
392
205
  await $store.dispatch('storage/A_GET_DISKS_LIST', {
393
206
  host,
@@ -405,34 +218,18 @@ const initLunDisksDataTable = async (): Promise<void> => {
405
218
  } as UI_I_DataTableQuery)
406
219
  }
407
220
 
408
- watch(
409
- () => props.stepPosition,
410
- () => {
411
- const { stepPosition, datastoreType, mode } = props
412
- // const hostsDataForProcurator =
413
- // $store.getters['storage/getNewDatastoreHosts']
221
+ if (props.project === 'procurator') {
222
+ // && props.stepId === 2
223
+ initLunDisksDataTable()
224
+ }
414
225
 
415
- // if (
416
- // mode === 'sphere' &&
417
- // stepPosition === 1 &&
418
- // datastoreType === 'local' &&
419
- // !hostData.value
420
- // ) {
421
- // initHostData()
422
- // }
423
- if (
424
- mode === 'procurator' &&
425
- stepPosition === 1 &&
426
- datastoreType === 'shared-storm'
427
- ) {
428
- initLunDisksDataTable()
429
- }
430
- }
431
- )
226
+ const onHideAlert = (): void => {
227
+ emits('hide-alert', props.stepId)
228
+ }
432
229
  </script>
433
230
 
434
231
  <style lang="scss" scoped>
435
- .device-selection {
232
+ .device-selection-step {
436
233
  display: flex;
437
234
  flex-direction: column;
438
235
  height: inherit;
@@ -1,11 +1,11 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_SelectHostOptions } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
1
+ import { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import { UI_I_SelectHostOptions } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
3
3
 
4
4
  const constructHostListFunc = (
5
- data: { name: string; id: string }[]
5
+ data: { host: string; id: string }[]
6
6
  ): UI_I_SelectHostOptions[] => {
7
7
  return data.map((item) => ({
8
- text: item.name,
8
+ text: item.host,
9
9
  value: item.id,
10
10
  disabled: false,
11
11
  }))
@@ -13,7 +13,7 @@ const constructHostListFunc = (
13
13
 
14
14
  export const hostsOptionsFunc = (
15
15
  localization: UI_I_Localization,
16
- hosts: { name: string; id: string }[] | undefined
16
+ hosts: { host: string; id: string }[] | undefined
17
17
  ): UI_I_SelectHostOptions[] => {
18
18
  if (!hosts) return []
19
19
 
@@ -1,9 +1,4 @@
1
- import type { UI_I_Validation } from '~/lib/models/plugins/validation/interfaces'
2
- import type { UI_I_DataTableQuery } from '~/lib/models/table/interfaces'
3
-
4
- export interface UI_I_FormValidationDataStore {
5
- name: UI_I_Validation
6
- }
1
+ import { UI_I_DataTableQuery } from '~/lib/models/table/interfaces'
7
2
 
8
3
  export interface UI_I_LunDiskSpherePayload extends UI_I_DataTableQuery {
9
4
  host: string
@@ -13,11 +8,6 @@ export interface UI_I_LunDisk {
13
8
  name: string
14
9
  capacity: string
15
10
  }
16
- export interface UI_I_DeviceSelectionSendData {
17
- name: string
18
- lunDisk?: UI_I_LunDisk[]
19
- host?: string
20
- }
21
11
 
22
12
  export interface UI_I_SelectHostOptions {
23
13
  text: string
@@ -1,14 +1 @@
1
- export type UI_T_HostTableItemsKey =
2
- | 'name'
3
- | 'identifier'
4
- | 'lun'
5
- | 'capacity_mb'
6
- | 'hardware_acceleration'
7
- | 'drive_type'
8
- | 'sector_format'
9
-
10
- // export type Ui_T_HostSelectedType = 'host-1' | 'host-2' | 'host-3' | 'host-4' | 'host-5'
11
-
12
-
13
-
14
-
1
+ export type T_DatastoreTableItemsTuple = ['name', 'type_ds', 'description']
@@ -38,8 +38,8 @@ import type {
38
38
  } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
39
39
  import { UI_I_Localization } from '~/lib/models/interfaces'
40
40
  import { UI_I_Pagination } from '~/lib/models/table/interfaces'
41
- import { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces'
42
- import * as lunDiskTable from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/lunDiskTable'
41
+ import { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
42
+ import * as lunDiskTable from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/table/lib/config/lunDiskTable'
43
43
 
44
44
  const props = defineProps<{
45
45
  dataTable: UI_I_CreateStorageLunDiskItem[]
@@ -6,7 +6,7 @@ import type {
6
6
  import * as defaultSettings from '~/components/atoms/table/dataGrid/lib/config/settingsTable'
7
7
  import type { UI_I_Localization } from '~/lib/models/interfaces'
8
8
  import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
9
- import { lunDiskTableItemsKeys } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/tableKeys'
9
+ import { lunDiskTableItemsKeys } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/table/lib/config/tableKeys'
10
10
 
11
11
  const getItems = (
12
12
  localization: UI_I_Localization
@@ -1,4 +1,4 @@
1
- import type { UI_T_LunDiskTableItemTuple } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/models/types'
1
+ import type { UI_T_LunDiskTableItemTuple } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/table/lib/models/types'
2
2
 
3
3
  export const lunDiskTableItemsKeys: UI_T_LunDiskTableItemTuple = [
4
4
  'name',
@@ -2,7 +2,7 @@
2
2
  <div class="partition">
3
3
  <div class="clr-form-control clr-row">
4
4
  <label class="clr-col-md-4 clr-control-label">
5
- {{ localization.common.partitionConfiguration }}
5
+ {{ localization.partitionConfiguration }}
6
6
  </label>
7
7
 
8
8
  <div class="clr-col-md-8 p-0">
@@ -29,7 +29,7 @@
29
29
 
30
30
  <div class="datastore-size-container clr-flex-row clr-flex">
31
31
  <label class="clr-col-md-4 clr-control-label" for="datastore-size">
32
- {{ localization.common.datastoreSize }}
32
+ {{ localization.datastoreSize }}
33
33
  </label>
34
34
 
35
35
  <div class="datastore-size-slider-container clr-col-md-8 p-0">
@@ -54,30 +54,30 @@
54
54
 
55
55
  <input
56
56
  id="datastore-size-input-1"
57
- data-id="select-storm-storage-size-input-field"
58
57
  v-model="datastoreSize"
58
+ data-id="select-storm-storage-size-input-field"
59
59
  type="number"
60
60
  min="0"
61
61
  :max="countDatastoreSizeToGb"
62
62
  step="0.01"
63
63
  class="show-arrow"
64
64
  />
65
- <span>{{ localization.common.gb }}</span>
65
+ <span>{{ localization.gb }}</span>
66
66
  </div>
67
67
  </div>
68
68
 
69
69
  <template v-if="props.vmfsVersion === 'vmfs-6'">
70
70
  <div class="clr-form-control clr-row">
71
71
  <label class="clr-col-md-4 clr-control-label">
72
- {{ localization.common.blockSize }}
72
+ {{ localization.blockSize }}
73
73
  </label>
74
74
 
75
75
  <div>
76
76
  <div class="clr-select-wrapper">
77
77
  <select
78
78
  id="storm-configuration-block-size"
79
- data-id="storm-configuration-block-size"
80
79
  v-model="selectedSize"
80
+ data-id="storm-configuration-block-size"
81
81
  class="dropdown-toggle"
82
82
  @change="onSelectHost"
83
83
  >
@@ -96,15 +96,15 @@
96
96
 
97
97
  <div class="clr-form-control clr-row">
98
98
  <label class="clr-col-md-4 clr-control-label">
99
- {{ localization.common.spaceReclamationGranularity }}
99
+ {{ localization.spaceReclamationGranularity }}
100
100
  </label>
101
101
 
102
102
  <div>
103
103
  <div class="clr-select-wrapper">
104
104
  <select
105
105
  id="granularity-select"
106
- data-id="storm-configuration-space-granularity"
107
106
  v-model="selectedGranularity"
107
+ data-id="storm-configuration-space-granularity"
108
108
  class="dropdown-toggle"
109
109
  @change="onSelectHost"
110
110
  >
@@ -123,15 +123,15 @@
123
123
 
124
124
  <div class="clr-form-control clr-row">
125
125
  <label class="clr-col-md-4 clr-control-label">
126
- {{ localization.common.spaceReclamationPriority }}
126
+ {{ localization.spaceReclamationPriority }}
127
127
  </label>
128
128
 
129
129
  <div>
130
130
  <div class="clr-select-wrapper">
131
131
  <select
132
132
  id="priority-select"
133
- data-id="storm-configuration-space-priority"
134
133
  v-model="selectedPriority"
134
+ data-id="storm-configuration-space-priority"
135
135
  class="dropdown-toggle"
136
136
  @change="onSelectHost"
137
137
  >
@@ -157,9 +157,9 @@
157
157
  </template>
158
158
 
159
159
  <script lang="ts" setup>
160
- import type { UI_I_Localization } from '~/lib/models/interfaces'
161
- import type { UI_T_VmfsType } from '~/components/common/wizards/datastore/add/lib/models/types'
162
- import type { UI_I_SelectHostOptions } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
160
+ import { UI_I_Localization } from '~/lib/models/interfaces'
161
+ import { UI_T_VmfsType } from '~/components/common/wizards/datastore/add/lib/models/types'
162
+ import { UI_I_SelectHostOptions } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
163
163
  import {
164
164
  partitionConfigurationFunc,
165
165
  spacePriorityFunc,