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.
- package/components/common/wizards/datastore/add/Add.vue +232 -362
- package/components/common/wizards/{datastoreNew → datastore}/add/lib/config/steps.ts +3 -0
- package/components/common/wizards/datastore/add/lib/models/interfaces.ts +11 -30
- package/components/common/wizards/datastore/add/lib/models/types.ts +0 -7
- package/components/common/wizards/datastore/add/lib/utils.ts +14 -54
- package/components/common/wizards/{datastoreNew → datastore}/add/lib/validations.ts +2 -2
- package/components/common/wizards/datastore/add/local/Local.vue +19 -45
- package/components/common/wizards/datastore/add/local/createName/CreateName.vue +31 -81
- package/components/common/wizards/datastore/add/nfs/Nfs.vue +25 -74
- package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +15 -56
- package/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces.ts +0 -4
- package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/TablesView.vue +9 -66
- package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +1 -1
- package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +57 -214
- package/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces.ts +4 -11
- package/components/common/wizards/datastore/add/nfs/version/Version.vue +3 -19
- package/components/common/wizards/datastore/add/nfs/version/lib/config/versionOptions.ts +4 -4
- package/components/common/wizards/datastore/add/readyComplete/ReadyComplete.vue +3 -10
- package/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails.ts +37 -95
- package/components/common/wizards/datastore/add/sharedStorm/SharedStorm.vue +32 -45
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/DeviceSelection.vue +64 -267
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +5 -5
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces.ts +1 -11
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/types.ts +1 -14
- package/components/common/wizards/{datastoreNew → datastore}/add/sharedStorm/deviceSelection/table/Table.vue +2 -2
- package/components/common/wizards/{datastoreNew → datastore}/add/sharedStorm/deviceSelection/table/lib/config/lunDiskTable.ts +1 -1
- package/components/common/wizards/{datastoreNew → datastore}/add/sharedStorm/deviceSelection/table/lib/config/tableKeys.ts +1 -1
- package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +13 -13
- package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/lib/config/selectOptions.ts +8 -8
- package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/sizeGraphic/sizeGraphic.vue +2 -2
- package/components/common/wizards/datastore/add/types/Types.vue +18 -17
- package/components/common/wizards/datastore/add/types/lib/config/typeOptions.ts +7 -16
- package/lib/models/enums.ts +1 -0
- package/package.json +1 -1
- package/components/common/wizards/datastore/add/lib/config/stepItems.ts +0 -225
- package/components/common/wizards/datastore/add/local/createName/lib/config/defaultForm.ts +0 -15
- package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems.ts +0 -53
- package/components/common/wizards/datastore/add/nfs/configuration/lib/config/defaultForm.ts +0 -33
- package/components/common/wizards/datastore/add/nfs/configuration/serversList/DeletePopover.vue +0 -100
- package/components/common/wizards/datastore/add/nfs/configuration/serversList/ServersList.vue +0 -124
- package/components/common/wizards/datastore/add/nfs/configuration/serversList/lib/config/serversListConfig.ts +0 -40
- package/components/common/wizards/datastore/add/nfs/configuration/serversList/lib/config/tableKeys.ts +0 -3
- package/components/common/wizards/datastore/add/nfs/configuration/serversList/lib/models/interfaces.ts +0 -11
- package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +0 -55
- package/components/common/wizards/datastore/add/readyComplete/lib/models/interfaces.ts +0 -4
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/HostTable.vue +0 -144
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/lib/config/hostsTable.ts +0 -87
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/lib/config/tableKeys.ts +0 -11
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/defaultForm.ts +0 -18
- package/components/common/wizards/datastore/add/sharedStorm/version/Version.vue +0 -39
- package/components/common/wizards/datastoreNew/add/Add.vue +0 -307
- package/components/common/wizards/datastoreNew/add/lib/models/interfaces.ts +0 -19
- package/components/common/wizards/datastoreNew/add/lib/models/types.ts +0 -7
- package/components/common/wizards/datastoreNew/add/lib/utils.ts +0 -64
- package/components/common/wizards/datastoreNew/add/local/Local.vue +0 -45
- package/components/common/wizards/datastoreNew/add/local/createName/CreateName.vue +0 -116
- package/components/common/wizards/datastoreNew/add/nfs/Nfs.vue +0 -63
- package/components/common/wizards/datastoreNew/add/nfs/_kerberosAuthentication/lib/config/radioOptions.ts +0 -27
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/Accessibility.vue +0 -63
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/config/tabsPannel.ts +0 -24
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/interfaces.ts +0 -9
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/types.ts +0 -5
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/TablesView.vue +0 -85
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +0 -62
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/incompatibleTable.ts +0 -68
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/tableKeys.ts +0 -15
- package/components/common/wizards/datastoreNew/add/nfs/configuration/Configuration.vue +0 -236
- package/components/common/wizards/datastoreNew/add/nfs/configuration/_serversList/lib/models/types.ts +0 -1
- package/components/common/wizards/datastoreNew/add/nfs/configuration/lib/models/interfaces.ts +0 -5
- package/components/common/wizards/datastoreNew/add/nfs/version/Version.vue +0 -26
- package/components/common/wizards/datastoreNew/add/nfs/version/lib/config/versionOptions.ts +0 -22
- package/components/common/wizards/datastoreNew/add/readyComplete/ReadyComplete.vue +0 -88
- package/components/common/wizards/datastoreNew/add/readyComplete/lib/config/propertiesDetails.ts +0 -140
- package/components/common/wizards/datastoreNew/add/sharedStorm/SharedStorm.vue +0 -84
- package/components/common/wizards/datastoreNew/add/sharedStorm/_version/lib/config/versionOptions.ts +0 -21
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/DeviceSelection.vue +0 -276
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +0 -23
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces.ts +0 -48
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/types.ts +0 -1
- package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +0 -236
- package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/graphicTooltip/graphicTooltip.vue +0 -64
- package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/lib/config/selectOptions.ts +0 -46
- package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/sizeGraphic/sizeGraphic.vue +0 -225
- package/components/common/wizards/datastoreNew/add/types/Types.vue +0 -83
- package/components/common/wizards/datastoreNew/add/types/lib/config/typeOptions.ts +0 -41
- /package/components/common/wizards/{datastoreNew → datastore}/add/lib/models/enums.ts +0 -0
- /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/_kerberosAuthentication/KerberosAuthentication.vue +0 -0
- /package/components/common/wizards/datastore/add/nfs/{kerberosAuthentication → _kerberosAuthentication}/lib/config/radioOptions.ts +0 -0
- /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/accessibility/tablesView/lib/models/interfaces.ts +0 -0
- /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/configuration/_serversList/DeletePopover.vue +0 -0
- /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/configuration/_serversList/ServersList.vue +0 -0
- /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/configuration/_serversList/lib/config/serversListConfig.ts +0 -0
- /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/configuration/_serversList/lib/config/tableKeys.ts +0 -0
- /package/components/common/wizards/{datastoreNew → datastore}/add/nfs/configuration/_serversList/lib/models/interfaces.ts +0 -0
- /package/components/common/wizards/datastore/add/nfs/configuration/{serversList → _serversList}/lib/models/types.ts +0 -0
- /package/components/common/wizards/{datastoreNew → datastore}/add/sharedStorm/_version/Version.vue +0 -0
- /package/components/common/wizards/datastore/add/sharedStorm/{version → _version}/lib/config/versionOptions.ts +0 -0
- /package/components/common/wizards/{datastoreNew → datastore}/add/sharedStorm/deviceSelection/table/lib/models/types.ts +0 -0
|
@@ -1,419 +1,289 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="new-datastore">
|
|
3
|
-
<atoms-
|
|
3
|
+
<atoms-wizard
|
|
4
|
+
show
|
|
5
|
+
:wizard="wizard"
|
|
6
|
+
:selected-scheme="selectedScheme"
|
|
7
|
+
:title="localization.newDatastore"
|
|
8
|
+
:localization="localization"
|
|
9
|
+
class="add-datastore"
|
|
4
10
|
test-id="add-datastore-wizard"
|
|
5
|
-
|
|
6
|
-
:title="localization.common.newDatastore"
|
|
7
|
-
:step-items="stepItems"
|
|
8
|
-
:step-position="stepPosition"
|
|
9
|
-
:loading="loading"
|
|
10
|
-
@finish="onAddDatastore"
|
|
11
|
-
@next="onNextStep"
|
|
12
|
-
@back="back"
|
|
13
|
-
@change-step="onChangeStep"
|
|
11
|
+
@change-steps="onChangeSteps"
|
|
14
12
|
@hide="onHideModal"
|
|
13
|
+
@submit="onFinish"
|
|
15
14
|
>
|
|
16
|
-
<template #modalBody>
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
<common-wizards-datastore-add-ready-complete
|
|
65
|
-
v-show="isShowCompleteBlock"
|
|
66
|
-
:data-ready-view="dataReadyView"
|
|
67
|
-
/>
|
|
68
|
-
</div>
|
|
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
|
+
/>
|
|
69
63
|
</template>
|
|
70
|
-
</atoms-
|
|
64
|
+
</atoms-wizard>
|
|
71
65
|
</div>
|
|
72
66
|
</template>
|
|
73
67
|
|
|
74
68
|
<script setup lang="ts">
|
|
75
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
76
|
-
import type { UI_I_VerticalStepItem } from '~/components/atoms/lib/models/interfaces'
|
|
77
69
|
import type {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
UI_I_WizardStep,
|
|
71
|
+
UI_I_ValidationReturn,
|
|
72
|
+
} from '~/components/atoms/wizard/lib/models/interfaces'
|
|
73
|
+
import Wizard from '~/components/atoms/wizard/lib/utils/utils'
|
|
74
|
+
import {
|
|
75
|
+
stepsFunc,
|
|
76
|
+
stepsSchemeInitial,
|
|
77
|
+
} from '~/components/common/wizards/datastore/add/lib/config/steps'
|
|
78
|
+
|
|
79
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
80
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
81
|
+
import type { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
82
82
|
import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
83
|
-
import type {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} from '~/components/common/wizards/datastore/add/
|
|
87
|
-
import { stepItemsFunc } from '~/components/common/wizards/datastore/add/lib/config/stepItems'
|
|
83
|
+
import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
|
|
84
|
+
import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
|
|
85
|
+
import type { UI_I_ChangeStepsSchemes } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
|
|
86
|
+
import { E_DatastoreTypeKode } from '~/components/common/wizards/datastore/add/lib/models/enums'
|
|
88
87
|
import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
|
|
88
|
+
import * as validation from '~/components/common/wizards/datastore/add/lib/validations'
|
|
89
89
|
|
|
90
90
|
const props = defineProps<{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
finishFunc: (
|
|
94
|
-
datastoreForm: UI_I_CreateDatastoreForm,
|
|
95
|
-
datastoreType: UI_T_DatastoreType,
|
|
96
|
-
version: UI_T_NfsType
|
|
97
|
-
) => Promise<void>
|
|
98
|
-
datacenterHosts?: UI_I_SelectHostOptions[]
|
|
99
|
-
nfsHosts?: any
|
|
100
|
-
isMainFilter?: boolean
|
|
91
|
+
project: UI_T_Project
|
|
92
|
+
nfsHosts?: UI_I_CreateDatastoreHosts
|
|
101
93
|
hostId?: string
|
|
94
|
+
isMainFilter?: boolean
|
|
102
95
|
}>()
|
|
103
96
|
const emits = defineEmits<{
|
|
104
97
|
(event: 'hide'): void
|
|
105
|
-
(event: '
|
|
98
|
+
(event: 'finish', value: any): void
|
|
106
99
|
(event: 'main-filter', value: string): void
|
|
107
100
|
}>()
|
|
108
101
|
|
|
109
102
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
110
103
|
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
'shared-storm'
|
|
104
|
+
const wizard: Wizard = new Wizard(
|
|
105
|
+
stepsFunc(localization.value),
|
|
106
|
+
stepsSchemeInitial
|
|
115
107
|
)
|
|
116
|
-
const nfsVersion = ref<UI_T_NfsType>('nfs-3')
|
|
117
108
|
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
nfs: {
|
|
135
|
-
name: '',
|
|
136
|
-
server: '',
|
|
137
|
-
folder: '',
|
|
138
|
-
readonly: false,
|
|
139
|
-
version: nfsVersion.value,
|
|
140
|
-
type_code: 4,
|
|
141
|
-
hosts: [],
|
|
142
|
-
},
|
|
109
|
+
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
|
110
|
+
const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
|
|
111
|
+
|
|
112
|
+
// const datastoreType = ref<UI_T_DatastoreType>(
|
|
113
|
+
// props.project === 'procurator' ? 'local' : 'shared-storm'
|
|
114
|
+
// )
|
|
115
|
+
const datastoreType = ref<UI_T_DatastoreType>('shared-storm')
|
|
116
|
+
const form = ref<UI_I_CreateDatastoreForm>({
|
|
117
|
+
name: 'Datastore',
|
|
118
|
+
lunDisk: [],
|
|
119
|
+
hosts: props.hostId ? [props?.hostId] : [],
|
|
120
|
+
type_code: E_DatastoreTypeKode[datastoreType.value],
|
|
121
|
+
nfsVersion: 'nfs-3',
|
|
122
|
+
readonly: false,
|
|
123
|
+
server: '',
|
|
124
|
+
folder: '',
|
|
143
125
|
})
|
|
144
126
|
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
127
|
+
const validationFunc = async (
|
|
128
|
+
value: UI_I_WizardStep[],
|
|
129
|
+
currentStep: UI_I_WizardStep,
|
|
130
|
+
nextStep: UI_I_WizardStep
|
|
131
|
+
): Promise<UI_I_ValidationReturn> => {
|
|
132
|
+
let stepHasError = false
|
|
133
|
+
|
|
134
|
+
if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
|
|
135
|
+
const nameValidation = await validation.checkDatastoreNameAsync(
|
|
136
|
+
localization.value,
|
|
137
|
+
value,
|
|
138
|
+
form.value,
|
|
139
|
+
1,
|
|
140
|
+
'datastoreName',
|
|
141
|
+
wizard,
|
|
142
|
+
props.project
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
value = nameValidation.newValue
|
|
146
|
+
|
|
147
|
+
stepHasError = nameValidation.stepHasError
|
|
148
|
+
}
|
|
152
149
|
|
|
153
|
-
if (
|
|
154
|
-
|
|
150
|
+
if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
|
|
151
|
+
const nameValidation = await validation.checkDatastoreNameAsync(
|
|
152
|
+
localization.value,
|
|
153
|
+
value,
|
|
154
|
+
form.value,
|
|
155
|
+
2,
|
|
156
|
+
'datastoreName',
|
|
157
|
+
wizard,
|
|
158
|
+
props.project
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
value = nameValidation.newValue
|
|
162
|
+
|
|
163
|
+
const lunDiskValidation = validation.checkSelectedLunDiskSync(
|
|
164
|
+
localization.value,
|
|
165
|
+
form.value,
|
|
166
|
+
wizard,
|
|
167
|
+
value,
|
|
168
|
+
props.project,
|
|
169
|
+
props.hostId
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
value = lunDiskValidation.newValue
|
|
173
|
+
|
|
174
|
+
stepHasError = nameValidation.stepHasError || lunDiskValidation.stepHasError
|
|
155
175
|
}
|
|
156
176
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
177
|
+
if (wizard.isValidateForStep(5, currentStep.id, nextStep.id)) {
|
|
178
|
+
const nameValidation = await validation.checkDatastoreNameAsync(
|
|
179
|
+
localization.value,
|
|
180
|
+
value,
|
|
181
|
+
form.value,
|
|
182
|
+
5,
|
|
183
|
+
'name',
|
|
184
|
+
wizard,
|
|
185
|
+
props.project
|
|
186
|
+
)
|
|
187
|
+
value = nameValidation.newValue
|
|
188
|
+
|
|
189
|
+
const folderValidation = validation.checkNfsFolderSync(
|
|
190
|
+
localization.value,
|
|
191
|
+
form.value.folder,
|
|
192
|
+
wizard,
|
|
193
|
+
value
|
|
194
|
+
)
|
|
195
|
+
value = folderValidation.newValue
|
|
196
|
+
|
|
197
|
+
const serverValidation = validation.checkNfsServerSync(
|
|
198
|
+
localization.value,
|
|
199
|
+
form.value.server,
|
|
200
|
+
wizard,
|
|
201
|
+
value
|
|
202
|
+
)
|
|
203
|
+
value = serverValidation.newValue
|
|
204
|
+
|
|
205
|
+
stepHasError =
|
|
206
|
+
nameValidation.stepHasError ||
|
|
207
|
+
folderValidation.stepHasError ||
|
|
208
|
+
serverValidation.stepHasError
|
|
162
209
|
}
|
|
163
210
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
211
|
+
if (wizard.isValidateForStep(6, currentStep.id, nextStep.id)) {
|
|
212
|
+
const nameValidation = await validation.checkHostsAccessibilitySync(
|
|
213
|
+
localization.value,
|
|
214
|
+
form.value.hosts,
|
|
215
|
+
wizard,
|
|
216
|
+
value
|
|
217
|
+
)
|
|
168
218
|
|
|
169
|
-
|
|
170
|
-
stepPosition.value--
|
|
171
|
-
}
|
|
219
|
+
value = nameValidation.newValue
|
|
172
220
|
|
|
173
|
-
|
|
174
|
-
if (key < stepPosition.value) {
|
|
175
|
-
stepPosition.value = key
|
|
176
|
-
return
|
|
221
|
+
stepHasError = nameValidation.stepHasError
|
|
177
222
|
}
|
|
178
223
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
cashStep = key
|
|
183
|
-
return
|
|
224
|
+
return {
|
|
225
|
+
newValue: value,
|
|
226
|
+
stepHasError,
|
|
184
227
|
}
|
|
185
|
-
|
|
186
|
-
stepPosition.value = key
|
|
187
|
-
}
|
|
188
|
-
const onHideModal = (): void => {
|
|
189
|
-
emits('hide')
|
|
190
228
|
}
|
|
191
229
|
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
return false
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
if (datastoreType.value === 'shared-storm') {
|
|
214
|
-
if (stepPosition.value === 1 && !force) {
|
|
215
|
-
deviceSelectionSubmit.value++
|
|
216
|
-
return false
|
|
230
|
+
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
|
|
231
|
+
wizard.changeSteps(value, validationFunc)
|
|
232
|
+
|
|
233
|
+
// Choosing Scheme
|
|
234
|
+
watch(
|
|
235
|
+
datastoreType,
|
|
236
|
+
(newValue: UI_T_DatastoreType) => {
|
|
237
|
+
const schemes: UI_I_ChangeStepsSchemes = {
|
|
238
|
+
procurator: {
|
|
239
|
+
local: 0,
|
|
240
|
+
'shared-storm': 1,
|
|
241
|
+
nfs: 2,
|
|
242
|
+
},
|
|
243
|
+
sphere: {
|
|
244
|
+
'shared-storm': 3,
|
|
245
|
+
nfs: 4,
|
|
246
|
+
},
|
|
217
247
|
}
|
|
218
|
-
}
|
|
219
248
|
|
|
220
|
-
|
|
221
|
-
if (stepPosition.value === 2 && !force) {
|
|
222
|
-
nfsConfigurationSubmit.value++
|
|
223
|
-
return false
|
|
224
|
-
}
|
|
249
|
+
const projectSchemes = schemes[props.project]
|
|
225
250
|
|
|
226
|
-
if (
|
|
227
|
-
|
|
228
|
-
return false
|
|
251
|
+
if (projectSchemes && projectSchemes[newValue] !== undefined) {
|
|
252
|
+
wizard.changeScheme(projectSchemes[newValue] as number)
|
|
229
253
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
// !force
|
|
234
|
-
// ) {
|
|
235
|
-
// hostAccessibilitySubmit.value++
|
|
236
|
-
// return false
|
|
237
|
-
// }
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
return true
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const isWizardModeForSphere = computed<boolean>(() => props.mode === 'sphere')
|
|
244
|
-
|
|
245
|
-
const onSaveNameAndNextLocal = (event: any): void => {
|
|
246
|
-
const { local } = datastoreForm.value
|
|
247
|
-
|
|
248
|
-
if (isWizardModeForSphere.value) {
|
|
249
|
-
local.name = event.name
|
|
250
|
-
local.hosts.push(event.host)
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
if (!isWizardModeForSphere.value) {
|
|
254
|
-
local.name = event
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
dataReadyView.value = constructDataReadyViewFunc(
|
|
258
|
-
localization.value,
|
|
259
|
-
'local',
|
|
260
|
-
event,
|
|
261
|
-
isWizardModeForSphere.value
|
|
262
|
-
)
|
|
263
|
-
|
|
264
|
-
onNextStep(true)
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
const onSaveAndNextSharedStorm = (event: any): void => {
|
|
268
|
-
const { sharedStorm } = datastoreForm.value
|
|
269
|
-
sharedStorm.name = event.name
|
|
270
|
-
sharedStorm.dev_names = event.lunDisk.map((lun: UI_I_LunDisk) => lun.name)
|
|
271
|
-
sharedStorm.hosts = [event.host]
|
|
254
|
+
},
|
|
255
|
+
{ deep: true, immediate: true }
|
|
256
|
+
)
|
|
272
257
|
|
|
273
|
-
|
|
258
|
+
const dataReadyView = computed<UI_I_DetailsItem>(() =>
|
|
259
|
+
constructDataReadyViewFunc(
|
|
274
260
|
localization.value,
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
261
|
+
form.value,
|
|
262
|
+
props.project,
|
|
263
|
+
props.nfsHosts
|
|
278
264
|
)
|
|
265
|
+
)
|
|
279
266
|
|
|
280
|
-
|
|
267
|
+
const onHideAlert = (stepId: number): void => {
|
|
268
|
+
wizard.hideAlertMessagesByStepId(stepId)
|
|
281
269
|
}
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
nfs.name = event.name
|
|
285
|
-
nfs.folder = event.folder
|
|
286
|
-
nfs.server = event.server
|
|
287
|
-
nfs.hosts = event.hosts
|
|
288
|
-
|
|
289
|
-
// TODO refactoring
|
|
290
|
-
const hostsNames = props.nfsHosts
|
|
291
|
-
? props.nfsHosts.items
|
|
292
|
-
.filter((host) => event.hosts.includes(host.id))
|
|
293
|
-
.map((host) => host.host)
|
|
294
|
-
: []
|
|
295
|
-
|
|
296
|
-
dataReadyView.value = constructDataReadyViewFunc(
|
|
297
|
-
localization.value,
|
|
298
|
-
'nfs',
|
|
299
|
-
{
|
|
300
|
-
...event,
|
|
301
|
-
hosts: hostsNames,
|
|
302
|
-
version: nfsVersion.value,
|
|
303
|
-
},
|
|
304
|
-
isWizardModeForSphere.value
|
|
305
|
-
)
|
|
306
|
-
|
|
307
|
-
next && onNextStep(true)
|
|
270
|
+
const onHideModal = (): void => {
|
|
271
|
+
emits('hide')
|
|
308
272
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
// TODO refactoring
|
|
312
|
-
const localStep = datastoreType.value === 'local' && stepPosition.value === 2
|
|
313
|
-
|
|
314
|
-
const sharesStep =
|
|
315
|
-
datastoreType.value === 'shared-storm' &&
|
|
316
|
-
(props.mode === 'procurator'
|
|
317
|
-
? stepPosition.value === 3
|
|
318
|
-
: stepPosition.value === 2)
|
|
319
|
-
|
|
320
|
-
let nfsFirst
|
|
321
|
-
if (props.mode === 'procurator') {
|
|
322
|
-
nfsFirst =
|
|
323
|
-
datastoreType.value === 'nfs' &&
|
|
324
|
-
nfsVersion.value === 'nfs-3' &&
|
|
325
|
-
stepPosition.value === 3
|
|
326
|
-
} else {
|
|
327
|
-
nfsFirst =
|
|
328
|
-
datastoreType.value === 'nfs' &&
|
|
329
|
-
nfsVersion.value === 'nfs-3' &&
|
|
330
|
-
stepPosition.value === 4
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
let nfsSecond
|
|
334
|
-
if (props.mode === 'procurator') {
|
|
335
|
-
nfsSecond =
|
|
336
|
-
datastoreType.value === 'nfs' &&
|
|
337
|
-
nfsVersion.value === 'nfs-4.1' &&
|
|
338
|
-
stepPosition.value === 3
|
|
339
|
-
} else {
|
|
340
|
-
nfsSecond =
|
|
341
|
-
datastoreType.value === 'nfs' &&
|
|
342
|
-
nfsVersion.value === 'nfs-4.1' &&
|
|
343
|
-
stepPosition.value === 4
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
return localStep || sharesStep || nfsFirst || nfsSecond
|
|
347
|
-
})
|
|
348
|
-
|
|
349
|
-
const onAddDatastore = async (): Promise<void> => {
|
|
350
|
-
loading.value = true
|
|
351
|
-
|
|
352
|
-
props
|
|
353
|
-
.finishFunc(datastoreForm.value, datastoreType.value, nfsVersion.value)
|
|
354
|
-
.then(() => {
|
|
355
|
-
emits('global-refresh')
|
|
356
|
-
loading.value = false
|
|
357
|
-
onHideModal()
|
|
358
|
-
})
|
|
273
|
+
const onFinish = (): void => {
|
|
274
|
+
emits('finish', form.value)
|
|
359
275
|
}
|
|
360
|
-
|
|
361
|
-
//
|
|
362
|
-
//
|
|
363
|
-
//
|
|
364
|
-
//
|
|
365
|
-
//
|
|
366
|
-
//
|
|
367
|
-
// }
|
|
368
|
-
// const createDatastoreFromSharedStorm = async (): Promise<API_UI_I_Error> => {
|
|
369
|
-
// const {
|
|
370
|
-
// sharedStorm: { dev_names: disks, ...sendData },
|
|
371
|
-
// } = datastoreForm.value
|
|
372
|
-
//
|
|
373
|
-
// const { data, msg } = await getStoragePoolName<{ dev_names: string[] }>(
|
|
374
|
-
// '/psm/api/v1/storage/lvm/create',
|
|
375
|
-
// { dev_names: disks }
|
|
376
|
-
// )
|
|
377
|
-
//
|
|
378
|
-
// if (!data && msg) return msg
|
|
379
|
-
//
|
|
380
|
-
// sendData.pool_name = data?.pool_name || ''
|
|
381
|
-
//
|
|
382
|
-
// return await createDatastore(sendData)
|
|
383
|
-
// }
|
|
384
|
-
|
|
385
|
-
// const createDatastoreFromNfs = async (): Promise<API_UI_I_Error> => {
|
|
386
|
-
// const {
|
|
387
|
-
// nfs: { server, folder, readonly, name, type_code: type },
|
|
388
|
-
// } = datastoreForm.value
|
|
389
|
-
//
|
|
390
|
-
// const sendDataOne = {
|
|
391
|
-
// server,
|
|
392
|
-
// folder,
|
|
393
|
-
// readonly,
|
|
394
|
-
// version: nfsVersion.value === 'nfs-4.1' ? 4.1 : 3.0,
|
|
395
|
-
// }
|
|
396
|
-
//
|
|
397
|
-
// const { data, msg } = await getStoragePoolName<UI_I_NfsPoolNameForm>(
|
|
398
|
-
// '/psm/api/v1/storage/cnfs',
|
|
399
|
-
// sendDataOne
|
|
400
|
-
// )
|
|
401
|
-
//
|
|
402
|
-
// if (!data && msg) return msg
|
|
403
|
-
//
|
|
404
|
-
// const sendDataTwo = {
|
|
405
|
-
// name,
|
|
406
|
-
// type_code: type,
|
|
407
|
-
// pool_name: data?.pool_name || '',
|
|
408
|
-
// }
|
|
409
|
-
//
|
|
410
|
-
// return await createDatastore(sendDataTwo)
|
|
411
|
-
// }
|
|
276
|
+
// watch(
|
|
277
|
+
// () => props.isLoading,
|
|
278
|
+
// (newValue) => {
|
|
279
|
+
// wizard.setLoader(newValue)
|
|
280
|
+
// },
|
|
281
|
+
// { immediate: true }
|
|
282
|
+
// )
|
|
412
283
|
</script>
|
|
413
284
|
|
|
414
285
|
<style scoped lang="scss">
|
|
415
|
-
@import '
|
|
416
|
-
|
|
286
|
+
@import 'assets/scss/common/mixins.scss';
|
|
417
287
|
.new-datastore {
|
|
418
288
|
&__body {
|
|
419
289
|
@include flex($dir: column);
|
|
@@ -123,6 +123,9 @@ export const stepsFunc = (
|
|
|
123
123
|
fields: {},
|
|
124
124
|
isValid: true,
|
|
125
125
|
testId: 'create-datastore-ready-complete',
|
|
126
|
+
// testId: 'create-datastore-storm-ready-complete',
|
|
127
|
+
// testId: 'create-datastore-nfs-ready-complete',
|
|
128
|
+
// testId: 'create-datastore-local-ready-complete',
|
|
126
129
|
},
|
|
127
130
|
]
|
|
128
131
|
|