bfg-common 1.3.457 → 1.3.459
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.
|
@@ -172,7 +172,16 @@ const checkName = async (
|
|
|
172
172
|
wizard: Wizard
|
|
173
173
|
// emits: UI_I_AddNetworkingEmits
|
|
174
174
|
): Promise<UI_I_AsyncCheckReturn> => {
|
|
175
|
-
|
|
175
|
+
const typeCode = form.value.type_code
|
|
176
|
+
|
|
177
|
+
let help = typeCode === 1
|
|
178
|
+
if (typeCode === 2) {
|
|
179
|
+
help = form.value.lunDisk.length
|
|
180
|
+
}
|
|
181
|
+
if (typeCode === 4) {
|
|
182
|
+
help = form.value.folder && form.value.server
|
|
183
|
+
}
|
|
184
|
+
if (label && help) {
|
|
176
185
|
return new Promise((resolve, _reject) =>
|
|
177
186
|
checkValidityName(label, wizard, (message: string) => {
|
|
178
187
|
resolve({
|
|
@@ -184,7 +193,7 @@ const checkName = async (
|
|
|
184
193
|
} else {
|
|
185
194
|
return {
|
|
186
195
|
isValid: false,
|
|
187
|
-
message: localization.specifyDatastoreName,
|
|
196
|
+
message: !label ? localization.specifyDatastoreName : '',
|
|
188
197
|
}
|
|
189
198
|
}
|
|
190
199
|
}
|
|
@@ -217,51 +226,21 @@ const checkDatastoreNameAsync = async (
|
|
|
217
226
|
stepHasError,
|
|
218
227
|
}
|
|
219
228
|
}
|
|
220
|
-
|
|
221
|
-
const checkNameAndDevice = async (
|
|
222
|
-
form: any,
|
|
223
|
-
localization: UI_I_Localization,
|
|
224
|
-
wizard: Wizard
|
|
225
|
-
// emits: UI_I_AddNetworkingEmits
|
|
226
|
-
): Promise<UI_I_AsyncCheckReturn> => {
|
|
227
|
-
if (form.name && form.lunDisk.length) {
|
|
228
|
-
return new Promise((resolve, _reject) =>
|
|
229
|
-
checkValidityName(form.name, wizard, (message: string) => {
|
|
230
|
-
resolve({
|
|
231
|
-
isValid: message === '',
|
|
232
|
-
message: message === '' ? '' : message,
|
|
233
|
-
})
|
|
234
|
-
})
|
|
235
|
-
)
|
|
236
|
-
} else {
|
|
237
|
-
return {
|
|
238
|
-
isValid: false,
|
|
239
|
-
message: !form.name
|
|
240
|
-
? localization.specifyDatastoreName
|
|
241
|
-
: localization.selectHostToContinueAlert,
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
const checkNameAndDeviceAsync = async (
|
|
229
|
+
const checkNfsFolderSync = (
|
|
246
230
|
localization: UI_I_Localization,
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
):
|
|
231
|
+
name: string,
|
|
232
|
+
wizard: Wizard,
|
|
233
|
+
value: UI_I_WizardStep[]
|
|
234
|
+
): UI_I_ValidationReturn => {
|
|
251
235
|
let stepHasError = false
|
|
252
236
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
if (!labelValidation.isValid) {
|
|
259
|
-
stepHasError = wizard.setValidation(2, 'datastoreName', {
|
|
260
|
-
fieldMessage: labelValidation.message,
|
|
261
|
-
alertMessage: form.name ? labelValidation.message : '',
|
|
237
|
+
if (!name) {
|
|
238
|
+
stepHasError = wizard.setValidation(5, 'folder', {
|
|
239
|
+
fieldMessage: localization.specifyFolderName,
|
|
240
|
+
alertMessage: '',
|
|
262
241
|
})
|
|
263
|
-
} else if (wizard.hasMessage(
|
|
264
|
-
value = wizard.removeValidation(
|
|
242
|
+
} else if (wizard.hasMessage(5, 'folder')) {
|
|
243
|
+
value = wizard.removeValidation(5, 'folder', value)
|
|
265
244
|
}
|
|
266
245
|
|
|
267
246
|
return {
|
|
@@ -269,8 +248,7 @@ const checkNameAndDeviceAsync = async (
|
|
|
269
248
|
stepHasError,
|
|
270
249
|
}
|
|
271
250
|
}
|
|
272
|
-
|
|
273
|
-
const checkNfsFolderSync = (
|
|
251
|
+
const checkNfsServerSync = (
|
|
274
252
|
localization: UI_I_Localization,
|
|
275
253
|
name: string,
|
|
276
254
|
wizard: Wizard,
|
|
@@ -279,12 +257,12 @@ const checkNfsFolderSync = (
|
|
|
279
257
|
let stepHasError = false
|
|
280
258
|
|
|
281
259
|
if (!name) {
|
|
282
|
-
stepHasError = wizard.setValidation(5, '
|
|
283
|
-
fieldMessage: localization.
|
|
260
|
+
stepHasError = wizard.setValidation(5, 'server', {
|
|
261
|
+
fieldMessage: localization.specifyServerName,
|
|
284
262
|
alertMessage: '',
|
|
285
263
|
})
|
|
286
|
-
} else if (wizard.hasMessage(5, '
|
|
287
|
-
value = wizard.removeValidation(5, '
|
|
264
|
+
} else if (wizard.hasMessage(5, 'server')) {
|
|
265
|
+
value = wizard.removeValidation(5, 'server', value)
|
|
288
266
|
}
|
|
289
267
|
|
|
290
268
|
return {
|
|
@@ -316,15 +294,19 @@ const validationFunc = async (
|
|
|
316
294
|
}
|
|
317
295
|
|
|
318
296
|
if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
|
|
319
|
-
const nameValidation = await
|
|
297
|
+
const nameValidation = await checkDatastoreNameAsync(
|
|
320
298
|
localization.value,
|
|
321
299
|
value,
|
|
322
|
-
form.value,
|
|
300
|
+
form.value.name,
|
|
301
|
+
2,
|
|
302
|
+
'datastoreName',
|
|
323
303
|
wizard
|
|
324
304
|
)
|
|
325
305
|
|
|
326
306
|
value = nameValidation.newValue
|
|
327
307
|
|
|
308
|
+
//selectHostToContinueAlert
|
|
309
|
+
|
|
328
310
|
stepHasError = nameValidation.stepHasError
|
|
329
311
|
}
|
|
330
312
|
|
|
@@ -347,7 +329,17 @@ const validationFunc = async (
|
|
|
347
329
|
value
|
|
348
330
|
)
|
|
349
331
|
|
|
350
|
-
|
|
332
|
+
const serverValidation = checkNfsServerSync(
|
|
333
|
+
localization.value,
|
|
334
|
+
form.value.server,
|
|
335
|
+
wizard,
|
|
336
|
+
value
|
|
337
|
+
)
|
|
338
|
+
|
|
339
|
+
stepHasError =
|
|
340
|
+
nameValidation.stepHasError ||
|
|
341
|
+
folderValidation.stepHasError ||
|
|
342
|
+
serverValidation.stepHasError
|
|
351
343
|
}
|
|
352
344
|
|
|
353
345
|
return {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
:project="props.project"
|
|
12
12
|
:alert-messages="props.alertMessages"
|
|
13
13
|
:messages-fields="props.messagesFields"
|
|
14
|
+
@hide-alert="(e) => emits('hide-alert', e)"
|
|
14
15
|
@next="onChangeConfigurationAndNext"
|
|
15
16
|
/>
|
|
16
17
|
|
|
@@ -49,6 +50,7 @@ const props = defineProps<{
|
|
|
49
50
|
}>()
|
|
50
51
|
const model = defineModel<any>()
|
|
51
52
|
const emits = defineEmits<{
|
|
53
|
+
(event: 'hide-alert', value: number): void
|
|
52
54
|
(event: 'submit', value: UI_I_ConfigurationSendDataNfs): void
|
|
53
55
|
}>()
|
|
54
56
|
|