bfg-common 1.5.66 → 1.5.67
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/Add.vue +32 -65
- package/components/common/wizards/datastore/add/New.vue +273 -0
- package/components/common/wizards/datastore/add/Old.vue +160 -0
- package/components/common/wizards/datastore/add/steps/readyComplete/ReadyComplete.vue +29 -0
- package/components/common/wizards/datastore/add/steps/readyComplete/ReadyCompleteNew.vue +92 -0
- package/components/common/wizards/datastore/add/steps/readyComplete/ReadyCompleteOld.vue +15 -0
- package/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails.ts +142 -0
- package/package.json +1 -1
|
@@ -1,68 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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-add-shared-storm
|
|
35
|
-
v-show="datastoreType === 'shared-storm'"
|
|
36
|
-
v-model="form"
|
|
37
|
-
:project="props.project"
|
|
38
|
-
:step-id="selectedStep.id"
|
|
39
|
-
:datastore-type="datastoreType"
|
|
40
|
-
:alert-messages="alertMessages[selectedStep.id]"
|
|
41
|
-
:messages-fields="selectedStep.fields"
|
|
42
|
-
:hosts="props.nfsHosts"
|
|
43
|
-
:is-main-filter="props.isMainFilter"
|
|
44
|
-
:host-id="props.hostId"
|
|
45
|
-
@hide-alert="onHideAlert"
|
|
46
|
-
@main-filter="emits('main-filter', $event)"
|
|
47
|
-
/>
|
|
48
|
-
|
|
49
|
-
<common-wizards-datastore-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-add-ready-complete
|
|
60
|
-
v-show="selectedStep.id === 11"
|
|
61
|
-
:data-ready-view="dataReadyView"
|
|
62
|
-
/>
|
|
63
|
-
</template>
|
|
64
|
-
</atoms-wizard>
|
|
65
|
-
</div>
|
|
2
|
+
<common-wizards-datastore-add-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
v-model="form"
|
|
5
|
+
:wizard="wizard"
|
|
6
|
+
:alert-messages="alertMessages"
|
|
7
|
+
:selected-scheme="selectedScheme"
|
|
8
|
+
:selected-node="props.selectedNode"
|
|
9
|
+
:title="title"
|
|
10
|
+
@change-steps="onChangeSteps"
|
|
11
|
+
@hide="onHideModal"
|
|
12
|
+
@submit="onCreateDatastore"
|
|
13
|
+
/>
|
|
14
|
+
<common-wizards-datastore-add-old
|
|
15
|
+
v-else
|
|
16
|
+
v-model="form"
|
|
17
|
+
:wizard="wizard"
|
|
18
|
+
:alert-messages="alertMessages"
|
|
19
|
+
:selected-scheme="selectedScheme"
|
|
20
|
+
:selected-node="props.selectedNode"
|
|
21
|
+
:title="title"
|
|
22
|
+
@change-steps="onChangeSteps"
|
|
23
|
+
@hide-alert="onHideAlert"
|
|
24
|
+
@hide="onHideModal"
|
|
25
|
+
@submit="onCreateDatastore"
|
|
26
|
+
/>
|
|
66
27
|
</template>
|
|
67
28
|
|
|
68
29
|
<script setup lang="ts">
|
|
@@ -100,6 +61,7 @@ const emits = defineEmits<{
|
|
|
100
61
|
}>()
|
|
101
62
|
|
|
102
63
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
64
|
+
const { $store }: any = useNuxtApp()
|
|
103
65
|
|
|
104
66
|
const wizard: Wizard = new Wizard(
|
|
105
67
|
stepsFunc(localization.value),
|
|
@@ -109,6 +71,10 @@ const wizard: Wizard = new Wizard(
|
|
|
109
71
|
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
|
110
72
|
const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
|
|
111
73
|
|
|
74
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
75
|
+
|
|
76
|
+
const title = computed<string>(() => localization.value.common.addHost)
|
|
77
|
+
|
|
112
78
|
// const datastoreType = ref<UI_T_DatastoreType>(
|
|
113
79
|
// props.project === 'procurator' ? 'local' : 'shared-storm'
|
|
114
80
|
// )
|
|
@@ -263,6 +229,7 @@ const dataReadyView = computed<UI_I_DetailsItem>(() =>
|
|
|
263
229
|
props.nfsHosts
|
|
264
230
|
)
|
|
265
231
|
)
|
|
232
|
+
console.log(dataReadyView)
|
|
266
233
|
|
|
267
234
|
const onHideAlert = (stepId: number): void => {
|
|
268
235
|
wizard.hideAlertMessagesByStepId(stepId)
|
|
@@ -270,7 +237,7 @@ const onHideAlert = (stepId: number): void => {
|
|
|
270
237
|
const onHideModal = (): void => {
|
|
271
238
|
emits('hide')
|
|
272
239
|
}
|
|
273
|
-
const
|
|
240
|
+
const onCreateDatastore = (): void => {
|
|
274
241
|
emits('finish', form.value)
|
|
275
242
|
}
|
|
276
243
|
// watch(
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-wizard
|
|
3
|
+
show
|
|
4
|
+
:steps="props.wizard.steps"
|
|
5
|
+
:selected-scheme="props.selectedScheme"
|
|
6
|
+
:is-loading="props.wizard.wizardLoader.status"
|
|
7
|
+
:title="props.title"
|
|
8
|
+
:texts="texts"
|
|
9
|
+
test-id="add-datastore-wizard"
|
|
10
|
+
@change-steps="onChangeSteps"
|
|
11
|
+
@hide="onHideModal"
|
|
12
|
+
@submit="onFinish"
|
|
13
|
+
>
|
|
14
|
+
<template #content="{ selectedStep, isLoading }">
|
|
15
|
+
<ui-wizard-block
|
|
16
|
+
v-if="selectedStep.id === dynamicSteps.nameAndLocation"
|
|
17
|
+
:sub-title-height="height0"
|
|
18
|
+
>
|
|
19
|
+
<template #subTitle>
|
|
20
|
+
<div ref="subTitleBlock0">
|
|
21
|
+
<div class="subtitle-block">
|
|
22
|
+
<ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
<template #content>
|
|
27
|
+
<common-wizards-datastore-add-types
|
|
28
|
+
v-if="selectedStep.id === 0"
|
|
29
|
+
v-model="form"
|
|
30
|
+
v-model:datastore-type="datastoreType"
|
|
31
|
+
:project="props.project"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
34
|
+
</ui-wizard-block>
|
|
35
|
+
|
|
36
|
+
<ui-wizard-block
|
|
37
|
+
v-if="selectedStep.id === dynamicSteps.connectionSettings"
|
|
38
|
+
:sub-title-height="height1"
|
|
39
|
+
>
|
|
40
|
+
<template #subTitle>
|
|
41
|
+
<div ref="subTitleBlock1">
|
|
42
|
+
<div class="subtitle-block">
|
|
43
|
+
<ui-alert
|
|
44
|
+
v-if="
|
|
45
|
+
props.alertMessages[dynamicSteps.connectionSettings].length
|
|
46
|
+
"
|
|
47
|
+
test-id="add-host-connection-settings-error-alert"
|
|
48
|
+
type="error"
|
|
49
|
+
size="md"
|
|
50
|
+
:messages="props.alertMessages[dynamicSteps.connectionSettings]"
|
|
51
|
+
class="subtitle-block__alert"
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
<ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
<template #content>
|
|
59
|
+
<common-wizards-datastore-add-local
|
|
60
|
+
v-if="selectedStep.id === 1"
|
|
61
|
+
v-model="form"
|
|
62
|
+
:project="props.project"
|
|
63
|
+
:step-id="selectedStep.id"
|
|
64
|
+
:datastore-type="datastoreType"
|
|
65
|
+
:alert-messages="alertMessages[1]"
|
|
66
|
+
:messages-fields="selectedStep.fields"
|
|
67
|
+
@hide-alert="onHideAlert"
|
|
68
|
+
/>
|
|
69
|
+
</template>
|
|
70
|
+
</ui-wizard-block>
|
|
71
|
+
|
|
72
|
+
<ui-wizard-block
|
|
73
|
+
v-if="selectedStep.id === dynamicSteps.hostSummary"
|
|
74
|
+
:sub-title-height="height2"
|
|
75
|
+
>
|
|
76
|
+
<template #subTitle>
|
|
77
|
+
<div ref="subTitleBlock2">
|
|
78
|
+
<div class="subtitle-block">
|
|
79
|
+
<ui-alert
|
|
80
|
+
v-if="hostAssociated"
|
|
81
|
+
test-id="add-host-connection-settings-error-alert"
|
|
82
|
+
type="error"
|
|
83
|
+
size="md"
|
|
84
|
+
:messages="[
|
|
85
|
+
localization.common.errorProcuratorHostAlreadyConnectedSphere,
|
|
86
|
+
]"
|
|
87
|
+
class="subtitle-block__alert"
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</template>
|
|
94
|
+
<template #content>
|
|
95
|
+
<common-wizards-datastore-add-shared-storm
|
|
96
|
+
v-show="datastoreType === 'shared-storm'"
|
|
97
|
+
v-model="form"
|
|
98
|
+
:project="props.project"
|
|
99
|
+
:step-id="selectedStep.id"
|
|
100
|
+
:datastore-type="datastoreType"
|
|
101
|
+
:alert-messages="alertMessages[selectedStep.id]"
|
|
102
|
+
:messages-fields="selectedStep.fields"
|
|
103
|
+
:hosts="props.nfsHosts"
|
|
104
|
+
:is-main-filter="props.isMainFilter"
|
|
105
|
+
:host-id="props.hostId"
|
|
106
|
+
@hide-alert="onHideAlert"
|
|
107
|
+
@main-filter="emits('main-filter', $event)"
|
|
108
|
+
/>
|
|
109
|
+
</template>
|
|
110
|
+
</ui-wizard-block>
|
|
111
|
+
|
|
112
|
+
<ui-wizard-block
|
|
113
|
+
v-if="selectedStep.id === dynamicSteps.assignLicense"
|
|
114
|
+
:sub-title-height="height3"
|
|
115
|
+
>
|
|
116
|
+
<template #subTitle>
|
|
117
|
+
<div ref="subTitleBlock3">
|
|
118
|
+
<div class="subtitle-block">
|
|
119
|
+
<ui-alert
|
|
120
|
+
v-if="props.alertMessages[dynamicSteps.assignLicense].length"
|
|
121
|
+
test-id="add-host-assign-license-error-alert"
|
|
122
|
+
type="error"
|
|
123
|
+
size="md"
|
|
124
|
+
:messages="props.alertMessages[dynamicSteps.assignLicense]"
|
|
125
|
+
class="subtitle-block__alert"
|
|
126
|
+
/>
|
|
127
|
+
|
|
128
|
+
<ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</template>
|
|
132
|
+
<template #content>
|
|
133
|
+
<common-wizards-datastore-add-nfs
|
|
134
|
+
v-show="datastoreType === 'nfs'"
|
|
135
|
+
v-model="form"
|
|
136
|
+
:project="props.project"
|
|
137
|
+
:step-id="selectedStep.id"
|
|
138
|
+
:alert-messages="alertMessages[selectedStep.id]"
|
|
139
|
+
:messages-fields="selectedStep.fields"
|
|
140
|
+
:hosts="props.nfsHosts"
|
|
141
|
+
/>
|
|
142
|
+
</template>
|
|
143
|
+
</ui-wizard-block>
|
|
144
|
+
|
|
145
|
+
<ui-wizard-block
|
|
146
|
+
v-if="selectedStep.id === dynamicSteps.lockdownMode"
|
|
147
|
+
:sub-title-height="height4"
|
|
148
|
+
>
|
|
149
|
+
<template #subTitle>
|
|
150
|
+
<div ref="subTitleBlock4">
|
|
151
|
+
<div class="subtitle-block">
|
|
152
|
+
<ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
|
|
153
|
+
<ui-wizard-subtitle
|
|
154
|
+
:sub-title="localization.common.whenEnabledLockdown"
|
|
155
|
+
/>
|
|
156
|
+
<ui-wizard-subtitle
|
|
157
|
+
:sub-title="localization.common.leaveLockdownDefault"
|
|
158
|
+
/>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
</template>
|
|
162
|
+
<template #content>
|
|
163
|
+
<common-wizards-datastore-add-ready-complete
|
|
164
|
+
v-show="selectedStep.id === 11"
|
|
165
|
+
:data-ready-view="dataReadyView"
|
|
166
|
+
/>
|
|
167
|
+
</template>
|
|
168
|
+
</ui-wizard-block>
|
|
169
|
+
</template>
|
|
170
|
+
</ui-wizard>
|
|
171
|
+
</template>
|
|
172
|
+
|
|
173
|
+
<script setup lang="ts">
|
|
174
|
+
import { useElementSize } from '@vueuse/core'
|
|
175
|
+
import type {
|
|
176
|
+
UI_I_WizardStep,
|
|
177
|
+
UI_I_WizardTexts,
|
|
178
|
+
} from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
179
|
+
import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
|
180
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
181
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
182
|
+
import type { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
183
|
+
import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
184
|
+
import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
|
|
185
|
+
import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
|
|
186
|
+
import { E_DatastoreTypeKode } from '~/components/common/wizards/datastore/add/lib/models/enums'
|
|
187
|
+
import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
|
|
188
|
+
|
|
189
|
+
const props = defineProps<{
|
|
190
|
+
project: UI_T_Project
|
|
191
|
+
wizard: Wizard
|
|
192
|
+
selectedScheme: number[]
|
|
193
|
+
alertMessages: string[][]
|
|
194
|
+
title: string
|
|
195
|
+
nfsHosts?: UI_I_CreateDatastoreHosts
|
|
196
|
+
hostId?: string
|
|
197
|
+
isMainFilter?: boolean
|
|
198
|
+
}>()
|
|
199
|
+
const emits = defineEmits<{
|
|
200
|
+
(event: 'change-steps', value: UI_I_WizardStep[]): void
|
|
201
|
+
(event: 'hide-alert', value: number): void
|
|
202
|
+
(event: 'hide'): void
|
|
203
|
+
(event: 'finish', value: any): void
|
|
204
|
+
(event: 'main-filter', value: string): void
|
|
205
|
+
}>()
|
|
206
|
+
|
|
207
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
208
|
+
|
|
209
|
+
const texts = computed<UI_I_WizardTexts>(() => ({
|
|
210
|
+
cancel: localization.value.common.cancel,
|
|
211
|
+
back: localization.value.common.backCap,
|
|
212
|
+
processing: localization.value.common.processing,
|
|
213
|
+
next: localization.value.common.next,
|
|
214
|
+
finish: localization.value.common.add,
|
|
215
|
+
incompleteTitle: localization.value.common.incompleteProcess,
|
|
216
|
+
incompleteMessage: localization.value.common.incompleteProcessMessage,
|
|
217
|
+
incompleteCancel: localization.value.common.cancel,
|
|
218
|
+
incompleteLeave: localization.value.common.leave,
|
|
219
|
+
}))
|
|
220
|
+
|
|
221
|
+
const subTitleBlock0 = ref<HTMLElement | null>(null)
|
|
222
|
+
const { height: height0 } = useElementSize(subTitleBlock0)
|
|
223
|
+
|
|
224
|
+
const subTitleBlock1 = ref<HTMLElement | null>(null)
|
|
225
|
+
const { height: height1 } = useElementSize(subTitleBlock1)
|
|
226
|
+
|
|
227
|
+
const subTitleBlock2 = ref<HTMLElement | null>(null)
|
|
228
|
+
const { height: height2 } = useElementSize(subTitleBlock2)
|
|
229
|
+
|
|
230
|
+
const subTitleBlock3 = ref<HTMLElement | null>(null)
|
|
231
|
+
const { height: height3 } = useElementSize(subTitleBlock3)
|
|
232
|
+
|
|
233
|
+
const subTitleBlock4 = ref<HTMLElement | null>(null)
|
|
234
|
+
const { height: height4 } = useElementSize(subTitleBlock4)
|
|
235
|
+
|
|
236
|
+
// const datastoreType = ref<UI_T_DatastoreType>(
|
|
237
|
+
// props.project === 'procurator' ? 'local' : 'shared-storm'
|
|
238
|
+
// )
|
|
239
|
+
const datastoreType = ref<UI_T_DatastoreType>('shared-storm')
|
|
240
|
+
const form = ref<UI_I_CreateDatastoreForm>({
|
|
241
|
+
name: 'Datastore',
|
|
242
|
+
lunDisk: [],
|
|
243
|
+
hosts: props.hostId ? [props?.hostId] : [],
|
|
244
|
+
type_code: E_DatastoreTypeKode[datastoreType.value],
|
|
245
|
+
nfsVersion: 'nfs-4.1',
|
|
246
|
+
readonly: false,
|
|
247
|
+
server: '',
|
|
248
|
+
folder: '',
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
|
|
252
|
+
emits('change-steps', value)
|
|
253
|
+
|
|
254
|
+
const dataReadyView = computed<UI_I_DetailsItem>(() =>
|
|
255
|
+
constructDataReadyViewFunc(
|
|
256
|
+
localization.value,
|
|
257
|
+
form.value,
|
|
258
|
+
props.project,
|
|
259
|
+
props.nfsHosts
|
|
260
|
+
)
|
|
261
|
+
)
|
|
262
|
+
const onHideAlert = (stepId: number): void => {
|
|
263
|
+
emits('hide-alert', stepId)
|
|
264
|
+
}
|
|
265
|
+
const onHideModal = (): void => {
|
|
266
|
+
emits('hide')
|
|
267
|
+
}
|
|
268
|
+
const onFinish = (): void => {
|
|
269
|
+
emits('finish', form.value)
|
|
270
|
+
}
|
|
271
|
+
</script>
|
|
272
|
+
|
|
273
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="new-datastore">
|
|
3
|
+
<atoms-wizard
|
|
4
|
+
show
|
|
5
|
+
:wizard="props.wizard"
|
|
6
|
+
:selected-scheme="props.selectedScheme"
|
|
7
|
+
:title="props.title"
|
|
8
|
+
:localization="localization"
|
|
9
|
+
class="add-datastore"
|
|
10
|
+
test-id="add-datastore-wizard"
|
|
11
|
+
@change-steps="onChangeSteps"
|
|
12
|
+
@hide="onHideModal"
|
|
13
|
+
@submit="onFinish"
|
|
14
|
+
>
|
|
15
|
+
<template #modalBody="{ selectedStep }">
|
|
16
|
+
<common-wizards-datastore-add-types
|
|
17
|
+
v-if="selectedStep.id === 0"
|
|
18
|
+
v-model="form"
|
|
19
|
+
v-model:datastore-type="datastoreType"
|
|
20
|
+
:project="props.project"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<common-wizards-datastore-add-local
|
|
24
|
+
v-if="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-add-shared-storm
|
|
35
|
+
v-show="datastoreType === 'shared-storm'"
|
|
36
|
+
v-model="form"
|
|
37
|
+
:project="props.project"
|
|
38
|
+
:step-id="selectedStep.id"
|
|
39
|
+
:datastore-type="datastoreType"
|
|
40
|
+
:alert-messages="alertMessages[selectedStep.id]"
|
|
41
|
+
:messages-fields="selectedStep.fields"
|
|
42
|
+
:hosts="props.nfsHosts"
|
|
43
|
+
:is-main-filter="props.isMainFilter"
|
|
44
|
+
:host-id="props.hostId"
|
|
45
|
+
@hide-alert="onHideAlert"
|
|
46
|
+
@main-filter="emits('main-filter', $event)"
|
|
47
|
+
/>
|
|
48
|
+
|
|
49
|
+
<common-wizards-datastore-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-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 { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
|
|
70
|
+
import type Wizard from '~/components/atoms/wizard/lib/utils/utils'
|
|
71
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
72
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
73
|
+
import type { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
74
|
+
import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
75
|
+
import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
|
|
76
|
+
import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
|
|
77
|
+
import { E_DatastoreTypeKode } from '~/components/common/wizards/datastore/add/lib/models/enums'
|
|
78
|
+
import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
|
|
79
|
+
|
|
80
|
+
const props = defineProps<{
|
|
81
|
+
project: UI_T_Project
|
|
82
|
+
wizard: Wizard
|
|
83
|
+
selectedScheme: number[]
|
|
84
|
+
alertMessages: string[][]
|
|
85
|
+
title: string
|
|
86
|
+
nfsHosts?: UI_I_CreateDatastoreHosts
|
|
87
|
+
hostId?: string
|
|
88
|
+
isMainFilter?: boolean
|
|
89
|
+
}>()
|
|
90
|
+
const emits = defineEmits<{
|
|
91
|
+
(event: 'change-steps', value: UI_I_WizardStep[]): void
|
|
92
|
+
(event: 'hide-alert', value: number): void
|
|
93
|
+
(event: 'hide'): void
|
|
94
|
+
(event: 'finish', value: any): void
|
|
95
|
+
(event: 'main-filter', value: string): void
|
|
96
|
+
}>()
|
|
97
|
+
|
|
98
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
99
|
+
|
|
100
|
+
// const datastoreType = ref<UI_T_DatastoreType>(
|
|
101
|
+
// props.project === 'procurator' ? 'local' : 'shared-storm'
|
|
102
|
+
// )
|
|
103
|
+
const datastoreType = ref<UI_T_DatastoreType>('shared-storm')
|
|
104
|
+
const form = ref<UI_I_CreateDatastoreForm>({
|
|
105
|
+
name: 'Datastore',
|
|
106
|
+
lunDisk: [],
|
|
107
|
+
hosts: props.hostId ? [props?.hostId] : [],
|
|
108
|
+
type_code: E_DatastoreTypeKode[datastoreType.value],
|
|
109
|
+
nfsVersion: 'nfs-4.1',
|
|
110
|
+
readonly: false,
|
|
111
|
+
server: '',
|
|
112
|
+
folder: '',
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
|
|
116
|
+
emits('change-steps', value)
|
|
117
|
+
|
|
118
|
+
const dataReadyView = computed<UI_I_DetailsItem>(() =>
|
|
119
|
+
constructDataReadyViewFunc(
|
|
120
|
+
localization.value,
|
|
121
|
+
form.value,
|
|
122
|
+
props.project,
|
|
123
|
+
props.nfsHosts
|
|
124
|
+
)
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
const onHideAlert = (stepId: number): void => {
|
|
128
|
+
emits('hide-alert', stepId)
|
|
129
|
+
}
|
|
130
|
+
const onHideModal = (): void => {
|
|
131
|
+
emits('hide')
|
|
132
|
+
}
|
|
133
|
+
const onFinish = (): void => {
|
|
134
|
+
emits('finish', form.value)
|
|
135
|
+
}
|
|
136
|
+
</script>
|
|
137
|
+
|
|
138
|
+
<style scoped lang="scss">
|
|
139
|
+
@import 'assets/scss/common/mixins.scss';
|
|
140
|
+
.new-datastore {
|
|
141
|
+
&__body {
|
|
142
|
+
@include flex($dir: column);
|
|
143
|
+
height: 100%;
|
|
144
|
+
padding-left: 24px;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.finish-block {
|
|
149
|
+
padding: 18px 24px 24px 24px;
|
|
150
|
+
|
|
151
|
+
.add-hosts-ready-to-complete-mt-12 {
|
|
152
|
+
margin-top: 12px;
|
|
153
|
+
|
|
154
|
+
.add-hosts-ready-to-complete-bold {
|
|
155
|
+
line-height: 18px;
|
|
156
|
+
font-weight: 700;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<common-wizards-datastore-add-steps-ready-complete-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
:data-ready-view="props.dataReadyView"
|
|
5
|
+
/>
|
|
6
|
+
|
|
7
|
+
<common-wizards-datastore-add-steps-ready-complete-old
|
|
8
|
+
v-else
|
|
9
|
+
:data-ready-view="props.dataReadyView"
|
|
10
|
+
/>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts" setup>
|
|
14
|
+
import { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
|
|
15
|
+
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
16
|
+
|
|
17
|
+
const props = defineProps<{
|
|
18
|
+
dataReadyView: UI_I_DetailsItem[]
|
|
19
|
+
}>()
|
|
20
|
+
|
|
21
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
22
|
+
const { $store }: any = useNuxtApp()
|
|
23
|
+
|
|
24
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
25
|
+
|
|
26
|
+
const properties = computed<UI_I_DetailsItem[]>(() => props.dataReadyView)
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ready-complete">
|
|
3
|
+
<common-details-list :items="properties" class="ready-complete__list list">
|
|
4
|
+
<template #default="{ item }">
|
|
5
|
+
<common-details-item
|
|
6
|
+
:has-children="true"
|
|
7
|
+
open-by-default
|
|
8
|
+
:test-id="item.testId"
|
|
9
|
+
>
|
|
10
|
+
<template #stackBlockKey>
|
|
11
|
+
<span class="list__labels">
|
|
12
|
+
{{ item.label }}
|
|
13
|
+
</span>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<template #stackChildren>
|
|
17
|
+
<template
|
|
18
|
+
v-for="(item2, key2) in item.items"
|
|
19
|
+
:key="`${item2}_${key2}`"
|
|
20
|
+
>
|
|
21
|
+
<common-details-item
|
|
22
|
+
:has-children="false"
|
|
23
|
+
:test-id="item2.testId"
|
|
24
|
+
class="list__default-style"
|
|
25
|
+
>
|
|
26
|
+
<template #stackBlockKey>
|
|
27
|
+
<div>
|
|
28
|
+
{{ item2.label }}
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
<template #stackBlockContent>
|
|
32
|
+
<div v-if="item2.data">
|
|
33
|
+
<div
|
|
34
|
+
v-for="item3 in item2.data"
|
|
35
|
+
:key="item3"
|
|
36
|
+
class="flex-align-center"
|
|
37
|
+
>
|
|
38
|
+
<div class="vsphere-icon-host"></div>
|
|
39
|
+
<span>{{ item3 }}</span>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
<span v-else>
|
|
43
|
+
{{ item2.value }}
|
|
44
|
+
</span>
|
|
45
|
+
</template>
|
|
46
|
+
</common-details-item>
|
|
47
|
+
</template>
|
|
48
|
+
</template>
|
|
49
|
+
</common-details-item>
|
|
50
|
+
</template>
|
|
51
|
+
</common-details-list>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script lang="ts" setup>
|
|
56
|
+
import { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
|
|
57
|
+
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
58
|
+
|
|
59
|
+
const props = defineProps<{
|
|
60
|
+
dataReadyView: UI_I_DetailsItem[]
|
|
61
|
+
}>()
|
|
62
|
+
|
|
63
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
64
|
+
|
|
65
|
+
const properties = computed<UI_I_DetailsItem[]>(() => props.dataReadyView)
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style lang="scss" scoped>
|
|
69
|
+
@import '~/assets/scss/common/mixins.scss';
|
|
70
|
+
.ready-complete {
|
|
71
|
+
&__list {
|
|
72
|
+
@include flex($dir: column);
|
|
73
|
+
padding: 12px 0;
|
|
74
|
+
row-gap: 15px;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.list {
|
|
78
|
+
&__labels {
|
|
79
|
+
@include text($fs: 13px, $fw: 700);
|
|
80
|
+
}
|
|
81
|
+
:deep(.list__default-style) {
|
|
82
|
+
.stack-block {
|
|
83
|
+
&__label {
|
|
84
|
+
align-items: flex-start;
|
|
85
|
+
}
|
|
86
|
+
&-content {
|
|
87
|
+
white-space: pre-line;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ready-complete">
|
|
3
|
+
{{ props.dataReadyView }}
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
dataReadyView: UI_I_DetailsItem[]
|
|
12
|
+
}>()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<style lang="scss" scoped></style>
|
package/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails.ts
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
|
|
3
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
4
|
+
import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
|
|
5
|
+
import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
6
|
+
import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
|
|
7
|
+
const constructLunDiskItems = (
|
|
8
|
+
disks: UI_I_CreateStorageLunDiskItem[]
|
|
9
|
+
): string => {
|
|
10
|
+
const { $binary } = useNuxtApp() as any
|
|
11
|
+
|
|
12
|
+
let result = ''
|
|
13
|
+
disks.forEach((disk: UI_I_CreateStorageLunDiskItem) => {
|
|
14
|
+
const capacity = $binary.round(disk.capacity_mb)
|
|
15
|
+
result += `${disk.name} - ${capacity} \n`
|
|
16
|
+
})
|
|
17
|
+
return result
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const nfsDetailsFunc = (
|
|
21
|
+
localization: UI_I_Localization,
|
|
22
|
+
data: UI_I_CreateDatastoreForm,
|
|
23
|
+
project: UI_T_Project,
|
|
24
|
+
nfsHosts: UI_I_CreateDatastoreHosts
|
|
25
|
+
): UI_I_DetailsItem[] => {
|
|
26
|
+
const { name, server, folder, nfsVersion, hosts } = data
|
|
27
|
+
// const accessMode = readonly ? 'Read-only' : 'Read-write'
|
|
28
|
+
|
|
29
|
+
const details: UI_I_DetailsItem[] = [
|
|
30
|
+
{
|
|
31
|
+
label: localization.common.nfsVersion,
|
|
32
|
+
value: '',
|
|
33
|
+
items: [
|
|
34
|
+
{
|
|
35
|
+
label: localization.common.version,
|
|
36
|
+
value: nfsVersion.toUpperCase(),
|
|
37
|
+
items: [],
|
|
38
|
+
testId: 'view-selected-nfs-version-in-complete',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
actions: [],
|
|
42
|
+
testId: 'view-selected-nfs-version',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: localization.common.nameAndConfiguration,
|
|
46
|
+
value: '',
|
|
47
|
+
items: [
|
|
48
|
+
{
|
|
49
|
+
label: localization.common.datastoreName,
|
|
50
|
+
value: name,
|
|
51
|
+
items: [],
|
|
52
|
+
testId: 'view-storage-name-in-complete',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: localization.common.server,
|
|
56
|
+
value: server,
|
|
57
|
+
items: [],
|
|
58
|
+
testId: 'view-server-name-in-complete',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: localization.common.folder,
|
|
62
|
+
value: folder,
|
|
63
|
+
items: [],
|
|
64
|
+
testId: 'view-folder-name-in-complete',
|
|
65
|
+
},
|
|
66
|
+
// {
|
|
67
|
+
// label: localization.accessMode,
|
|
68
|
+
// value: accessMode,
|
|
69
|
+
// items: [],
|
|
70
|
+
// },
|
|
71
|
+
],
|
|
72
|
+
actions: [],
|
|
73
|
+
testId: 'view-selected-name-configuration',
|
|
74
|
+
},
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
if (project === 'sphere') {
|
|
78
|
+
const hostsNames = nfsHosts
|
|
79
|
+
? nfsHosts.items
|
|
80
|
+
.filter((host) => data.hosts.includes(host.id))
|
|
81
|
+
.map((host) => host.host)
|
|
82
|
+
: []
|
|
83
|
+
details.push({
|
|
84
|
+
label: localization.common.hostsAccessibility,
|
|
85
|
+
value: '',
|
|
86
|
+
items: [
|
|
87
|
+
{
|
|
88
|
+
label: localization.common.hosts,
|
|
89
|
+
value: '',
|
|
90
|
+
data: hostsNames,
|
|
91
|
+
items: [],
|
|
92
|
+
testId: 'view-hosts-name-in-complete',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
actions: [],
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return details
|
|
100
|
+
}
|
|
101
|
+
const sharedStormDetailsFunc = (
|
|
102
|
+
localization: UI_I_Localization,
|
|
103
|
+
data: UI_I_CreateDatastoreForm
|
|
104
|
+
): UI_I_DetailsItem[] => {
|
|
105
|
+
const { name, lunDisk } = data
|
|
106
|
+
|
|
107
|
+
return [
|
|
108
|
+
{
|
|
109
|
+
label: localization.common.nameAndDeviceSelection,
|
|
110
|
+
value: '',
|
|
111
|
+
items: [
|
|
112
|
+
{
|
|
113
|
+
label: localization.common.datastoreName,
|
|
114
|
+
value: name,
|
|
115
|
+
items: [],
|
|
116
|
+
testId: 'view-storage-name-in-complete',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
label: localization.common.diskLun,
|
|
120
|
+
value: constructLunDiskItems(lunDisk),
|
|
121
|
+
items: [],
|
|
122
|
+
testId: 'view-selected-lun-disks-in-complete',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
actions: [],
|
|
126
|
+
},
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const constructDataReadyViewFunc = (
|
|
131
|
+
localization: UI_I_Localization,
|
|
132
|
+
data: UI_I_CreateDatastoreForm,
|
|
133
|
+
project: UI_T_Project,
|
|
134
|
+
nfsHosts: UI_I_CreateDatastoreHosts
|
|
135
|
+
): UI_I_DetailsItem[] => {
|
|
136
|
+
const details = {
|
|
137
|
+
2: sharedStormDetailsFunc,
|
|
138
|
+
4: nfsDetailsFunc,
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return details[data.type_code as 2 | 4](localization, data, project, nfsHosts)
|
|
142
|
+
}
|