bfg-common 1.5.392 → 1.5.393
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/assets/localization/local_be.json +1 -16
- package/assets/localization/local_en.json +1 -16
- package/assets/localization/local_hy.json +1 -16
- package/assets/localization/local_kk.json +1 -16
- package/assets/localization/local_ru.json +1 -16
- package/assets/localization/local_zh.json +1 -16
- package/components/common/backup/storage/actions/add/Add.vue +248 -250
- package/components/common/backup/storage/actions/add/New.vue +304 -305
- package/components/common/backup/storage/actions/add/Old.vue +0 -1
- package/components/common/backup/storage/actions/add/lib/validations.ts +242 -234
- package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigure.vue +42 -44
- package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigureNew.vue +276 -272
- package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigureOld.vue +331 -328
- package/package.json +1 -1
@@ -1,234 +1,242 @@
|
|
1
|
-
import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
2
|
-
import type { UI_T_Project } from '~/lib/models/types'
|
3
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
4
|
-
import type {
|
5
|
-
UI_I_AsyncCheckReturn,
|
6
|
-
UI_I_ValidationReturn,
|
7
|
-
UI_I_WizardStep,
|
8
|
-
} from '~/components/atoms/wizard/lib/models/interfaces'
|
9
|
-
import type { UI_I_CreateDatastoreForm } from '~/components/common/backup/storage/actions/add/lib/models/interfaces'
|
10
|
-
import { checkValidityName } from '~/components/common/backup/storage/actions/add/lib/utils'
|
11
|
-
import { dynamicSteps } from '~/components/common/backup/storage/actions/add/lib/config/steps'
|
12
|
-
|
13
|
-
const checkName = async (
|
14
|
-
form: UI_I_CreateDatastoreForm,
|
15
|
-
localization: UI_I_Localization,
|
16
|
-
wizard: Wizard,
|
17
|
-
project: UI_T_Project
|
18
|
-
): Promise<UI_I_AsyncCheckReturn> => {
|
19
|
-
if (form.name) {
|
20
|
-
return new Promise((resolve, _reject) =>
|
21
|
-
checkValidityName(form.name, wizard, project, (message: string) => {
|
22
|
-
resolve({
|
23
|
-
isValid: message === '',
|
24
|
-
message: message === '' ? '' : message,
|
25
|
-
})
|
26
|
-
})
|
27
|
-
)
|
28
|
-
} else {
|
29
|
-
return {
|
30
|
-
isValid: false,
|
31
|
-
message: !form.name ? localization.common.fieldRequired : '',
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
export const checkDatastoreNameAsync = async (
|
36
|
-
localization: UI_I_Localization,
|
37
|
-
value: UI_I_WizardStep[],
|
38
|
-
form: UI_I_CreateDatastoreForm,
|
39
|
-
stepId: number,
|
40
|
-
fieldName: string,
|
41
|
-
wizard: Wizard,
|
42
|
-
project: UI_T_Project
|
43
|
-
): Promise<UI_I_ValidationReturn> => {
|
44
|
-
let stepHasError = false
|
45
|
-
|
46
|
-
const labelValidation: {
|
47
|
-
isValid: boolean
|
48
|
-
message: string
|
49
|
-
} = await checkName(form, localization, wizard, project)
|
50
|
-
|
51
|
-
if (!labelValidation.isValid) {
|
52
|
-
stepHasError = wizard.setValidation(stepId, fieldName, {
|
53
|
-
fieldMessage: labelValidation.message,
|
54
|
-
alertMessage: form.name ? labelValidation.message : '',
|
55
|
-
})
|
56
|
-
} else if (wizard.hasMessage(stepId, fieldName)) {
|
57
|
-
value = wizard.removeValidation(stepId, fieldName, value)
|
58
|
-
}
|
59
|
-
|
60
|
-
return {
|
61
|
-
newValue: value,
|
62
|
-
stepHasError,
|
63
|
-
}
|
64
|
-
}
|
65
|
-
|
66
|
-
export const checkFolderSync = (
|
67
|
-
localization: UI_I_Localization,
|
68
|
-
name: string,
|
69
|
-
wizard: Wizard,
|
70
|
-
value: UI_I_WizardStep[]
|
71
|
-
): UI_I_ValidationReturn => {
|
72
|
-
let stepHasError = false
|
73
|
-
|
74
|
-
if (!name) {
|
75
|
-
stepHasError = wizard.setValidation(
|
76
|
-
dynamicSteps.nameAndConfigure,
|
77
|
-
'folder',
|
78
|
-
{
|
79
|
-
fieldMessage: localization.common.fieldRequired,
|
80
|
-
alertMessage: '',
|
81
|
-
}
|
82
|
-
)
|
83
|
-
} else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'folder')) {
|
84
|
-
value = wizard.removeValidation(
|
85
|
-
dynamicSteps.nameAndConfigure,
|
86
|
-
'folder',
|
87
|
-
value
|
88
|
-
)
|
89
|
-
}
|
90
|
-
|
91
|
-
return {
|
92
|
-
newValue: value,
|
93
|
-
stepHasError,
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
export const checkServerSync = (
|
98
|
-
localization: UI_I_Localization,
|
99
|
-
name: string,
|
100
|
-
wizard: Wizard,
|
101
|
-
value: UI_I_WizardStep[]
|
102
|
-
): UI_I_ValidationReturn => {
|
103
|
-
let stepHasError = false
|
104
|
-
|
105
|
-
if (!name) {
|
106
|
-
stepHasError = wizard.setValidation(
|
107
|
-
dynamicSteps.nameAndConfigure,
|
108
|
-
'server',
|
109
|
-
{
|
110
|
-
fieldMessage: localization.common.fieldRequired,
|
111
|
-
alertMessage: '',
|
112
|
-
}
|
113
|
-
)
|
114
|
-
} else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'server')) {
|
115
|
-
value = wizard.removeValidation(
|
116
|
-
dynamicSteps.nameAndConfigure,
|
117
|
-
'server',
|
118
|
-
value
|
119
|
-
)
|
120
|
-
}
|
121
|
-
|
122
|
-
return {
|
123
|
-
newValue: value,
|
124
|
-
stepHasError,
|
125
|
-
}
|
126
|
-
}
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
}
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
}
|
1
|
+
import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
2
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
3
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
4
|
+
import type {
|
5
|
+
UI_I_AsyncCheckReturn,
|
6
|
+
UI_I_ValidationReturn,
|
7
|
+
UI_I_WizardStep,
|
8
|
+
} from '~/components/atoms/wizard/lib/models/interfaces'
|
9
|
+
import type { UI_I_CreateDatastoreForm } from '~/components/common/backup/storage/actions/add/lib/models/interfaces'
|
10
|
+
import { checkValidityName } from '~/components/common/backup/storage/actions/add/lib/utils'
|
11
|
+
import { dynamicSteps } from '~/components/common/backup/storage/actions/add/lib/config/steps'
|
12
|
+
|
13
|
+
const checkName = async (
|
14
|
+
form: UI_I_CreateDatastoreForm,
|
15
|
+
localization: UI_I_Localization,
|
16
|
+
wizard: Wizard,
|
17
|
+
project: UI_T_Project
|
18
|
+
): Promise<UI_I_AsyncCheckReturn> => {
|
19
|
+
if (form.name) {
|
20
|
+
return new Promise((resolve, _reject) =>
|
21
|
+
checkValidityName(form.name, wizard, project, (message: string) => {
|
22
|
+
resolve({
|
23
|
+
isValid: message === '',
|
24
|
+
message: message === '' ? '' : message,
|
25
|
+
})
|
26
|
+
})
|
27
|
+
)
|
28
|
+
} else {
|
29
|
+
return {
|
30
|
+
isValid: false,
|
31
|
+
message: !form.name ? localization.common.fieldRequired : '',
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
export const checkDatastoreNameAsync = async (
|
36
|
+
localization: UI_I_Localization,
|
37
|
+
value: UI_I_WizardStep[],
|
38
|
+
form: UI_I_CreateDatastoreForm,
|
39
|
+
stepId: number,
|
40
|
+
fieldName: string,
|
41
|
+
wizard: Wizard,
|
42
|
+
project: UI_T_Project
|
43
|
+
): Promise<UI_I_ValidationReturn> => {
|
44
|
+
let stepHasError = false
|
45
|
+
|
46
|
+
const labelValidation: {
|
47
|
+
isValid: boolean
|
48
|
+
message: string
|
49
|
+
} = await checkName(form, localization, wizard, project)
|
50
|
+
|
51
|
+
if (!labelValidation.isValid) {
|
52
|
+
stepHasError = wizard.setValidation(stepId, fieldName, {
|
53
|
+
fieldMessage: labelValidation.message,
|
54
|
+
alertMessage: form.name ? labelValidation.message : '',
|
55
|
+
})
|
56
|
+
} else if (wizard.hasMessage(stepId, fieldName)) {
|
57
|
+
value = wizard.removeValidation(stepId, fieldName, value)
|
58
|
+
}
|
59
|
+
|
60
|
+
return {
|
61
|
+
newValue: value,
|
62
|
+
stepHasError,
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
export const checkFolderSync = (
|
67
|
+
localization: UI_I_Localization,
|
68
|
+
name: string,
|
69
|
+
wizard: Wizard,
|
70
|
+
value: UI_I_WizardStep[]
|
71
|
+
): UI_I_ValidationReturn => {
|
72
|
+
let stepHasError = false
|
73
|
+
|
74
|
+
if (!name) {
|
75
|
+
stepHasError = wizard.setValidation(
|
76
|
+
dynamicSteps.nameAndConfigure,
|
77
|
+
'folder',
|
78
|
+
{
|
79
|
+
fieldMessage: localization.common.fieldRequired,
|
80
|
+
alertMessage: '',
|
81
|
+
}
|
82
|
+
)
|
83
|
+
} else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'folder')) {
|
84
|
+
value = wizard.removeValidation(
|
85
|
+
dynamicSteps.nameAndConfigure,
|
86
|
+
'folder',
|
87
|
+
value
|
88
|
+
)
|
89
|
+
}
|
90
|
+
|
91
|
+
return {
|
92
|
+
newValue: value,
|
93
|
+
stepHasError,
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
export const checkServerSync = (
|
98
|
+
localization: UI_I_Localization,
|
99
|
+
name: string,
|
100
|
+
wizard: Wizard,
|
101
|
+
value: UI_I_WizardStep[]
|
102
|
+
): UI_I_ValidationReturn => {
|
103
|
+
let stepHasError = false
|
104
|
+
|
105
|
+
if (!name) {
|
106
|
+
stepHasError = wizard.setValidation(
|
107
|
+
dynamicSteps.nameAndConfigure,
|
108
|
+
'server',
|
109
|
+
{
|
110
|
+
fieldMessage: localization.common.fieldRequired,
|
111
|
+
alertMessage: '',
|
112
|
+
}
|
113
|
+
)
|
114
|
+
} else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'server')) {
|
115
|
+
value = wizard.removeValidation(
|
116
|
+
dynamicSteps.nameAndConfigure,
|
117
|
+
'server',
|
118
|
+
value
|
119
|
+
)
|
120
|
+
}
|
121
|
+
|
122
|
+
return {
|
123
|
+
newValue: value,
|
124
|
+
stepHasError,
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
// PC-2542
|
129
|
+
// export const checkUsernameSync = (
|
130
|
+
// localization: UI_I_Localization,
|
131
|
+
// name: string,
|
132
|
+
// wizard: Wizard,
|
133
|
+
// value: UI_I_WizardStep[]
|
134
|
+
// ): UI_I_ValidationReturn => {
|
135
|
+
// let stepHasError = false
|
136
|
+
//
|
137
|
+
// if (!name) {
|
138
|
+
// stepHasError = wizard.setValidation(dynamicSteps.nameAndConfigure, 'user', {
|
139
|
+
// fieldMessage: localization.common.fieldRequired,
|
140
|
+
// alertMessage: '',
|
141
|
+
// })
|
142
|
+
// } else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'user')) {
|
143
|
+
// value = wizard.removeValidation(
|
144
|
+
// dynamicSteps.nameAndConfigure,
|
145
|
+
// 'user',
|
146
|
+
// value
|
147
|
+
// )
|
148
|
+
// }
|
149
|
+
//
|
150
|
+
// return {
|
151
|
+
// newValue: value,
|
152
|
+
// stepHasError,
|
153
|
+
// }
|
154
|
+
// }
|
155
|
+
|
156
|
+
// PC-2542
|
157
|
+
// export const checkPasswordSync = (
|
158
|
+
// localization: UI_I_Localization,
|
159
|
+
// name: string,
|
160
|
+
// wizard: Wizard,
|
161
|
+
// value: UI_I_WizardStep[]
|
162
|
+
// ): UI_I_ValidationReturn => {
|
163
|
+
// let stepHasError = false
|
164
|
+
//
|
165
|
+
// if (!name) {
|
166
|
+
// stepHasError = wizard.setValidation(
|
167
|
+
// dynamicSteps.nameAndConfigure,
|
168
|
+
// 'password',
|
169
|
+
// {
|
170
|
+
// fieldMessage: localization.common.fieldRequired,
|
171
|
+
// alertMessage: '',
|
172
|
+
// }
|
173
|
+
// )
|
174
|
+
// } else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'password')) {
|
175
|
+
// value = wizard.removeValidation(
|
176
|
+
// dynamicSteps.nameAndConfigure,
|
177
|
+
// 'password',
|
178
|
+
// value
|
179
|
+
// )
|
180
|
+
// }
|
181
|
+
//
|
182
|
+
// return {
|
183
|
+
// newValue: value,
|
184
|
+
// stepHasError,
|
185
|
+
// }
|
186
|
+
// }
|
187
|
+
|
188
|
+
export const checkHostsAccessibilitySync = (
|
189
|
+
localization: UI_I_Localization,
|
190
|
+
hosts: string[],
|
191
|
+
wizard: Wizard,
|
192
|
+
value: UI_I_WizardStep[]
|
193
|
+
): UI_I_ValidationReturn => {
|
194
|
+
let stepHasError = false
|
195
|
+
|
196
|
+
if (!hosts.length) {
|
197
|
+
stepHasError = wizard.setValidation(
|
198
|
+
dynamicSteps.hostAccessibility,
|
199
|
+
'hostsAccessibility',
|
200
|
+
{
|
201
|
+
fieldMessage: '',
|
202
|
+
alertMessage: localization.common.selectLeastEntityContinue,
|
203
|
+
}
|
204
|
+
)
|
205
|
+
} else if (
|
206
|
+
wizard.hasMessage(dynamicSteps.hostAccessibility, 'hostsAccessibility')
|
207
|
+
) {
|
208
|
+
value = wizard.removeValidation(
|
209
|
+
dynamicSteps.hostAccessibility,
|
210
|
+
'hostsAccessibility',
|
211
|
+
value
|
212
|
+
)
|
213
|
+
}
|
214
|
+
|
215
|
+
return {
|
216
|
+
newValue: value,
|
217
|
+
stepHasError,
|
218
|
+
}
|
219
|
+
}
|
220
|
+
|
221
|
+
export const checkStorageSync = (
|
222
|
+
localization: UI_I_Localization,
|
223
|
+
storm_id: string,
|
224
|
+
wizard: Wizard,
|
225
|
+
value: UI_I_WizardStep[]
|
226
|
+
): UI_I_ValidationReturn => {
|
227
|
+
let stepHasError = false
|
228
|
+
|
229
|
+
if (!storm_id) {
|
230
|
+
stepHasError = wizard.setValidation(dynamicSteps.storage, 'storage', {
|
231
|
+
fieldMessage: '',
|
232
|
+
alertMessage: localization.common.selectValidDestinationStorage,
|
233
|
+
})
|
234
|
+
} else if (wizard.hasMessage(dynamicSteps.storage, 'storage')) {
|
235
|
+
value = wizard.removeValidation(dynamicSteps.storage, 'storage', value)
|
236
|
+
}
|
237
|
+
|
238
|
+
return {
|
239
|
+
newValue: value,
|
240
|
+
stepHasError,
|
241
|
+
}
|
242
|
+
}
|
package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigure.vue
CHANGED
@@ -1,44 +1,42 @@
|
|
1
|
-
<template>
|
2
|
-
<common-backup-storage-actions-add-steps-name-and-configure-new
|
3
|
-
v-if="isNewView"
|
4
|
-
v-model="formModel"
|
5
|
-
v-model:alert-info="isShowAlertInfo"
|
6
|
-
:alert-messages="props.alertMessages"
|
7
|
-
:messages-fields="props.messagesFields"
|
8
|
-
:is-disabled-name-field="props.isDisabledNameField"
|
9
|
-
/>
|
10
|
-
|
11
|
-
<common-backup-storage-actions-add-steps-name-and-configure-old
|
12
|
-
v-else
|
13
|
-
v-model="formModel"
|
14
|
-
v-model:alert-info="isShowAlertInfo"
|
15
|
-
:alert-messages="props.alertMessages"
|
16
|
-
:messages-fields="props.messagesFields"
|
17
|
-
@hide-alert="(e) => emits('hide-alert', e)"
|
18
|
-
/>
|
19
|
-
</template>
|
20
|
-
|
21
|
-
<script lang="ts" setup>
|
22
|
-
import type {
|
23
|
-
import type {
|
24
|
-
|
25
|
-
|
26
|
-
const
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
36
|
-
|
37
|
-
const
|
38
|
-
|
39
|
-
const
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
<style lang="scss" scoped></style>
|
1
|
+
<template>
|
2
|
+
<common-backup-storage-actions-add-steps-name-and-configure-new
|
3
|
+
v-if="isNewView"
|
4
|
+
v-model="formModel"
|
5
|
+
v-model:alert-info="isShowAlertInfo"
|
6
|
+
:alert-messages="props.alertMessages"
|
7
|
+
:messages-fields="props.messagesFields"
|
8
|
+
:is-disabled-name-field="props.isDisabledNameField"
|
9
|
+
/>
|
10
|
+
|
11
|
+
<common-backup-storage-actions-add-steps-name-and-configure-old
|
12
|
+
v-else
|
13
|
+
v-model="formModel"
|
14
|
+
v-model:alert-info="isShowAlertInfo"
|
15
|
+
:alert-messages="props.alertMessages"
|
16
|
+
:messages-fields="props.messagesFields"
|
17
|
+
@hide-alert="(e) => emits('hide-alert', e)"
|
18
|
+
/>
|
19
|
+
</template>
|
20
|
+
|
21
|
+
<script lang="ts" setup>
|
22
|
+
import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
|
23
|
+
import type { UI_I_CreateDatastoreForm } from '~/components/common/backup/storage/actions/add/lib/models/interfaces'
|
24
|
+
|
25
|
+
const formModel = defineModel<UI_I_CreateDatastoreForm>({ required: true })
|
26
|
+
const props = defineProps<{
|
27
|
+
alertMessages: string[]
|
28
|
+
messagesFields: UI_I_WizardStep['fields']
|
29
|
+
isDisabledNameField?: boolean
|
30
|
+
}>()
|
31
|
+
const emits = defineEmits<{
|
32
|
+
(event: 'hide-alert', value: number): void
|
33
|
+
}>()
|
34
|
+
|
35
|
+
const { $store }: any = useNuxtApp()
|
36
|
+
|
37
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
38
|
+
|
39
|
+
const isShowAlertInfo = ref<boolean>(true)
|
40
|
+
</script>
|
41
|
+
|
42
|
+
<style lang="scss" scoped></style>
|