bfg-common 1.5.72 → 1.5.74
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.
- package/components/common/wizards/datastore/add/New.vue +21 -11
- package/components/common/wizards/datastore/add/Old.vue +13 -0
- package/components/common/wizards/datastore/add/lib/config/steps.ts +4 -4
- package/components/common/wizards/datastore/add/steps/common/tooltipInfo/TooltipInfo.vue +3 -7
- package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDevice.vue +279 -0
- package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceNew.vue +279 -0
- package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceOld.vue +37 -0
- package/components/common/wizards/datastore/add/steps/nameAndDevice/lib/config/selectOptions.ts +23 -0
- package/components/common/wizards/datastore/add/steps/nameAndDevice/lib/models/interfaces.ts +26 -0
- package/components/common/wizards/datastore/add/steps/nameAndDevice/lib/models/types.ts +1 -0
- package/components/common/wizards/datastore/add/steps/nameAndDevice/table/Table.vue +133 -0
- package/components/common/wizards/datastore/add/steps/nameAndDevice/table/lib/config/lunDiskTable.ts +84 -0
- package/components/common/wizards/datastore/add/steps/nameAndDevice/table/lib/config/tableKeys.ts +11 -0
- package/components/common/wizards/datastore/add/steps/nameAndDevice/table/lib/models/types.ts +9 -0
- package/package.json +1 -1
- /package/components/common/wizards/datastore/add/{nfs → steps}/_kerberosAuthentication/KerberosAuthentication.vue +0 -0
- /package/components/common/wizards/datastore/add/{nfs → steps}/_kerberosAuthentication/lib/config/radioOptions.ts +0 -0
|
@@ -39,13 +39,11 @@
|
|
|
39
39
|
<div ref="subTitleBlock1">
|
|
40
40
|
<div class="subtitle-block">
|
|
41
41
|
<ui-alert
|
|
42
|
-
v-if="
|
|
43
|
-
props.alertMessages[dynamicSteps.connectionSettings].length
|
|
44
|
-
"
|
|
42
|
+
v-if="props.alertMessages[dynamicSteps.nameAndDevice].length"
|
|
45
43
|
test-id="add-host-connection-settings-error-alert"
|
|
46
44
|
type="error"
|
|
47
45
|
size="md"
|
|
48
|
-
:messages="props.alertMessages[dynamicSteps.
|
|
46
|
+
:messages="props.alertMessages[dynamicSteps.nameAndDevice]"
|
|
49
47
|
class="subtitle-block__alert"
|
|
50
48
|
/>
|
|
51
49
|
|
|
@@ -54,15 +52,15 @@
|
|
|
54
52
|
</div>
|
|
55
53
|
</template>
|
|
56
54
|
<template #content>
|
|
57
|
-
<common-wizards-datastore-add-
|
|
58
|
-
v-if="selectedStep.id ===
|
|
55
|
+
<common-wizards-datastore-add-steps-name-and-device
|
|
56
|
+
v-if="selectedStep.id === dynamicSteps.nameAndDevice"
|
|
59
57
|
v-model="form"
|
|
60
58
|
:project="props.project"
|
|
61
|
-
:
|
|
62
|
-
:datastore-type="datastoreType"
|
|
63
|
-
:alert-messages="alertMessages[1]"
|
|
59
|
+
:alert-messages="alertMessages[selectedStep.id]"
|
|
64
60
|
:messages-fields="selectedStep.fields"
|
|
65
|
-
|
|
61
|
+
:hosts="props.nfsHosts"
|
|
62
|
+
:host-id="props.hostId"
|
|
63
|
+
:is-main-filter="props.isMainFilter"
|
|
66
64
|
/>
|
|
67
65
|
</template>
|
|
68
66
|
</ui-wizard-block>
|
|
@@ -270,4 +268,16 @@ const onFinish = (): void => {
|
|
|
270
268
|
}
|
|
271
269
|
</script>
|
|
272
270
|
|
|
273
|
-
<style scoped lang="scss"
|
|
271
|
+
<style scoped lang="scss">
|
|
272
|
+
.subtitle-block {
|
|
273
|
+
display: flex;
|
|
274
|
+
flex-direction: column;
|
|
275
|
+
row-gap: 16px;
|
|
276
|
+
border-bottom: 1px solid var(--wizard-line);
|
|
277
|
+
padding-bottom: 12px;
|
|
278
|
+
|
|
279
|
+
:deep(&__alert) {
|
|
280
|
+
padding: 10px 12px;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
</style>
|
|
@@ -18,6 +18,19 @@
|
|
|
18
18
|
v-model="formModelLocal.type_code"
|
|
19
19
|
/>
|
|
20
20
|
|
|
21
|
+
<common-wizards-datastore-add-steps-name-and-device
|
|
22
|
+
v-if="selectedStep.id === dynamicSteps.nameAndDevice"
|
|
23
|
+
v-model="form"
|
|
24
|
+
:project="props.project"
|
|
25
|
+
:alert-messages="alertMessages[selectedStep.id]"
|
|
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="emits('main-filter', $event)"
|
|
32
|
+
/>
|
|
33
|
+
|
|
21
34
|
<common-wizards-datastore-add-shared-storm
|
|
22
35
|
v-show="datastoreType === 'shared-storm'"
|
|
23
36
|
v-model="form"
|
|
@@ -4,7 +4,7 @@ import { UI_E_WIZARD_STATUS } from '~/components/atoms/wizard/lib/models/enums'
|
|
|
4
4
|
|
|
5
5
|
export const dynamicSteps = {
|
|
6
6
|
type: 0,
|
|
7
|
-
|
|
7
|
+
nameAndDevice: 1,
|
|
8
8
|
hostSummary: 2,
|
|
9
9
|
assignLicense: 3,
|
|
10
10
|
lockdownMode: 4,
|
|
@@ -39,7 +39,7 @@ export const stepsFunc = (
|
|
|
39
39
|
// testId: 'select-datastore-name',
|
|
40
40
|
// },
|
|
41
41
|
{
|
|
42
|
-
id:
|
|
42
|
+
id: dynamicSteps.nameAndDevice,
|
|
43
43
|
title: localization.common.nameAndDeviceSelection,
|
|
44
44
|
subTitle: localization.common.nameAndDeviceSelectionDesc,
|
|
45
45
|
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
@@ -141,8 +141,8 @@ export const stepsFunc = (
|
|
|
141
141
|
]
|
|
142
142
|
|
|
143
143
|
export const stepsSchemeInitial: number[][] = [
|
|
144
|
-
[dynamicSteps.type,
|
|
144
|
+
[dynamicSteps.type, dynamicSteps.nameAndDevice, 11], // Procurator Scheme for "shared-storm" type
|
|
145
145
|
[dynamicSteps.type, 4, 11], // Procurator Scheme for "nfs" type
|
|
146
|
-
[dynamicSteps.type,
|
|
146
|
+
[dynamicSteps.type, dynamicSteps.nameAndDevice, 11], // Sphere Scheme for "shared-storm" type
|
|
147
147
|
[dynamicSteps.type, 4, 5, 11], // Sphere Scheme for "nfs" type
|
|
148
148
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="tooltip-info">
|
|
3
3
|
<ui-icon
|
|
4
4
|
:id="`task-error-info-icon-${props.id}`"
|
|
5
5
|
name="info"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
32
|
<div class="common-widget-info-description">
|
|
33
|
-
{{ props.
|
|
33
|
+
{{ props.info }}
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
36
36
|
</ui-popup-window>
|
|
@@ -66,11 +66,7 @@ const isShowInfo = computed<boolean>({
|
|
|
66
66
|
</script>
|
|
67
67
|
|
|
68
68
|
<style lang="scss" scoped>
|
|
69
|
-
.
|
|
70
|
-
display: flex;
|
|
71
|
-
justify-content: space-between;
|
|
72
|
-
margin-left: 8px;
|
|
73
|
-
|
|
69
|
+
.tooltip-info {
|
|
74
70
|
.info-icon {
|
|
75
71
|
color: var(--form-icon-color);
|
|
76
72
|
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="device-selection-step">
|
|
3
|
+
<atoms-alert
|
|
4
|
+
v-show="props.alertMessages?.length"
|
|
5
|
+
:test-id="errorAlertDataId"
|
|
6
|
+
status="alert-danger"
|
|
7
|
+
:items="props.alertMessages"
|
|
8
|
+
@remove="onHideAlert"
|
|
9
|
+
/>
|
|
10
|
+
|
|
11
|
+
<div class="clr-form-control clr-row">
|
|
12
|
+
<label for="" class="clr-control-label clr-col-md-2">
|
|
13
|
+
{{ localization.common.name }}
|
|
14
|
+
</label>
|
|
15
|
+
|
|
16
|
+
<div class="clr-control-container" :class="nameErrorText && 'clr-error'">
|
|
17
|
+
<div class="flex-align-center">
|
|
18
|
+
<input
|
|
19
|
+
id="device-selection-input"
|
|
20
|
+
v-model="model.name"
|
|
21
|
+
data-id="device-selection-input"
|
|
22
|
+
type="text"
|
|
23
|
+
class="clr-input"
|
|
24
|
+
@blur="initValidation(true)"
|
|
25
|
+
@input="initValidation(false)"
|
|
26
|
+
/>
|
|
27
|
+
<atoms-the-icon class="error-icon" name="info-circle" />
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="clr-subtext" data-id="storm-datastore-name-field-require">
|
|
31
|
+
{{ nameErrorText }}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<atoms-alert
|
|
37
|
+
v-if="alertInfo"
|
|
38
|
+
test-id="device-selection-information-alert"
|
|
39
|
+
class="device-selection-step__alert-info"
|
|
40
|
+
status="alert-info"
|
|
41
|
+
:items="[localization.common.nameAndDeviceSelectionAlertInfo]"
|
|
42
|
+
@remove="onHideAlertInfo"
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<div
|
|
46
|
+
v-if="props.project === 'sphere' && !props.hostId"
|
|
47
|
+
class="clr-form-control clr-row"
|
|
48
|
+
>
|
|
49
|
+
<label class="clr-control-label clr-col-12 clr-col-md-2">
|
|
50
|
+
{{ localization.common.selectHost }}
|
|
51
|
+
</label>
|
|
52
|
+
|
|
53
|
+
<div>
|
|
54
|
+
<div class="clr-select-wrapper">
|
|
55
|
+
<select
|
|
56
|
+
id="device-host-select"
|
|
57
|
+
v-model="model.hosts"
|
|
58
|
+
data-id="device-host-select"
|
|
59
|
+
class="dropdown-toggle"
|
|
60
|
+
@change="onSelectHost"
|
|
61
|
+
>
|
|
62
|
+
<option
|
|
63
|
+
v-for="(item, index) in hostOptions"
|
|
64
|
+
:key="index"
|
|
65
|
+
:value="[item.value]"
|
|
66
|
+
:disabled="item.disabled"
|
|
67
|
+
>
|
|
68
|
+
{{ item.text }}
|
|
69
|
+
</option>
|
|
70
|
+
</select>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="clr-subtext">
|
|
73
|
+
{{ localization.common.selectHostToViewAccessible }}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div class="device-selection-step__disk-list">
|
|
79
|
+
<common-wizards-datastore-add-shared-storm-device-selection-table
|
|
80
|
+
v-model="model.lunDisk"
|
|
81
|
+
:data-table="dataTable?.items || []"
|
|
82
|
+
:total-items="dataTable?.total_items || 0"
|
|
83
|
+
:total-pages="dataTable?.total_pages || 1"
|
|
84
|
+
:pagination="pagination"
|
|
85
|
+
:loading="loading"
|
|
86
|
+
:is-main-filter="props.isMainFilter"
|
|
87
|
+
@pagination="updatePagination"
|
|
88
|
+
@sort="sortTable"
|
|
89
|
+
@main-filter="emits('main-filter', $event)"
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</template>
|
|
94
|
+
|
|
95
|
+
<script lang="ts" setup>
|
|
96
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
97
|
+
import type {
|
|
98
|
+
UI_I_Localization,
|
|
99
|
+
UI_I_ArbitraryObject,
|
|
100
|
+
} from '~/lib/models/interfaces'
|
|
101
|
+
import {
|
|
102
|
+
API_UI_I_DataTable,
|
|
103
|
+
UI_I_Pagination,
|
|
104
|
+
UI_I_DataTableQuery,
|
|
105
|
+
} from '~/lib/models/table/interfaces'
|
|
106
|
+
import type {
|
|
107
|
+
UI_I_CreateStorageLunDiskItem,
|
|
108
|
+
UI_I_LunDiskSpherePayload,
|
|
109
|
+
UI_I_SelectHostOptions,
|
|
110
|
+
} from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
|
|
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_DatastoreTypeCode } from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
114
|
+
import { hostsOptionsFunc } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/selectOptions'
|
|
115
|
+
import { validateNameAndGenerateDataId } from '~/components/common/wizards/datastore/add/lib/utils'
|
|
116
|
+
|
|
117
|
+
const props = defineProps<{
|
|
118
|
+
project: UI_T_Project
|
|
119
|
+
stepId: number
|
|
120
|
+
alertMessages: string[]
|
|
121
|
+
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
122
|
+
datastoreType: UI_T_DatastoreTypeCode
|
|
123
|
+
hosts?: UI_I_CreateDatastoreHosts | undefined
|
|
124
|
+
isMainFilter?: boolean
|
|
125
|
+
hostId?: string
|
|
126
|
+
}>()
|
|
127
|
+
const model = defineModel<any>()
|
|
128
|
+
const emits = defineEmits<{
|
|
129
|
+
(event: 'hide-alert', value: number): void
|
|
130
|
+
(event: 'main-filter', value: string): void
|
|
131
|
+
}>()
|
|
132
|
+
|
|
133
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
134
|
+
const { $store } = useNuxtApp()
|
|
135
|
+
|
|
136
|
+
const isInitDatastoreNameValidation = ref<boolean>(false)
|
|
137
|
+
const initValidation = (onlyBlur: boolean): void => {
|
|
138
|
+
onlyBlur && (isInitDatastoreNameValidation.value = true)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const nameErrorText = computed<string>(() => {
|
|
142
|
+
if (props.messagesFields?.datastoreName?.field && !model.value.name) {
|
|
143
|
+
return props.messagesFields.datastoreName.field
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (!isInitDatastoreNameValidation.value) return ''
|
|
147
|
+
return !model.value.name ? localization.value.common.specifyDatastoreName : ''
|
|
148
|
+
})
|
|
149
|
+
|
|
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
|
+
})
|
|
162
|
+
|
|
163
|
+
const alertInfo = ref<boolean>(true)
|
|
164
|
+
const onHideAlertInfo = (): void => {
|
|
165
|
+
alertInfo.value = false
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Lun disk table */
|
|
169
|
+
|
|
170
|
+
const pagination = ref<UI_I_Pagination>({
|
|
171
|
+
page: 1,
|
|
172
|
+
pageSize: 35,
|
|
173
|
+
})
|
|
174
|
+
const sort = ref<string | null>(null)
|
|
175
|
+
|
|
176
|
+
const updatePagination = (event: UI_I_Pagination): void => {
|
|
177
|
+
pagination.value = event
|
|
178
|
+
}
|
|
179
|
+
const sortTable = (event: string): void => {
|
|
180
|
+
sort.value = event
|
|
181
|
+
|
|
182
|
+
props.project === 'procurator'
|
|
183
|
+
? initLunDisksDataTable()
|
|
184
|
+
: initLunDisksForSphere(model.value.hosts[0])
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const loading = computed<boolean>(() =>
|
|
188
|
+
$store.getters['storage/getLoading']('datastoreHosts')
|
|
189
|
+
)
|
|
190
|
+
const dataTable = computed<API_UI_I_DataTable<
|
|
191
|
+
UI_I_CreateStorageLunDiskItem[]
|
|
192
|
+
> | null>(() => {
|
|
193
|
+
return $store.getters['storage/getNewDatastoreHosts']
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
/* Select host */
|
|
197
|
+
const hostOptions = computed<UI_I_SelectHostOptions[]>(() =>
|
|
198
|
+
hostsOptionsFunc(localization.value, props.hosts?.items)
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
const onSelectHost = (): void => {
|
|
202
|
+
if (props.datastoreType !== 'shared-storm') return // TODO рефакторинг ( удалить проверку )
|
|
203
|
+
|
|
204
|
+
initLunDisksForSphere(model.value.hosts[0])
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const initLunDisksForSphere = async (host: string): Promise<void> => {
|
|
208
|
+
await $store.dispatch('storage/A_GET_DISKS_LIST', {
|
|
209
|
+
host,
|
|
210
|
+
...pagination.value,
|
|
211
|
+
sortBy: sort.value,
|
|
212
|
+
} as UI_I_LunDiskSpherePayload)
|
|
213
|
+
}
|
|
214
|
+
if (props.hostId) {
|
|
215
|
+
initLunDisksForSphere(props.hostId)
|
|
216
|
+
}
|
|
217
|
+
const initLunDisksDataTable = async (): Promise<void> => {
|
|
218
|
+
await $store.dispatch('storage/A_GET_LUN_DISK_LIST', {
|
|
219
|
+
...pagination.value,
|
|
220
|
+
sortBy: sort.value,
|
|
221
|
+
} as UI_I_DataTableQuery)
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (props.project === 'procurator') {
|
|
225
|
+
// && props.stepId === 2
|
|
226
|
+
initLunDisksDataTable()
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const onHideAlert = (): void => {
|
|
230
|
+
emits('hide-alert', props.stepId)
|
|
231
|
+
}
|
|
232
|
+
</script>
|
|
233
|
+
|
|
234
|
+
<style lang="scss" scoped>
|
|
235
|
+
.device-selection-step {
|
|
236
|
+
display: flex;
|
|
237
|
+
flex-direction: column;
|
|
238
|
+
height: inherit;
|
|
239
|
+
overflow-y: auto;
|
|
240
|
+
overflow-x: hidden;
|
|
241
|
+
&__alert-info {
|
|
242
|
+
:deep(.alert-text) {
|
|
243
|
+
font-size: 11px;
|
|
244
|
+
letter-spacing: normal;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
.dropdown-toggle {
|
|
248
|
+
min-width: 160px;
|
|
249
|
+
}
|
|
250
|
+
.clr-form-control {
|
|
251
|
+
display: flex;
|
|
252
|
+
flex-direction: row;
|
|
253
|
+
|
|
254
|
+
.clr-control-container {
|
|
255
|
+
min-height: 48px;
|
|
256
|
+
&.clr-error {
|
|
257
|
+
.clr-subtext,
|
|
258
|
+
.error-icon {
|
|
259
|
+
display: block;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
.clr-subtext,
|
|
263
|
+
.error-icon {
|
|
264
|
+
display: none;
|
|
265
|
+
}
|
|
266
|
+
.error-icon {
|
|
267
|
+
fill: #db2100;
|
|
268
|
+
width: 24px;
|
|
269
|
+
height: 24px;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
&__disk-list {
|
|
274
|
+
display: flex;
|
|
275
|
+
flex-direction: column;
|
|
276
|
+
height: 100%;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
</style>
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="device-selection-step">
|
|
3
|
+
<atoms-alert
|
|
4
|
+
v-show="props.alertMessages?.length"
|
|
5
|
+
:test-id="errorAlertDataId"
|
|
6
|
+
status="alert-danger"
|
|
7
|
+
:items="props.alertMessages"
|
|
8
|
+
@remove="onHideAlert"
|
|
9
|
+
/>
|
|
10
|
+
|
|
11
|
+
<div class="clr-form-control clr-row">
|
|
12
|
+
<label for="" class="clr-control-label clr-col-md-2">
|
|
13
|
+
{{ localization.common.name }}
|
|
14
|
+
</label>
|
|
15
|
+
|
|
16
|
+
<div class="clr-control-container" :class="nameErrorText && 'clr-error'">
|
|
17
|
+
<div class="flex-align-center">
|
|
18
|
+
<input
|
|
19
|
+
id="device-selection-input"
|
|
20
|
+
v-model="model.name"
|
|
21
|
+
data-id="device-selection-input"
|
|
22
|
+
type="text"
|
|
23
|
+
class="clr-input"
|
|
24
|
+
@blur="initValidation(true)"
|
|
25
|
+
@input="initValidation(false)"
|
|
26
|
+
/>
|
|
27
|
+
<atoms-the-icon class="error-icon" name="info-circle" />
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="clr-subtext" data-id="storm-datastore-name-field-require">
|
|
31
|
+
{{ nameErrorText }}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<atoms-alert
|
|
37
|
+
v-if="alertInfo"
|
|
38
|
+
test-id="device-selection-information-alert"
|
|
39
|
+
class="device-selection-step__alert-info"
|
|
40
|
+
status="alert-info"
|
|
41
|
+
:items="[localization.common.nameAndDeviceSelectionAlertInfo]"
|
|
42
|
+
@remove="onHideAlertInfo"
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<div
|
|
46
|
+
v-if="props.project === 'sphere' && !props.hostId"
|
|
47
|
+
class="clr-form-control clr-row"
|
|
48
|
+
>
|
|
49
|
+
<label class="clr-control-label clr-col-12 clr-col-md-2">
|
|
50
|
+
{{ localization.common.selectHost }}
|
|
51
|
+
</label>
|
|
52
|
+
|
|
53
|
+
<div>
|
|
54
|
+
<div class="clr-select-wrapper">
|
|
55
|
+
<select
|
|
56
|
+
id="device-host-select"
|
|
57
|
+
v-model="model.hosts"
|
|
58
|
+
data-id="device-host-select"
|
|
59
|
+
class="dropdown-toggle"
|
|
60
|
+
@change="onSelectHost"
|
|
61
|
+
>
|
|
62
|
+
<option
|
|
63
|
+
v-for="(item, index) in hostOptions"
|
|
64
|
+
:key="index"
|
|
65
|
+
:value="[item.value]"
|
|
66
|
+
:disabled="item.disabled"
|
|
67
|
+
>
|
|
68
|
+
{{ item.text }}
|
|
69
|
+
</option>
|
|
70
|
+
</select>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="clr-subtext">
|
|
73
|
+
{{ localization.common.selectHostToViewAccessible }}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div class="device-selection-step__disk-list">
|
|
79
|
+
<common-wizards-datastore-add-shared-storm-device-selection-table
|
|
80
|
+
v-model="model.lunDisk"
|
|
81
|
+
:data-table="dataTable?.items || []"
|
|
82
|
+
:total-items="dataTable?.total_items || 0"
|
|
83
|
+
:total-pages="dataTable?.total_pages || 1"
|
|
84
|
+
:pagination="pagination"
|
|
85
|
+
:loading="loading"
|
|
86
|
+
:is-main-filter="props.isMainFilter"
|
|
87
|
+
@pagination="updatePagination"
|
|
88
|
+
@sort="sortTable"
|
|
89
|
+
@main-filter="emits('main-filter', $event)"
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</template>
|
|
94
|
+
|
|
95
|
+
<script lang="ts" setup>
|
|
96
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
97
|
+
import type {
|
|
98
|
+
UI_I_Localization,
|
|
99
|
+
UI_I_ArbitraryObject,
|
|
100
|
+
} from '~/lib/models/interfaces'
|
|
101
|
+
import {
|
|
102
|
+
API_UI_I_DataTable,
|
|
103
|
+
UI_I_Pagination,
|
|
104
|
+
UI_I_DataTableQuery,
|
|
105
|
+
} from '~/lib/models/table/interfaces'
|
|
106
|
+
import type {
|
|
107
|
+
UI_I_CreateStorageLunDiskItem,
|
|
108
|
+
UI_I_LunDiskSpherePayload,
|
|
109
|
+
UI_I_SelectHostOptions,
|
|
110
|
+
} from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
|
|
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_DatastoreTypeCode } from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
114
|
+
import { hostsOptionsFunc } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/selectOptions'
|
|
115
|
+
import { validateNameAndGenerateDataId } from '~/components/common/wizards/datastore/add/lib/utils'
|
|
116
|
+
|
|
117
|
+
const props = defineProps<{
|
|
118
|
+
project: UI_T_Project
|
|
119
|
+
stepId: number
|
|
120
|
+
alertMessages: string[]
|
|
121
|
+
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
122
|
+
datastoreType: UI_T_DatastoreTypeCode
|
|
123
|
+
hosts?: UI_I_CreateDatastoreHosts | undefined
|
|
124
|
+
isMainFilter?: boolean
|
|
125
|
+
hostId?: string
|
|
126
|
+
}>()
|
|
127
|
+
const model = defineModel<any>()
|
|
128
|
+
const emits = defineEmits<{
|
|
129
|
+
(event: 'hide-alert', value: number): void
|
|
130
|
+
(event: 'main-filter', value: string): void
|
|
131
|
+
}>()
|
|
132
|
+
|
|
133
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
134
|
+
const { $store } = useNuxtApp()
|
|
135
|
+
|
|
136
|
+
const isInitDatastoreNameValidation = ref<boolean>(false)
|
|
137
|
+
const initValidation = (onlyBlur: boolean): void => {
|
|
138
|
+
onlyBlur && (isInitDatastoreNameValidation.value = true)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const nameErrorText = computed<string>(() => {
|
|
142
|
+
if (props.messagesFields?.datastoreName?.field && !model.value.name) {
|
|
143
|
+
return props.messagesFields.datastoreName.field
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (!isInitDatastoreNameValidation.value) return ''
|
|
147
|
+
return !model.value.name ? localization.value.common.specifyDatastoreName : ''
|
|
148
|
+
})
|
|
149
|
+
|
|
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
|
+
})
|
|
162
|
+
|
|
163
|
+
const alertInfo = ref<boolean>(true)
|
|
164
|
+
const onHideAlertInfo = (): void => {
|
|
165
|
+
alertInfo.value = false
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Lun disk table */
|
|
169
|
+
|
|
170
|
+
const pagination = ref<UI_I_Pagination>({
|
|
171
|
+
page: 1,
|
|
172
|
+
pageSize: 35,
|
|
173
|
+
})
|
|
174
|
+
const sort = ref<string | null>(null)
|
|
175
|
+
|
|
176
|
+
const updatePagination = (event: UI_I_Pagination): void => {
|
|
177
|
+
pagination.value = event
|
|
178
|
+
}
|
|
179
|
+
const sortTable = (event: string): void => {
|
|
180
|
+
sort.value = event
|
|
181
|
+
|
|
182
|
+
props.project === 'procurator'
|
|
183
|
+
? initLunDisksDataTable()
|
|
184
|
+
: initLunDisksForSphere(model.value.hosts[0])
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const loading = computed<boolean>(() =>
|
|
188
|
+
$store.getters['storage/getLoading']('datastoreHosts')
|
|
189
|
+
)
|
|
190
|
+
const dataTable = computed<API_UI_I_DataTable<
|
|
191
|
+
UI_I_CreateStorageLunDiskItem[]
|
|
192
|
+
> | null>(() => {
|
|
193
|
+
return $store.getters['storage/getNewDatastoreHosts']
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
/* Select host */
|
|
197
|
+
const hostOptions = computed<UI_I_SelectHostOptions[]>(() =>
|
|
198
|
+
hostsOptionsFunc(localization.value, props.hosts?.items)
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
const onSelectHost = (): void => {
|
|
202
|
+
if (props.datastoreType !== 'shared-storm') return // TODO рефакторинг ( удалить проверку )
|
|
203
|
+
|
|
204
|
+
initLunDisksForSphere(model.value.hosts[0])
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const initLunDisksForSphere = async (host: string): Promise<void> => {
|
|
208
|
+
await $store.dispatch('storage/A_GET_DISKS_LIST', {
|
|
209
|
+
host,
|
|
210
|
+
...pagination.value,
|
|
211
|
+
sortBy: sort.value,
|
|
212
|
+
} as UI_I_LunDiskSpherePayload)
|
|
213
|
+
}
|
|
214
|
+
if (props.hostId) {
|
|
215
|
+
initLunDisksForSphere(props.hostId)
|
|
216
|
+
}
|
|
217
|
+
const initLunDisksDataTable = async (): Promise<void> => {
|
|
218
|
+
await $store.dispatch('storage/A_GET_LUN_DISK_LIST', {
|
|
219
|
+
...pagination.value,
|
|
220
|
+
sortBy: sort.value,
|
|
221
|
+
} as UI_I_DataTableQuery)
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (props.project === 'procurator') {
|
|
225
|
+
// && props.stepId === 2
|
|
226
|
+
initLunDisksDataTable()
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const onHideAlert = (): void => {
|
|
230
|
+
emits('hide-alert', props.stepId)
|
|
231
|
+
}
|
|
232
|
+
</script>
|
|
233
|
+
|
|
234
|
+
<style lang="scss" scoped>
|
|
235
|
+
.device-selection-step {
|
|
236
|
+
display: flex;
|
|
237
|
+
flex-direction: column;
|
|
238
|
+
height: inherit;
|
|
239
|
+
overflow-y: auto;
|
|
240
|
+
overflow-x: hidden;
|
|
241
|
+
&__alert-info {
|
|
242
|
+
:deep(.alert-text) {
|
|
243
|
+
font-size: 11px;
|
|
244
|
+
letter-spacing: normal;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
.dropdown-toggle {
|
|
248
|
+
min-width: 160px;
|
|
249
|
+
}
|
|
250
|
+
.clr-form-control {
|
|
251
|
+
display: flex;
|
|
252
|
+
flex-direction: row;
|
|
253
|
+
|
|
254
|
+
.clr-control-container {
|
|
255
|
+
min-height: 48px;
|
|
256
|
+
&.clr-error {
|
|
257
|
+
.clr-subtext,
|
|
258
|
+
.error-icon {
|
|
259
|
+
display: block;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
.clr-subtext,
|
|
263
|
+
.error-icon {
|
|
264
|
+
display: none;
|
|
265
|
+
}
|
|
266
|
+
.error-icon {
|
|
267
|
+
fill: #db2100;
|
|
268
|
+
width: 24px;
|
|
269
|
+
height: 24px;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
&__disk-list {
|
|
274
|
+
display: flex;
|
|
275
|
+
flex-direction: column;
|
|
276
|
+
height: 100%;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="name-and-device">
|
|
3
|
+
{{ props }}
|
|
4
|
+
{{ model }}
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts" setup>
|
|
9
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
10
|
+
import type {
|
|
11
|
+
// UI_I_Localization,
|
|
12
|
+
UI_I_ArbitraryObject,
|
|
13
|
+
} from '~/lib/models/interfaces'
|
|
14
|
+
import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
|
|
15
|
+
import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
|
|
16
|
+
import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
17
|
+
|
|
18
|
+
const props = defineProps<{
|
|
19
|
+
project: UI_T_Project
|
|
20
|
+
stepId: number
|
|
21
|
+
alertMessages: string[]
|
|
22
|
+
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
23
|
+
datastoreType: UI_T_DatastoreTypeCode
|
|
24
|
+
hosts?: UI_I_CreateDatastoreHosts | undefined
|
|
25
|
+
isMainFilter?: boolean
|
|
26
|
+
hostId?: string
|
|
27
|
+
}>()
|
|
28
|
+
const model = defineModel<any>()
|
|
29
|
+
const emits = defineEmits<{
|
|
30
|
+
(event: 'hide-alert', value: number): void
|
|
31
|
+
(event: 'main-filter', value: string): void
|
|
32
|
+
}>()
|
|
33
|
+
|
|
34
|
+
// const localization = computed<UI_I_Localization>(() => useLocal())
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style lang="scss" scoped></style>
|
package/components/common/wizards/datastore/add/steps/nameAndDevice/lib/config/selectOptions.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
4
|
+
const constructHostListFunc = (
|
|
5
|
+
data: { host: string; id: string }[]
|
|
6
|
+
): UI_I_SelectHostOptions[] => {
|
|
7
|
+
return data.map((item) => ({
|
|
8
|
+
text: item.host,
|
|
9
|
+
value: item.id,
|
|
10
|
+
disabled: false,
|
|
11
|
+
}))
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const hostsOptionsFunc = (
|
|
15
|
+
localization: UI_I_Localization,
|
|
16
|
+
hosts: { host: string; id: string }[] | undefined
|
|
17
|
+
): UI_I_SelectHostOptions[] => {
|
|
18
|
+
if (!hosts) return []
|
|
19
|
+
|
|
20
|
+
const data = constructHostListFunc(hosts)
|
|
21
|
+
|
|
22
|
+
return [{ text: localization.common.selectHost, value: '', disabled: true }, ...data]
|
|
23
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UI_I_DataTableQuery } from '~/lib/models/table/interfaces'
|
|
2
|
+
|
|
3
|
+
export interface UI_I_LunDiskSpherePayload extends UI_I_DataTableQuery {
|
|
4
|
+
host: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface UI_I_LunDisk {
|
|
8
|
+
name: string
|
|
9
|
+
capacity: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface UI_I_SelectHostOptions {
|
|
13
|
+
text: string
|
|
14
|
+
value: string
|
|
15
|
+
disabled?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface UI_I_CreateStorageLunDiskItem {
|
|
19
|
+
name: string
|
|
20
|
+
identifier: string
|
|
21
|
+
lun: number
|
|
22
|
+
capacity_mb: string
|
|
23
|
+
hardware_acceleration: string
|
|
24
|
+
drive_type: string
|
|
25
|
+
sector_format: string
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type T_DatastoreTableItemsTuple = ['name', 'type_ds', 'description']
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="data-table-view">
|
|
3
|
+
<atoms-table-data-grid
|
|
4
|
+
v-model:selected-row="selectedLunDiskLocal"
|
|
5
|
+
v-model:column-keys="columnKeys"
|
|
6
|
+
v-model:page-size="pagination.pageSize"
|
|
7
|
+
v-model:page="pagination.page"
|
|
8
|
+
type="checkbox"
|
|
9
|
+
class="data-table"
|
|
10
|
+
test-id="device-selection-lun-disk-table"
|
|
11
|
+
:head-items="headItems"
|
|
12
|
+
:body-items="bodyItems"
|
|
13
|
+
:total-items="props.totalItems"
|
|
14
|
+
:total-pages="props.totalPages"
|
|
15
|
+
:loading="loading"
|
|
16
|
+
:is-main-filter="props.isMainFilter"
|
|
17
|
+
:main-filter-placeholder="localization.filter"
|
|
18
|
+
hide-page-size
|
|
19
|
+
@main-filter="onMainFiltering"
|
|
20
|
+
@sorting="sorting"
|
|
21
|
+
>
|
|
22
|
+
<template #icon="{ item }">
|
|
23
|
+
<span :class="['datagrid-cell-icon', item.data.iconClassName]" />
|
|
24
|
+
<span class="text-ellipsis">
|
|
25
|
+
{{ item.text }}
|
|
26
|
+
</span>
|
|
27
|
+
</template>
|
|
28
|
+
</atoms-table-data-grid>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
import { useDebounceFn } from '@vueuse/core'
|
|
34
|
+
import type {
|
|
35
|
+
UI_I_HeadItem,
|
|
36
|
+
UI_I_ColumnKey,
|
|
37
|
+
UI_I_BodyItem,
|
|
38
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
39
|
+
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
40
|
+
import { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
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
|
+
|
|
44
|
+
const props = defineProps<{
|
|
45
|
+
dataTable: UI_I_CreateStorageLunDiskItem[]
|
|
46
|
+
loading: boolean
|
|
47
|
+
totalItems: number
|
|
48
|
+
totalPages: number
|
|
49
|
+
pagination: UI_I_Pagination
|
|
50
|
+
isMainFilter?: boolean
|
|
51
|
+
}>()
|
|
52
|
+
const modelLunDisk = defineModel<UI_I_CreateStorageLunDiskItem[]>()
|
|
53
|
+
const emits = defineEmits<{
|
|
54
|
+
(event: 'pagination', value: UI_I_Pagination): void
|
|
55
|
+
(event: 'sort', value: string): void
|
|
56
|
+
(event: 'main-filter', value: string): void
|
|
57
|
+
}>()
|
|
58
|
+
|
|
59
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
60
|
+
|
|
61
|
+
const sorting = (e: [number, boolean]): void => {
|
|
62
|
+
const [column, status] = e
|
|
63
|
+
const direction = status ? 'desc' : 'asc'
|
|
64
|
+
|
|
65
|
+
const sort = `${column}.${direction}`
|
|
66
|
+
|
|
67
|
+
emits('sort', sort)
|
|
68
|
+
}
|
|
69
|
+
const sendFilter = useDebounceFn((searchText: string) => {
|
|
70
|
+
emits('main-filter', searchText)
|
|
71
|
+
}, 1000)
|
|
72
|
+
const onMainFiltering = (data: string): void => {
|
|
73
|
+
sendFilter(data)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const pagination = ref<UI_I_Pagination>({
|
|
77
|
+
page: 1,
|
|
78
|
+
pageSize: 1,
|
|
79
|
+
})
|
|
80
|
+
watch(
|
|
81
|
+
() => props.pagination,
|
|
82
|
+
(newValue) => {
|
|
83
|
+
pagination.value = newValue
|
|
84
|
+
},
|
|
85
|
+
{ immediate: true }
|
|
86
|
+
)
|
|
87
|
+
watch(
|
|
88
|
+
pagination,
|
|
89
|
+
(newValue) => {
|
|
90
|
+
emits('pagination', newValue)
|
|
91
|
+
},
|
|
92
|
+
{ deep: true, immediate: true }
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
const columnKeys = ref<UI_I_ColumnKey[]>(
|
|
96
|
+
lunDiskTable.columnKeys(localization.value)
|
|
97
|
+
)
|
|
98
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
99
|
+
lunDiskTable.headItems(localization.value)
|
|
100
|
+
)
|
|
101
|
+
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
102
|
+
let result: UI_I_BodyItem[][] = []
|
|
103
|
+
if (props.dataTable?.length) {
|
|
104
|
+
result = lunDiskTable.bodyItems(props.dataTable)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return result
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const selectedLunDiskLocal = ref<number[]>([])
|
|
111
|
+
watch(
|
|
112
|
+
selectedLunDiskLocal,
|
|
113
|
+
(newValue: number[]) => {
|
|
114
|
+
modelLunDisk.value = props.dataTable.filter((_: never, key: number) =>
|
|
115
|
+
newValue.includes(key)
|
|
116
|
+
)
|
|
117
|
+
},
|
|
118
|
+
{ deep: true, immediate: true }
|
|
119
|
+
)
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<style lang="scss" scoped>
|
|
123
|
+
.data-table-view {
|
|
124
|
+
height: inherit;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
.data-table {
|
|
127
|
+
height: inherit;
|
|
128
|
+
:deep(.datagrid-outer-wrapper) {
|
|
129
|
+
height: 400px;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
</style>
|
package/components/common/wizards/datastore/add/steps/nameAndDevice/table/lib/config/lunDiskTable.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_HeadItem,
|
|
3
|
+
UI_I_ColumnKey,
|
|
4
|
+
UI_I_BodyItem,
|
|
5
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
6
|
+
import * as defaultSettings from '~/components/atoms/table/dataGrid/lib/config/settingsTable'
|
|
7
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
8
|
+
import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
|
|
9
|
+
import { lunDiskTableItemsKeys } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/table/lib/config/tableKeys'
|
|
10
|
+
|
|
11
|
+
const getItems = (
|
|
12
|
+
localization: UI_I_Localization
|
|
13
|
+
): [string, boolean, string, string][] => {
|
|
14
|
+
return [
|
|
15
|
+
[localization.common.name, true, '180px', lunDiskTableItemsKeys[0]],
|
|
16
|
+
[localization.common.identifier, false, '96px', lunDiskTableItemsKeys[1]],
|
|
17
|
+
[localization.common.lun, true, '96px', lunDiskTableItemsKeys[2]],
|
|
18
|
+
[localization.common.capacity, true, '96px', lunDiskTableItemsKeys[3]],
|
|
19
|
+
[
|
|
20
|
+
localization.common.hardwareAcceleration,
|
|
21
|
+
true,
|
|
22
|
+
'96px',
|
|
23
|
+
lunDiskTableItemsKeys[4],
|
|
24
|
+
],
|
|
25
|
+
[localization.common.driveType, true, '96px', lunDiskTableItemsKeys[5]],
|
|
26
|
+
[localization.common.sectorFormat, true, '96px', lunDiskTableItemsKeys[6]],
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const columnKeys = (
|
|
31
|
+
localization: UI_I_Localization
|
|
32
|
+
): UI_I_ColumnKey[] => {
|
|
33
|
+
return defaultSettings.defaultColumnKeys(getItems(localization))
|
|
34
|
+
}
|
|
35
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
36
|
+
return defaultSettings.defaultHeadItems(getItems(localization))
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const bodyItems = (
|
|
40
|
+
data: UI_I_CreateStorageLunDiskItem[]
|
|
41
|
+
): UI_I_BodyItem[][] => {
|
|
42
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
43
|
+
const { $binary } = useNuxtApp() as any
|
|
44
|
+
data.forEach((lanDisk: UI_I_CreateStorageLunDiskItem, key) => {
|
|
45
|
+
bodyItems.push([
|
|
46
|
+
{
|
|
47
|
+
key: 'col0',
|
|
48
|
+
text: lanDisk[lunDiskTableItemsKeys[0]],
|
|
49
|
+
id: key,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: 'col1',
|
|
53
|
+
text: lanDisk[lunDiskTableItemsKeys[1]],
|
|
54
|
+
id: key,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: 'col2',
|
|
58
|
+
text: lanDisk[lunDiskTableItemsKeys[2]],
|
|
59
|
+
id: key,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: 'col3',
|
|
63
|
+
text: $binary.round(lanDisk[lunDiskTableItemsKeys[3]]),
|
|
64
|
+
id: key,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: 'col4',
|
|
68
|
+
text: lanDisk[lunDiskTableItemsKeys[4]],
|
|
69
|
+
id: key,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
key: 'col5',
|
|
73
|
+
text: lanDisk[lunDiskTableItemsKeys[5]],
|
|
74
|
+
id: key,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: 'col6',
|
|
78
|
+
text: lanDisk[lunDiskTableItemsKeys[6]],
|
|
79
|
+
id: key,
|
|
80
|
+
},
|
|
81
|
+
])
|
|
82
|
+
})
|
|
83
|
+
return bodyItems
|
|
84
|
+
}
|
package/components/common/wizards/datastore/add/steps/nameAndDevice/table/lib/config/tableKeys.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UI_T_LunDiskTableItemTuple } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/table/lib/models/types'
|
|
2
|
+
|
|
3
|
+
export const lunDiskTableItemsKeys: UI_T_LunDiskTableItemTuple = [
|
|
4
|
+
'name',
|
|
5
|
+
'identifier',
|
|
6
|
+
'lun',
|
|
7
|
+
'capacity_mb',
|
|
8
|
+
'hardware_acceleration',
|
|
9
|
+
'drive_type',
|
|
10
|
+
'sector_format',
|
|
11
|
+
]
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|