bfg-common 1.5.790 → 1.5.792
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/configure/advancedSystemSettings/tableView/old/Old.vue +9 -3
- package/components/common/configure/advancedSystemSettings/tableView/old/field/Field.vue +30 -26
- package/components/common/configure/advancedSystemSettings/tableView/old/lib/config/table.ts +8 -10
- package/components/common/configure/advancedSystemSettings/tableView/old/lib/models/interfaces.ts +10 -0
- package/components/common/pages/backups/modals/restore/Old.vue +2 -2
- package/components/common/pages/backups/modals/restore/Restore.vue +30 -1
- package/components/common/pages/backups/modals/restore/lib/config/readyToCompleteOptions.ts +96 -94
- package/components/common/pages/backups/modals/restore/lib/config/steps.ts +134 -130
- package/components/common/pages/backups/modals/restore/validation/validation.ts +4 -4
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
>
|
|
15
15
|
<template #value="{ item }">
|
|
16
16
|
<common-configure-advanced-system-settings-table-view-old-field
|
|
17
|
-
:
|
|
17
|
+
:data="item.data"
|
|
18
18
|
@change="onChangeSetting($event, item.data.key)"
|
|
19
19
|
@error-message="onUpdateInvalidFields($event, item.data.key)"
|
|
20
20
|
/>
|
|
@@ -38,6 +38,7 @@ import type {
|
|
|
38
38
|
UI_I_Pagination,
|
|
39
39
|
} from '~/lib/models/table/interfaces'
|
|
40
40
|
import type { UI_I_AdvancedSystemSetting } from '~/store/inventory/modules/configure/advancedSystemSettings/lib/models/interfaces'
|
|
41
|
+
import type { UI_I_AdvancedSystemSettingsEditData } from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/models/interfaces'
|
|
41
42
|
import * as table from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/config/table'
|
|
42
43
|
|
|
43
44
|
const settings = defineModel<API_UI_I_DataTable<UI_I_AdvancedSystemSetting[]>>(
|
|
@@ -57,7 +58,10 @@ const props = defineProps<{
|
|
|
57
58
|
|
|
58
59
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
59
60
|
|
|
60
|
-
const onChangeSetting = (
|
|
61
|
+
const onChangeSetting = (
|
|
62
|
+
value: UI_I_AdvancedSystemSettingsEditData['value'],
|
|
63
|
+
key: string
|
|
64
|
+
): void => {
|
|
61
65
|
settings.value.items = settings.value.items.map((item) => {
|
|
62
66
|
if (item.key === key) {
|
|
63
67
|
item.value = value
|
|
@@ -70,7 +74,9 @@ const invalidFieldsLocal = ref<UI_I_ArbitraryObject<string>>({})
|
|
|
70
74
|
const onUpdateInvalidFields = (value: string, key: string): void => {
|
|
71
75
|
invalidFieldsLocal.value[key] = value
|
|
72
76
|
if (invalidFields.value)
|
|
73
|
-
invalidFields.value = Object.values(invalidFieldsLocal.value).filter(
|
|
77
|
+
invalidFields.value = Object.values(invalidFieldsLocal.value).filter(
|
|
78
|
+
(error) => error
|
|
79
|
+
)
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
const paginationLocal = ref<UI_I_Pagination>({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<atoms-tooltip-error :has-error="invalid">
|
|
3
3
|
<template #elem>
|
|
4
|
-
<div v-if="props.
|
|
4
|
+
<div v-if="props.data.type === 'number'">
|
|
5
5
|
<input
|
|
6
6
|
v-model="valueLocal"
|
|
7
7
|
type="number"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
@input="onChangeSetting($event)"
|
|
10
10
|
/>
|
|
11
11
|
</div>
|
|
12
|
-
<div v-if="props.
|
|
12
|
+
<div v-if="props.data.type === 'string'">
|
|
13
13
|
<input
|
|
14
14
|
v-model="valueLocal"
|
|
15
15
|
type="text"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
@input="onChangeSetting($event)"
|
|
18
18
|
/>
|
|
19
19
|
</div>
|
|
20
|
-
<div v-if="props.
|
|
20
|
+
<div v-if="props.data.type === 'boolean'" class="select">
|
|
21
21
|
<select
|
|
22
22
|
v-model="valueLocal"
|
|
23
23
|
@change="onChangeSetting($event)"
|
|
@@ -27,21 +27,21 @@
|
|
|
27
27
|
<option value="true">true</option>
|
|
28
28
|
</select>
|
|
29
29
|
</div>
|
|
30
|
-
<div v-if="props.
|
|
31
|
-
<select
|
|
32
|
-
v-model="valueLocal"
|
|
33
|
-
@change="onChangeSetting($event)"
|
|
34
|
-
:class="{ 'has-error': invalid }"
|
|
35
|
-
|
|
36
|
-
<option
|
|
37
|
-
v-for="item2 in props.
|
|
38
|
-
:key="item2.key"
|
|
39
|
-
:value="item2.key"
|
|
40
|
-
|
|
41
|
-
{{ item2.value }}
|
|
42
|
-
</option
|
|
43
|
-
</select
|
|
44
|
-
</div
|
|
30
|
+
<!-- <div v-if="props.data.type === 'select'" class="select">-->
|
|
31
|
+
<!-- <select-->
|
|
32
|
+
<!-- v-model="valueLocal"-->
|
|
33
|
+
<!-- @change="onChangeSetting($event)"-->
|
|
34
|
+
<!-- :class="{ 'has-error': invalid }"-->
|
|
35
|
+
<!-- >-->
|
|
36
|
+
<!-- <option-->
|
|
37
|
+
<!-- v-for="item2 in props.data.options"-->
|
|
38
|
+
<!-- :key="item2.key"-->
|
|
39
|
+
<!-- :value="item2.key"-->
|
|
40
|
+
<!-- >-->
|
|
41
|
+
<!-- {{ item2.value }}-->
|
|
42
|
+
<!-- </option>-->
|
|
43
|
+
<!-- </select>-->
|
|
44
|
+
<!-- </div>-->
|
|
45
45
|
</template>
|
|
46
46
|
<template #content>
|
|
47
47
|
{{ errorMessage }}
|
|
@@ -50,31 +50,35 @@
|
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
52
|
<script setup lang="ts">
|
|
53
|
+
import type {
|
|
54
|
+
UI_I_AdvancedSystemSettingsEditData
|
|
55
|
+
} from "~/components/common/configure/advancedSystemSettings/tableView/old/lib/models/interfaces";
|
|
53
56
|
import { E_Format } from '~/components/common/configure/advancedSystemSettings/tableView/old/field/lib/models/enums'
|
|
54
57
|
import { allRegExp } from '~/lib/config/regExp'
|
|
55
58
|
|
|
56
59
|
const props = defineProps<{
|
|
57
|
-
|
|
60
|
+
data: UI_I_AdvancedSystemSettingsEditData
|
|
58
61
|
}>()
|
|
59
62
|
const emits = defineEmits<{
|
|
60
|
-
(event: 'change', value:
|
|
63
|
+
(event: 'change', value: UI_I_AdvancedSystemSettingsEditData['value']): void
|
|
61
64
|
(event: 'error-message', value: string): void
|
|
62
65
|
}>()
|
|
63
66
|
|
|
64
|
-
const valueLocal = ref<
|
|
67
|
+
const valueLocal = ref<UI_I_AdvancedSystemSettingsEditData['value']>(props.data.value)
|
|
65
68
|
|
|
66
69
|
const invalid = ref<boolean>(false)
|
|
67
70
|
const errorMessage = ref<string>('')
|
|
68
71
|
|
|
69
|
-
const onChangeSetting = (event:
|
|
72
|
+
const onChangeSetting = (event: Event): void => {
|
|
70
73
|
invalid.value = false
|
|
71
74
|
errorMessage.value = ''
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (props.
|
|
76
|
+
const target = event.target as HTMLInputElement
|
|
77
|
+
let value: UI_I_AdvancedSystemSettingsEditData['value'] = target.value
|
|
78
|
+
if (props.data.type === 'boolean') value = !!value
|
|
79
|
+
if (props.data.type === 'number') value = +value
|
|
76
80
|
|
|
77
|
-
const { validation } = props.
|
|
81
|
+
const { validation } = props.data
|
|
78
82
|
if (Object.hasOwn(validation, 'equal')) {
|
|
79
83
|
invalid.value = !validation.equal.includes(value)
|
|
80
84
|
errorMessage.value = invalid.value
|
package/components/common/configure/advancedSystemSettings/tableView/old/lib/config/table.ts
CHANGED
|
@@ -87,17 +87,15 @@ export const bodyItems = (
|
|
|
87
87
|
type: item.type,
|
|
88
88
|
value: item.value,
|
|
89
89
|
validation: item.validation,
|
|
90
|
-
options: item.options,
|
|
91
|
-
invalid: false,
|
|
92
|
-
errorMessage: '',
|
|
90
|
+
// options: item.options,
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
let valueText = item[tableItemKeys[1]]
|
|
96
|
-
if (item.type === 'select') {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
93
|
+
// let valueText = item[tableItemKeys[1]]
|
|
94
|
+
// if (item.type === 'select') {
|
|
95
|
+
// valueText =
|
|
96
|
+
// item.options.find((option) => option.key === valueText)?.value ||
|
|
97
|
+
// valueText
|
|
98
|
+
// }
|
|
101
99
|
const cols = [
|
|
102
100
|
{
|
|
103
101
|
key: 'col0',
|
|
@@ -109,7 +107,7 @@ export const bodyItems = (
|
|
|
109
107
|
},
|
|
110
108
|
{
|
|
111
109
|
key: isEdit ? 'value' : 'col1',
|
|
112
|
-
text:
|
|
110
|
+
text: item[tableItemKeys[1]],
|
|
113
111
|
id: key,
|
|
114
112
|
testId: `advanced-system-settings-table-item-${key}${
|
|
115
113
|
isEdit ? '-edit' : ''
|
package/components/common/configure/advancedSystemSettings/tableView/old/lib/models/interfaces.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_AdvancedSystemSetting
|
|
3
|
+
} from "~/store/inventory/modules/configure/advancedSystemSettings/lib/models/interfaces";
|
|
4
|
+
|
|
5
|
+
export interface UI_I_AdvancedSystemSettingsEditData {
|
|
6
|
+
key: UI_I_AdvancedSystemSetting['key'];
|
|
7
|
+
type: UI_I_AdvancedSystemSetting['type'];
|
|
8
|
+
value: UI_I_AdvancedSystemSetting['value'];
|
|
9
|
+
validation: UI_I_AdvancedSystemSetting['validation'];
|
|
10
|
+
}
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
/>
|
|
56
56
|
|
|
57
57
|
<common-pages-backups-modals-restore-disks
|
|
58
|
-
v-
|
|
58
|
+
v-if="selectedStep.id === dynamicSteps.selectDisks"
|
|
59
59
|
v-model="model"
|
|
60
60
|
/>
|
|
61
61
|
<common-pages-backups-modals-restore-disks
|
|
62
|
-
v-
|
|
62
|
+
v-if="selectedStep.id === dynamicSteps.selectDisksForCopy"
|
|
63
63
|
v-model="model"
|
|
64
64
|
is-copy
|
|
65
65
|
/>
|
|
@@ -90,7 +90,35 @@ watch(
|
|
|
90
90
|
)
|
|
91
91
|
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
|
92
92
|
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
|
|
93
|
-
wizard.changeSteps(value, validationFunc)
|
|
93
|
+
wizard.changeSteps(value, validationFunc, finalValidationFunc)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const finalValidationFunc = async (
|
|
97
|
+
value: UI_I_WizardStep[]
|
|
98
|
+
): Promise<UI_I_ValidationReturn> => {
|
|
99
|
+
let stepHasError = false
|
|
100
|
+
|
|
101
|
+
if (model.value.restore_code === 3) {
|
|
102
|
+
// Все это сделано для генерации имени вм, если она не заведена
|
|
103
|
+
const data = await $store.dispatch('backup/A_CHECK_VALIDATION', {
|
|
104
|
+
pvm: model.value.pvm,
|
|
105
|
+
start: true
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
model.value.pvm.name = data.vm_desc.name
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// if (!data) {
|
|
112
|
+
// stepHasError = wizard.setValidation(dynamicSteps.selectStorage, 'storage', {
|
|
113
|
+
// fieldMessage: localization.value.common.selectStorage,
|
|
114
|
+
// alertMessage: localization.value.common.selectValidDestinationStorage,
|
|
115
|
+
// })
|
|
116
|
+
// }
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
stepHasError,
|
|
120
|
+
newValue: value,
|
|
121
|
+
}
|
|
94
122
|
}
|
|
95
123
|
|
|
96
124
|
const storageSubmit = ref<null | Function>(null)
|
|
@@ -235,6 +263,7 @@ const getPvm = async (): Promise<void> => {
|
|
|
235
263
|
})
|
|
236
264
|
|
|
237
265
|
model.value.pvm = useDeepCopy($store.getters['backup/getPvm'])
|
|
266
|
+
model.value.pvm.network_devices = model.value.pvm.network_devices || [] // Обрабатываем если null, так не нужно в многих местах делать проверки
|
|
238
267
|
|
|
239
268
|
loadingCount.value--
|
|
240
269
|
}
|
|
@@ -1,94 +1,96 @@
|
|
|
1
|
-
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
2
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
3
|
-
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
|
|
4
|
-
import { restoreCodes } from '~/components/common/pages/backups/modals/restore/lib/config/restoreCodes'
|
|
5
|
-
|
|
6
|
-
const getDisks = (
|
|
7
|
-
model: UI_I_RestoreForm,
|
|
8
|
-
localization: UI_I_Localization
|
|
9
|
-
): UI_I_TableInfoItem[] => {
|
|
10
|
-
const result: UI_I_TableInfoItem[] = []
|
|
11
|
-
|
|
12
|
-
model.pvm.disk_devices.forEach((disk_device, i) => {
|
|
13
|
-
if (!disk_device.source) return
|
|
14
|
-
|
|
15
|
-
result.push({
|
|
16
|
-
label: `${localization.common.disk} ${i}`,
|
|
17
|
-
value: disk_device.source,
|
|
18
|
-
iconClassName: 'icon-vSphere-dsVmDisk',
|
|
19
|
-
})
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
return result
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const readyToCompleteOptions = (
|
|
26
|
-
model: UI_I_RestoreForm,
|
|
27
|
-
localization: UI_I_Localization,
|
|
28
|
-
selectedStorageName: string
|
|
29
|
-
): UI_I_TableInfoItem[] => {
|
|
30
|
-
const result: UI_I_TableInfoItem[] = []
|
|
31
|
-
|
|
32
|
-
switch (model.restore_code) {
|
|
33
|
-
case restoreCodes.diskOnly:
|
|
34
|
-
result.push({
|
|
35
|
-
label: localization.common.backup,
|
|
36
|
-
value: model.backup,
|
|
37
|
-
iconClassName: 'icon-backup',
|
|
38
|
-
})
|
|
39
|
-
// Disks
|
|
40
|
-
result.push(...getDisks(model, localization))
|
|
41
|
-
break
|
|
42
|
-
case restoreCodes.existing:
|
|
43
|
-
result.push({
|
|
44
|
-
label: localization.common.backup,
|
|
45
|
-
value: model.backup,
|
|
46
|
-
iconClassName: 'icon-backup',
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
1
|
+
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
3
|
+
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
|
|
4
|
+
import { restoreCodes } from '~/components/common/pages/backups/modals/restore/lib/config/restoreCodes'
|
|
5
|
+
|
|
6
|
+
const getDisks = (
|
|
7
|
+
model: UI_I_RestoreForm,
|
|
8
|
+
localization: UI_I_Localization
|
|
9
|
+
): UI_I_TableInfoItem[] => {
|
|
10
|
+
const result: UI_I_TableInfoItem[] = []
|
|
11
|
+
|
|
12
|
+
model.pvm.disk_devices.forEach((disk_device, i) => {
|
|
13
|
+
if (!disk_device.source) return
|
|
14
|
+
|
|
15
|
+
result.push({
|
|
16
|
+
label: `${localization.common.disk} ${i}`,
|
|
17
|
+
value: disk_device.source,
|
|
18
|
+
iconClassName: 'icon-vSphere-dsVmDisk',
|
|
19
|
+
})
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
return result
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const readyToCompleteOptions = (
|
|
26
|
+
model: UI_I_RestoreForm,
|
|
27
|
+
localization: UI_I_Localization,
|
|
28
|
+
selectedStorageName: string
|
|
29
|
+
): UI_I_TableInfoItem[] => {
|
|
30
|
+
const result: UI_I_TableInfoItem[] = []
|
|
31
|
+
|
|
32
|
+
switch (model.restore_code) {
|
|
33
|
+
case restoreCodes.diskOnly:
|
|
34
|
+
result.push({
|
|
35
|
+
label: localization.common.backup,
|
|
36
|
+
value: model.backup,
|
|
37
|
+
iconClassName: 'icon-backup',
|
|
38
|
+
})
|
|
39
|
+
// Disks
|
|
40
|
+
result.push(...getDisks(model, localization))
|
|
41
|
+
break
|
|
42
|
+
case restoreCodes.existing:
|
|
43
|
+
result.push({
|
|
44
|
+
label: localization.common.backup,
|
|
45
|
+
value: model.backup,
|
|
46
|
+
iconClassName: 'icon-backup',
|
|
47
|
+
})
|
|
48
|
+
// Disks
|
|
49
|
+
result.push(...getDisks(model, localization))
|
|
50
|
+
break
|
|
51
|
+
case restoreCodes.asNew:
|
|
52
|
+
result.push({
|
|
53
|
+
label: localization.common.vmName,
|
|
54
|
+
value: model.pvm.name,
|
|
55
|
+
iconClassName: 'vsphere-icon-vm',
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
// Datastores
|
|
59
|
+
result.push({
|
|
60
|
+
label: localization.common.datastore,
|
|
61
|
+
value: selectedStorageName,
|
|
62
|
+
iconClassName: 'vsphere-icon-datastore',
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
// Disks
|
|
66
|
+
result.push(...getDisks(model, localization))
|
|
67
|
+
|
|
68
|
+
// Disks for Copy
|
|
69
|
+
model.copy_disks.forEach((disk_device, i) => {
|
|
70
|
+
result.push({
|
|
71
|
+
// label: `${localization.common.disk} ${i}`,
|
|
72
|
+
label: localization.backup.diskCopyN.replace('{0}', i.toString()),
|
|
73
|
+
value: disk_device.source,
|
|
74
|
+
iconClassName: 'icon-vSphere-dsVmDisk',
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
// Networks
|
|
79
|
+
model.pvm.network_devices.forEach((network) => {
|
|
80
|
+
result.push({
|
|
81
|
+
label: localization.common.network,
|
|
82
|
+
value: network.network,
|
|
83
|
+
iconClassName: 'vsphere-icon-network',
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
break
|
|
87
|
+
// case 1:
|
|
88
|
+
// result.push({
|
|
89
|
+
// label: localization.value.common.vmName,
|
|
90
|
+
// value: model.value.pvm.name,
|
|
91
|
+
// })
|
|
92
|
+
// break
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return result
|
|
96
|
+
}
|
|
@@ -1,130 +1,134 @@
|
|
|
1
|
-
import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
2
|
-
import { UI_E_WIZARD_STATUS } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/enums'
|
|
3
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
4
|
-
|
|
5
|
-
export const dynamicSteps = {
|
|
6
|
-
selectType: 0,
|
|
7
|
-
selectName: 1,
|
|
8
|
-
selectStorage: 2,
|
|
9
|
-
selectDisks: 3,
|
|
10
|
-
selectDisksForCopy: 4,
|
|
11
|
-
selectNetwork: 5,
|
|
12
|
-
readyComplete: 6,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const stepsFunc = (
|
|
16
|
-
localization: UI_I_Localization
|
|
17
|
-
): UI_I_WizardStep[] => {
|
|
18
|
-
return [
|
|
19
|
-
{
|
|
20
|
-
id: dynamicSteps.selectType,
|
|
21
|
-
stepName: '',
|
|
22
|
-
title: localization.backup.selectType,
|
|
23
|
-
subTitle: '',
|
|
24
|
-
status: UI_E_WIZARD_STATUS.SELECTED,
|
|
25
|
-
isValid: true,
|
|
26
|
-
fields: {},
|
|
27
|
-
testId: 'backup-restore-type',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: dynamicSteps.selectName,
|
|
31
|
-
stepName: '',
|
|
32
|
-
title: localization.common.selectName,
|
|
33
|
-
subTitle: localization.backup.restoreBackupSelectNameSubtitle,
|
|
34
|
-
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
35
|
-
isValid: true,
|
|
36
|
-
testId: 'backup-restore-select-name',
|
|
37
|
-
fields: {
|
|
38
|
-
name: {
|
|
39
|
-
field: '',
|
|
40
|
-
alert: '',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
id: dynamicSteps.selectStorage,
|
|
46
|
-
stepName: '',
|
|
47
|
-
title: localization.common.selectStorage,
|
|
48
|
-
subTitle: localization.common.selectStorageConfigurationDiskFiles2,
|
|
49
|
-
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
50
|
-
isValid: true,
|
|
51
|
-
testId: 'backup-restore-select-storage',
|
|
52
|
-
fields: {
|
|
53
|
-
storage: {
|
|
54
|
-
field: '',
|
|
55
|
-
alert: '',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: dynamicSteps.selectDisks,
|
|
61
|
-
stepName: '',
|
|
62
|
-
title: localization.common.selectDisks,
|
|
63
|
-
subTitle: localization.common.selectDisksInvolvedBackup,
|
|
64
|
-
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
65
|
-
isValid: true,
|
|
66
|
-
fields: {
|
|
67
|
-
disk_devices: {
|
|
68
|
-
field: '',
|
|
69
|
-
alert: '',
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
testId: 'backup-restore-select-disks',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
id: dynamicSteps.selectDisksForCopy,
|
|
76
|
-
stepName: '',
|
|
77
|
-
title: localization.common.selectDisksForCopy,
|
|
78
|
-
subTitle: localization.common.selectDisksInvolvedBackup,
|
|
79
|
-
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
80
|
-
isValid: true,
|
|
81
|
-
fields: {
|
|
82
|
-
disk_devices: {
|
|
83
|
-
field: '',
|
|
84
|
-
alert: '',
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
testId: 'backup-restore-select-disks-for-copy',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: dynamicSteps.selectNetwork,
|
|
91
|
-
stepName: '',
|
|
92
|
-
title: localization.common.selectNetwork,
|
|
93
|
-
subTitle: localization.backup.restoreBackupSelectNetworkSubtitle,
|
|
94
|
-
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
95
|
-
isValid: true,
|
|
96
|
-
testId: 'backup-restore-select-network',
|
|
97
|
-
fields: {},
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: dynamicSteps.readyComplete,
|
|
101
|
-
stepName: '',
|
|
102
|
-
title: localization.common.readyComplete,
|
|
103
|
-
subTitle: localization.backup.restoreBackupReviewSubtitle,
|
|
104
|
-
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
105
|
-
isValid: true,
|
|
106
|
-
testId: 'backup-restore-ready-complete',
|
|
107
|
-
fields: {},
|
|
108
|
-
},
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export const stepsSchemeInitial = [
|
|
113
|
-
// [0, 1, 5], // disk only
|
|
114
|
-
[
|
|
115
|
-
dynamicSteps.selectType,
|
|
116
|
-
dynamicSteps.selectDisks,
|
|
117
|
-
dynamicSteps.readyComplete,
|
|
118
|
-
], // disk only
|
|
119
|
-
// [dynamicSteps.selectType, dynamicSteps.readyComplete], // disk only
|
|
120
|
-
[
|
|
121
|
-
|
|
122
|
-
dynamicSteps.
|
|
123
|
-
dynamicSteps.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
dynamicSteps.
|
|
127
|
-
dynamicSteps.
|
|
128
|
-
dynamicSteps.
|
|
129
|
-
|
|
130
|
-
|
|
1
|
+
import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
2
|
+
import { UI_E_WIZARD_STATUS } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/enums'
|
|
3
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
4
|
+
|
|
5
|
+
export const dynamicSteps = {
|
|
6
|
+
selectType: 0,
|
|
7
|
+
selectName: 1,
|
|
8
|
+
selectStorage: 2,
|
|
9
|
+
selectDisks: 3,
|
|
10
|
+
selectDisksForCopy: 4,
|
|
11
|
+
selectNetwork: 5,
|
|
12
|
+
readyComplete: 6,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const stepsFunc = (
|
|
16
|
+
localization: UI_I_Localization
|
|
17
|
+
): UI_I_WizardStep[] => {
|
|
18
|
+
return [
|
|
19
|
+
{
|
|
20
|
+
id: dynamicSteps.selectType,
|
|
21
|
+
stepName: '',
|
|
22
|
+
title: localization.backup.selectType,
|
|
23
|
+
subTitle: '',
|
|
24
|
+
status: UI_E_WIZARD_STATUS.SELECTED,
|
|
25
|
+
isValid: true,
|
|
26
|
+
fields: {},
|
|
27
|
+
testId: 'backup-restore-type',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: dynamicSteps.selectName,
|
|
31
|
+
stepName: '',
|
|
32
|
+
title: localization.common.selectName,
|
|
33
|
+
subTitle: localization.backup.restoreBackupSelectNameSubtitle,
|
|
34
|
+
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
35
|
+
isValid: true,
|
|
36
|
+
testId: 'backup-restore-select-name',
|
|
37
|
+
fields: {
|
|
38
|
+
name: {
|
|
39
|
+
field: '',
|
|
40
|
+
alert: '',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: dynamicSteps.selectStorage,
|
|
46
|
+
stepName: '',
|
|
47
|
+
title: localization.common.selectStorage,
|
|
48
|
+
subTitle: localization.common.selectStorageConfigurationDiskFiles2,
|
|
49
|
+
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
50
|
+
isValid: true,
|
|
51
|
+
testId: 'backup-restore-select-storage',
|
|
52
|
+
fields: {
|
|
53
|
+
storage: {
|
|
54
|
+
field: '',
|
|
55
|
+
alert: '',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: dynamicSteps.selectDisks,
|
|
61
|
+
stepName: '',
|
|
62
|
+
title: localization.common.selectDisks,
|
|
63
|
+
subTitle: localization.common.selectDisksInvolvedBackup,
|
|
64
|
+
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
65
|
+
isValid: true,
|
|
66
|
+
fields: {
|
|
67
|
+
disk_devices: {
|
|
68
|
+
field: '',
|
|
69
|
+
alert: '',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
testId: 'backup-restore-select-disks',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: dynamicSteps.selectDisksForCopy,
|
|
76
|
+
stepName: '',
|
|
77
|
+
title: localization.common.selectDisksForCopy,
|
|
78
|
+
subTitle: localization.common.selectDisksInvolvedBackup,
|
|
79
|
+
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
80
|
+
isValid: true,
|
|
81
|
+
fields: {
|
|
82
|
+
disk_devices: {
|
|
83
|
+
field: '',
|
|
84
|
+
alert: '',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
testId: 'backup-restore-select-disks-for-copy',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: dynamicSteps.selectNetwork,
|
|
91
|
+
stepName: '',
|
|
92
|
+
title: localization.common.selectNetwork,
|
|
93
|
+
subTitle: localization.backup.restoreBackupSelectNetworkSubtitle,
|
|
94
|
+
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
95
|
+
isValid: true,
|
|
96
|
+
testId: 'backup-restore-select-network',
|
|
97
|
+
fields: {},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: dynamicSteps.readyComplete,
|
|
101
|
+
stepName: '',
|
|
102
|
+
title: localization.common.readyComplete,
|
|
103
|
+
subTitle: localization.backup.restoreBackupReviewSubtitle,
|
|
104
|
+
status: UI_E_WIZARD_STATUS.INACTIVE,
|
|
105
|
+
isValid: true,
|
|
106
|
+
testId: 'backup-restore-ready-complete',
|
|
107
|
+
fields: {},
|
|
108
|
+
},
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const stepsSchemeInitial = [
|
|
113
|
+
// [0, 1, 5], // disk only
|
|
114
|
+
[
|
|
115
|
+
dynamicSteps.selectType,
|
|
116
|
+
dynamicSteps.selectDisks,
|
|
117
|
+
dynamicSteps.readyComplete,
|
|
118
|
+
], // disk only
|
|
119
|
+
// [dynamicSteps.selectType, dynamicSteps.readyComplete], // disk only
|
|
120
|
+
[
|
|
121
|
+
dynamicSteps.selectType,
|
|
122
|
+
dynamicSteps.selectDisks,
|
|
123
|
+
dynamicSteps.readyComplete,
|
|
124
|
+
], // existing
|
|
125
|
+
[
|
|
126
|
+
dynamicSteps.selectType,
|
|
127
|
+
dynamicSteps.selectName,
|
|
128
|
+
dynamicSteps.selectStorage,
|
|
129
|
+
dynamicSteps.selectDisks,
|
|
130
|
+
dynamicSteps.selectDisksForCopy,
|
|
131
|
+
dynamicSteps.selectNetwork,
|
|
132
|
+
dynamicSteps.readyComplete,
|
|
133
|
+
], // as new
|
|
134
|
+
]
|
|
@@ -20,10 +20,10 @@ export const checkNameValidation = async (
|
|
|
20
20
|
let stepErrorMessage = ''
|
|
21
21
|
|
|
22
22
|
if (!name) {
|
|
23
|
-
stepHasError = wizard.setValidation(dynamicSteps.selectName, 'name', {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
})
|
|
23
|
+
// stepHasError = wizard.setValidation(dynamicSteps.selectName, 'name', {
|
|
24
|
+
// fieldMessage: localization.common.fieldRequired,
|
|
25
|
+
// alertMessage: localization.common.emptyNameValidationDescription,
|
|
26
|
+
// })
|
|
27
27
|
return { stepHasError, newValue: value }
|
|
28
28
|
}
|
|
29
29
|
|