bfg-common 1.5.516 → 1.5.518
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 +2 -1
- package/assets/localization/local_en.json +2 -1
- package/assets/localization/local_hy.json +2 -1
- package/assets/localization/local_kk.json +2 -1
- package/assets/localization/local_ru.json +2 -1
- package/assets/localization/local_zh.json +2 -1
- package/components/atoms/sortableView/SortableView.vue +2 -2
- package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +195 -195
- package/components/common/pages/backups/modals/createBackup/New.vue +267 -267
- package/components/common/pages/backups/modals/createBackup/configuration/Configuration.vue +29 -29
- package/components/common/pages/backups/modals/createBackup/datastores/Datastores.vue +34 -34
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/TableView.vue +1 -1
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/old/TableView.vue +95 -95
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/old/lib/config/keys.ts +14 -14
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/old/lib/config/table.ts +127 -127
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/old/lib/models/types.ts +10 -10
- package/components/common/pages/backups/modals/createBackup/disks/Disks.vue +34 -34
- package/components/common/pages/backups/modals/createBackup/disks/tableView/new/TableView.vue +2 -2
- package/components/common/pages/backups/modals/createBackup/disks/tableView/old/TableView.vue +119 -119
- package/components/common/pages/backups/modals/createBackup/disks/tableView/old/lib/config/keys.ts +12 -12
- package/components/common/pages/backups/modals/createBackup/disks/tableView/old/lib/config/table.ts +125 -125
- package/components/common/pages/backups/modals/createBackup/disks/tableView/old/lib/models/types.ts +10 -10
- package/components/common/pages/backups/modals/createBackup/general/General.vue +33 -33
- package/components/common/pages/backups/modals/createBackup/general/GeneralNew.vue +1 -1
- package/components/common/pages/backups/modals/createBackup/lib/config/steps.ts +123 -123
- package/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions.ts +13 -13
- package/components/common/pages/backups/modals/createBackup/lib/validation/validations.ts +1 -1
- package/package.json +1 -1
|
@@ -2479,7 +2479,8 @@
|
|
|
2479
2479
|
"specifyValidHostDestinationComputeResource": "Укажыце сапраўдны хост як мэтавы вылічальны рэсурс.",
|
|
2480
2480
|
"selectValidHostDestinationComputeResource": "Выберыце сапраўдны хост як мэтавы вылічальны рэсурс.",
|
|
2481
2481
|
"generalSettings": "Агульныя налады",
|
|
2482
|
-
"configureBackupStrategyAndBandwidth": "Канфігурацыя старатэгіі і прывядкі"
|
|
2482
|
+
"configureBackupStrategyAndBandwidth": "Канфігурацыя старатэгіі і прывядкі",
|
|
2483
|
+
"editTheNotesFor": "Рэдагаваць нататкі для "
|
|
2483
2484
|
},
|
|
2484
2485
|
"auth": {
|
|
2485
2486
|
"welcomeTo": "Сардэчна запрашаем у",
|
|
@@ -2483,7 +2483,8 @@
|
|
|
2483
2483
|
"specifyValidHostDestinationComputeResource": "Specify a valid host as destination compute resource.",
|
|
2484
2484
|
"selectValidHostDestinationComputeResource": "Select a valid host as destination compute resource.",
|
|
2485
2485
|
"generalSettings": "General Settings",
|
|
2486
|
-
"configureBackupStrategyAndBandwidth": "Configure backup strategy and bandwidth limits."
|
|
2486
|
+
"configureBackupStrategyAndBandwidth": "Configure backup strategy and bandwidth limits.",
|
|
2487
|
+
"editTheNotesFor": "Edit the notes for "
|
|
2487
2488
|
},
|
|
2488
2489
|
"auth": {
|
|
2489
2490
|
"welcomeTo": "Welcome to",
|
|
@@ -2483,7 +2483,8 @@
|
|
|
2483
2483
|
"specifyValidHostDestinationComputeResource": "Նշեք վավեր հոստ՝ որպես նպատակային հաշվարկային ռեսուրս։",
|
|
2484
2484
|
"selectValidHostDestinationComputeResource": "Ընտրեք վավեր հոստ՝ որպես նպատակային հաշվարկային ռեսուրս։",
|
|
2485
2485
|
"generalSettings": "Ընդհանուր պարամետրեր",
|
|
2486
|
-
"configureBackupStrategyAndBandwidth": "Կարգավորել պահուստավորման ռազմավարությունը և թողունակության սահմանաչափերը։"
|
|
2486
|
+
"configureBackupStrategyAndBandwidth": "Կարգավորել պահուստավորման ռազմավարությունը և թողունակության սահմանաչափերը։",
|
|
2487
|
+
"editTheNotesFor": "Խմբագրել գրառումները "
|
|
2487
2488
|
},
|
|
2488
2489
|
"auth": {
|
|
2489
2490
|
"welcomeTo": "Բարի գալուստ",
|
|
@@ -2482,7 +2482,8 @@
|
|
|
2482
2482
|
"specifyValidHostDestinationComputeResource": "Мақсатты есептеу ресурсы ретінде жарамды хостты көрсетіңіз.",
|
|
2483
2483
|
"selectValidHostDestinationComputeResource": "Мақсатты есептеу ресурсы ретінде жарамды хостты таңдаңыз.",
|
|
2484
2484
|
"generalSettings": "Жалпы Параметрлер",
|
|
2485
|
-
"configureBackupStrategyAndBandwidth": "Сақтық көшірме жасау стратегиясы мен өткізу қабілеттілігі шектеулерін конфигурациялаңыз."
|
|
2485
|
+
"configureBackupStrategyAndBandwidth": "Сақтық көшірме жасау стратегиясы мен өткізу қабілеттілігі шектеулерін конфигурациялаңыз.",
|
|
2486
|
+
"editTheNotesFor": "Үшін жазбаларды өңдеңіз "
|
|
2486
2487
|
},
|
|
2487
2488
|
"auth": {
|
|
2488
2489
|
"welcomeTo": "Қош келдіңіз",
|
|
@@ -2482,7 +2482,8 @@
|
|
|
2482
2482
|
"specifyValidHostDestinationComputeResource": "Укажите допустимый хост в качестве целевого вычислительного ресурса.",
|
|
2483
2483
|
"selectValidHostDestinationComputeResource": "Выберите допустимый хост в качестве целевого вычислительного ресурса.",
|
|
2484
2484
|
"generalSettings": "Общие настройки",
|
|
2485
|
-
"configureBackupStrategyAndBandwidth": "Настройте стратегию резервного копирования и ограничения пропускной способности."
|
|
2485
|
+
"configureBackupStrategyAndBandwidth": "Настройте стратегию резервного копирования и ограничения пропускной способности.",
|
|
2486
|
+
"editTheNotesFor": "Редактирование заметки для "
|
|
2486
2487
|
},
|
|
2487
2488
|
"auth": {
|
|
2488
2489
|
"welcomeTo": "Добро пожаловать в",
|
|
@@ -2480,7 +2480,8 @@
|
|
|
2480
2480
|
"specifyValidHostDestinationComputeResource": "请指定一个有效的主机作为目标计算资源。",
|
|
2481
2481
|
"selectValidHostDestinationComputeResource": "请选择一个有效的主机作为目标计算资源。",
|
|
2482
2482
|
"generalSettings": "常规设置",
|
|
2483
|
-
"configureBackupStrategyAndBandwidth": "配置备份策略和带宽限制。"
|
|
2483
|
+
"configureBackupStrategyAndBandwidth": "配置备份策略和带宽限制。",
|
|
2484
|
+
"editTheNotesFor": "编辑笔记 "
|
|
2484
2485
|
},
|
|
2485
2486
|
"auth": {
|
|
2486
2487
|
"welcomeTo": "欢迎来到",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
:class="['portlet-js portlet-container', themeMode]"
|
|
17
17
|
:data-id="item.id"
|
|
18
18
|
:style="item.id === draggedPortletId && style"
|
|
19
|
-
@mousedown
|
|
19
|
+
@mousedown="onmousedown($event, item)"
|
|
20
20
|
>
|
|
21
21
|
<slot :portlet-id="item.id"></slot>
|
|
22
22
|
</div>
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
:class="['portlet-js portlet-container', themeMode]"
|
|
58
58
|
:data-id="item.id"
|
|
59
59
|
:style="item.id === draggedPortletId && style"
|
|
60
|
-
@mousedown
|
|
60
|
+
@mousedown="onmousedown($event, item)"
|
|
61
61
|
>
|
|
62
62
|
<slot :portlet-id="item.id"></slot>
|
|
63
63
|
</div>
|
|
@@ -1,196 +1,196 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<common-pages-backups-modals-create-backup-new
|
|
3
|
-
v-if="isNewView"
|
|
4
|
-
v-model="backupForm"
|
|
5
|
-
v-model:scheduler-form="schedulerForm"
|
|
6
|
-
:wizard="wizard"
|
|
7
|
-
:selected-scheme="selectedScheme"
|
|
8
|
-
:alert-messages="alertMessages"
|
|
9
|
-
:title="title"
|
|
10
|
-
:is-scheduled-tasks="props.isScheduledTasks"
|
|
11
|
-
:is-edit-scheduled-tasks="props.isEditScheduledTasks"
|
|
12
|
-
:target="props.target"
|
|
13
|
-
:selected-vm-name="props.selectedVmName"
|
|
14
|
-
:disks="props.disks"
|
|
15
|
-
:disks-loading="props.disksLoading"
|
|
16
|
-
:datastore-table="props.datastoreTable"
|
|
17
|
-
:datastore-table-loading="props.datastoreTableLoading"
|
|
18
|
-
:ready-to-complete-data="readyToCompleteInfo"
|
|
19
|
-
@change-steps="onChangeSteps"
|
|
20
|
-
@submit="emits('finish')"
|
|
21
|
-
@hide="emits('hide')"
|
|
22
|
-
/>
|
|
23
|
-
<common-pages-backups-modals-create-backup-old
|
|
24
|
-
v-else
|
|
25
|
-
v-model="backupForm"
|
|
26
|
-
v-model:scheduler-form="schedulerForm"
|
|
27
|
-
:wizard="wizard"
|
|
28
|
-
:selected-scheme="selectedScheme"
|
|
29
|
-
:alert-messages="alertMessages"
|
|
30
|
-
:title="title"
|
|
31
|
-
:alert-errors="errors"
|
|
32
|
-
:is-scheduled-tasks="props.isScheduledTasks"
|
|
33
|
-
:is-edit-scheduled-tasks="props.isEditScheduledTasks"
|
|
34
|
-
:target="props.target"
|
|
35
|
-
:selected-vm-name="props.selectedVmName"
|
|
36
|
-
:disks="props.disks"
|
|
37
|
-
:disks-loading="props.disksLoading"
|
|
38
|
-
:datastore-table="props.datastoreTable"
|
|
39
|
-
:datastore-table-loading="props.datastoreTableLoading"
|
|
40
|
-
:ready-to-complete-data="readyToCompleteInfo"
|
|
41
|
-
@change-step-create-backup="onChangeSteps"
|
|
42
|
-
@remove-validation-errors="onRemoveValidationErrors"
|
|
43
|
-
@finish="emits('finish')"
|
|
44
|
-
@hide="emits('hide')"
|
|
45
|
-
/>
|
|
46
|
-
</template>
|
|
47
|
-
|
|
48
|
-
<script setup lang="ts">
|
|
49
|
-
|
|
50
|
-
import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
51
|
-
import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
|
52
|
-
import type { UI_I_ValidationReturn } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
import {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
import type {
|
|
75
|
-
import type {UI_I_SelectInputItem} from "~/components/common/select/input/lib/models/interfaces";
|
|
76
|
-
import type {UI_I_TableInfoItem} from "~/components/atoms/table/info/lib/models/interfaces";
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const backupForm = defineModel<UI_I_CreateBackupForm>({ required: true })
|
|
80
|
-
const schedulerForm = defineModel('schedulerForm', { required: true })
|
|
81
|
-
|
|
82
|
-
const props = defineProps<{
|
|
83
|
-
isEdit: boolean // ToDo проверить на использование
|
|
84
|
-
target: string
|
|
85
|
-
isScheduledTasks: boolean
|
|
86
|
-
isEditScheduledTasks: boolean
|
|
87
|
-
selectedVmName: string
|
|
88
|
-
disks: UI_I_Pvm['disk_devices']
|
|
89
|
-
disksLoading: boolean
|
|
90
|
-
datastoreTable: UI_I_BackupDatastoreTable | null
|
|
91
|
-
datastoreTableLoading: boolean
|
|
92
|
-
}>()
|
|
93
|
-
|
|
94
|
-
const emits = defineEmits<{
|
|
95
|
-
(event: 'change-step-create-backup', value: UI_I_WizardStep[]): void
|
|
96
|
-
(event: 'check-name', value: UI_I_NameCheck): void
|
|
97
|
-
(event: 'finish'): void
|
|
98
|
-
(event: 'hide'): void
|
|
99
|
-
}>()
|
|
100
|
-
|
|
101
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
102
|
-
|
|
103
|
-
const { $store }: any = useNuxtApp()
|
|
104
|
-
|
|
105
|
-
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
106
|
-
|
|
107
|
-
const title = computed<string>(() => {
|
|
108
|
-
const { createBackup, updateBackup, scheduleNewTasks, scheduleTaskEdit } =
|
|
109
|
-
localization.value.common
|
|
110
|
-
let result = props.isEdit ? updateBackup : createBackup
|
|
111
|
-
if (props.isScheduledTasks) {
|
|
112
|
-
const schedulerMode = props.isEditScheduledTasks
|
|
113
|
-
? scheduleTaskEdit
|
|
114
|
-
: scheduleNewTasks
|
|
115
|
-
|
|
116
|
-
result = `${schedulerMode} (${createBackup})`
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return result
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const wizard: Wizard = new Wizard(
|
|
124
|
-
stepsFunc(localization.value),
|
|
125
|
-
stepsSchemeInitial(props.isScheduledTasks)
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
|
129
|
-
const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
|
|
130
|
-
|
|
131
|
-
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
|
|
132
|
-
emits('change-step-create-backup', value)
|
|
133
|
-
wizard.changeSteps(value, validationFunc)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const validationFunc = async (
|
|
137
|
-
value: UI_I_WizardStep[],
|
|
138
|
-
currentStep: UI_I_WizardStep,
|
|
139
|
-
nextStep: UI_I_WizardStep
|
|
140
|
-
): Promise<UI_I_ValidationReturn> => {
|
|
141
|
-
let stepHasError = false
|
|
142
|
-
const stepShouldStop = {
|
|
143
|
-
ifOnCurrentStep: false,
|
|
144
|
-
ifFromAnyStep: false,
|
|
145
|
-
stoppageStepId: -1
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (wizard.isValidateForStep(dynamicSteps.general, currentStep.id, nextStep.id)) {
|
|
149
|
-
const nameValidation = await checkName(value, backupForm.value.name, wizard, localization.value, emits)
|
|
150
|
-
value = nameValidation.newValue
|
|
151
|
-
stepHasError = nameValidation.stepHasError
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (wizard.isValidateForStep(dynamicSteps.disks, currentStep.id, nextStep.id)) {
|
|
155
|
-
const disksValidation = checkDisks(value, backupForm.value, wizard, localization.value, showValidationErrors, onRemoveValidationErrors)
|
|
156
|
-
value = disksValidation.newValue
|
|
157
|
-
stepHasError = disksValidation.stepHasError
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (wizard.isValidateForStep(dynamicSteps.datastores, currentStep.id, nextStep.id)) {
|
|
161
|
-
const datastoreValidation = checkDatastore(value, backupForm.value, wizard, localization.value, showValidationErrors, onRemoveValidationErrors)
|
|
162
|
-
value = datastoreValidation.newValue
|
|
163
|
-
stepHasError = datastoreValidation.stepHasError
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (wizard.isValidateForStep(dynamicSteps.configuration, currentStep.id, nextStep.id)) {
|
|
167
|
-
const configurationValidation = checkConfiguration(value, backupForm.value.bandwidth_limit, wizard, localization.value)
|
|
168
|
-
value = configurationValidation.newValue
|
|
169
|
-
stepHasError = configurationValidation.stepHasError
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return {
|
|
173
|
-
newValue: value,
|
|
174
|
-
stepHasError,
|
|
175
|
-
stepShouldStop
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const errors = ref<string[]>([])
|
|
180
|
-
const showValidationErrors = (data: string[]): void => {
|
|
181
|
-
errors.value = data
|
|
182
|
-
}
|
|
183
|
-
const onRemoveValidationErrors = (): void => {
|
|
184
|
-
errors.value = []
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
const strategyOptions = ref<UI_I_SelectInputItem[]>(
|
|
188
|
-
strategyOptionsFunc(localization.value)
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
const readyToCompleteInfo = computed<UI_I_TableInfoItem[]>(() => {
|
|
192
|
-
return readyToCompleteOptions(backupForm.value, localization.value, strategyOptions.value)
|
|
193
|
-
})
|
|
194
|
-
|
|
195
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<common-pages-backups-modals-create-backup-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
v-model="backupForm"
|
|
5
|
+
v-model:scheduler-form="schedulerForm"
|
|
6
|
+
:wizard="wizard"
|
|
7
|
+
:selected-scheme="selectedScheme"
|
|
8
|
+
:alert-messages="alertMessages"
|
|
9
|
+
:title="title"
|
|
10
|
+
:is-scheduled-tasks="props.isScheduledTasks"
|
|
11
|
+
:is-edit-scheduled-tasks="props.isEditScheduledTasks"
|
|
12
|
+
:target="props.target"
|
|
13
|
+
:selected-vm-name="props.selectedVmName"
|
|
14
|
+
:disks="props.disks"
|
|
15
|
+
:disks-loading="props.disksLoading"
|
|
16
|
+
:datastore-table="props.datastoreTable"
|
|
17
|
+
:datastore-table-loading="props.datastoreTableLoading"
|
|
18
|
+
:ready-to-complete-data="readyToCompleteInfo"
|
|
19
|
+
@change-steps="onChangeSteps"
|
|
20
|
+
@submit="emits('finish')"
|
|
21
|
+
@hide="emits('hide')"
|
|
22
|
+
/>
|
|
23
|
+
<common-pages-backups-modals-create-backup-old
|
|
24
|
+
v-else
|
|
25
|
+
v-model="backupForm"
|
|
26
|
+
v-model:scheduler-form="schedulerForm"
|
|
27
|
+
:wizard="wizard"
|
|
28
|
+
:selected-scheme="selectedScheme"
|
|
29
|
+
:alert-messages="alertMessages"
|
|
30
|
+
:title="title"
|
|
31
|
+
:alert-errors="errors"
|
|
32
|
+
:is-scheduled-tasks="props.isScheduledTasks"
|
|
33
|
+
:is-edit-scheduled-tasks="props.isEditScheduledTasks"
|
|
34
|
+
:target="props.target"
|
|
35
|
+
:selected-vm-name="props.selectedVmName"
|
|
36
|
+
:disks="props.disks"
|
|
37
|
+
:disks-loading="props.disksLoading"
|
|
38
|
+
:datastore-table="props.datastoreTable"
|
|
39
|
+
:datastore-table-loading="props.datastoreTableLoading"
|
|
40
|
+
:ready-to-complete-data="readyToCompleteInfo"
|
|
41
|
+
@change-step-create-backup="onChangeSteps"
|
|
42
|
+
@remove-validation-errors="onRemoveValidationErrors"
|
|
43
|
+
@finish="emits('finish')"
|
|
44
|
+
@hide="emits('hide')"
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
|
|
50
|
+
import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
51
|
+
import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
|
52
|
+
import type { UI_I_ValidationReturn } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
53
|
+
import type {UI_I_Localization} from "~/lib/models/interfaces";
|
|
54
|
+
import {
|
|
55
|
+
stepsSchemeInitial,
|
|
56
|
+
stepsFunc,
|
|
57
|
+
dynamicSteps
|
|
58
|
+
} from '~/components/common/pages/backups/modals/createBackup/lib/config/steps'
|
|
59
|
+
import type {
|
|
60
|
+
UI_I_BackupDatastoreTable,
|
|
61
|
+
UI_I_CreateBackupForm,
|
|
62
|
+
UI_I_Pvm
|
|
63
|
+
} from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
64
|
+
import { strategyOptionsFunc } from '~/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions'
|
|
65
|
+
import {
|
|
66
|
+
readyToCompleteOptions
|
|
67
|
+
} from '~/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions'
|
|
68
|
+
import {
|
|
69
|
+
checkName,
|
|
70
|
+
checkDisks,
|
|
71
|
+
checkDatastore,
|
|
72
|
+
checkConfiguration
|
|
73
|
+
} from '~/components/common/pages/backups/modals/createBackup/lib/validation/validations'
|
|
74
|
+
import type {UI_I_NameCheck} from "~/components/common/pages/backups/modals/restore/name/lib/models/interfaces";
|
|
75
|
+
import type {UI_I_SelectInputItem} from "~/components/common/select/input/lib/models/interfaces";
|
|
76
|
+
import type {UI_I_TableInfoItem} from "~/components/atoms/table/info/lib/models/interfaces";
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
const backupForm = defineModel<UI_I_CreateBackupForm>({ required: true })
|
|
80
|
+
const schedulerForm = defineModel('schedulerForm', { required: true })
|
|
81
|
+
|
|
82
|
+
const props = defineProps<{
|
|
83
|
+
isEdit: boolean // ToDo проверить на использование
|
|
84
|
+
target: string
|
|
85
|
+
isScheduledTasks: boolean
|
|
86
|
+
isEditScheduledTasks: boolean
|
|
87
|
+
selectedVmName: string
|
|
88
|
+
disks: UI_I_Pvm['disk_devices']
|
|
89
|
+
disksLoading: boolean
|
|
90
|
+
datastoreTable: UI_I_BackupDatastoreTable | null
|
|
91
|
+
datastoreTableLoading: boolean
|
|
92
|
+
}>()
|
|
93
|
+
|
|
94
|
+
const emits = defineEmits<{
|
|
95
|
+
(event: 'change-step-create-backup', value: UI_I_WizardStep[]): void
|
|
96
|
+
(event: 'check-name', value: UI_I_NameCheck): void
|
|
97
|
+
(event: 'finish'): void
|
|
98
|
+
(event: 'hide'): void
|
|
99
|
+
}>()
|
|
100
|
+
|
|
101
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
102
|
+
|
|
103
|
+
const { $store }: any = useNuxtApp()
|
|
104
|
+
|
|
105
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
106
|
+
|
|
107
|
+
const title = computed<string>(() => {
|
|
108
|
+
const { createBackup, updateBackup, scheduleNewTasks, scheduleTaskEdit } =
|
|
109
|
+
localization.value.common
|
|
110
|
+
let result = props.isEdit ? updateBackup : createBackup
|
|
111
|
+
if (props.isScheduledTasks) {
|
|
112
|
+
const schedulerMode = props.isEditScheduledTasks
|
|
113
|
+
? scheduleTaskEdit
|
|
114
|
+
: scheduleNewTasks
|
|
115
|
+
|
|
116
|
+
result = `${schedulerMode} (${createBackup})`
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return result
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
const wizard: Wizard = new Wizard(
|
|
124
|
+
stepsFunc(localization.value),
|
|
125
|
+
stepsSchemeInitial(props.isScheduledTasks)
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
|
129
|
+
const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
|
|
130
|
+
|
|
131
|
+
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
|
|
132
|
+
emits('change-step-create-backup', value)
|
|
133
|
+
wizard.changeSteps(value, validationFunc)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const validationFunc = async (
|
|
137
|
+
value: UI_I_WizardStep[],
|
|
138
|
+
currentStep: UI_I_WizardStep,
|
|
139
|
+
nextStep: UI_I_WizardStep
|
|
140
|
+
): Promise<UI_I_ValidationReturn> => {
|
|
141
|
+
let stepHasError = false
|
|
142
|
+
const stepShouldStop = {
|
|
143
|
+
ifOnCurrentStep: false,
|
|
144
|
+
ifFromAnyStep: false,
|
|
145
|
+
stoppageStepId: -1
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (wizard.isValidateForStep(dynamicSteps.general, currentStep.id, nextStep.id)) {
|
|
149
|
+
const nameValidation = await checkName(value, backupForm.value.name, wizard, localization.value, emits)
|
|
150
|
+
value = nameValidation.newValue
|
|
151
|
+
stepHasError = nameValidation.stepHasError
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (wizard.isValidateForStep(dynamicSteps.disks, currentStep.id, nextStep.id)) {
|
|
155
|
+
const disksValidation = checkDisks(value, backupForm.value, wizard, localization.value, showValidationErrors, onRemoveValidationErrors)
|
|
156
|
+
value = disksValidation.newValue
|
|
157
|
+
stepHasError = disksValidation.stepHasError
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (wizard.isValidateForStep(dynamicSteps.datastores, currentStep.id, nextStep.id)) {
|
|
161
|
+
const datastoreValidation = checkDatastore(value, backupForm.value, wizard, localization.value, showValidationErrors, onRemoveValidationErrors)
|
|
162
|
+
value = datastoreValidation.newValue
|
|
163
|
+
stepHasError = datastoreValidation.stepHasError
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (wizard.isValidateForStep(dynamicSteps.configuration, currentStep.id, nextStep.id)) {
|
|
167
|
+
const configurationValidation = checkConfiguration(value, backupForm.value.bandwidth_limit, wizard, localization.value)
|
|
168
|
+
value = configurationValidation.newValue
|
|
169
|
+
stepHasError = configurationValidation.stepHasError
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
newValue: value,
|
|
174
|
+
stepHasError,
|
|
175
|
+
stepShouldStop
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const errors = ref<string[]>([])
|
|
180
|
+
const showValidationErrors = (data: string[]): void => {
|
|
181
|
+
errors.value = data
|
|
182
|
+
}
|
|
183
|
+
const onRemoveValidationErrors = (): void => {
|
|
184
|
+
errors.value = []
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const strategyOptions = ref<UI_I_SelectInputItem[]>(
|
|
188
|
+
strategyOptionsFunc(localization.value)
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
const readyToCompleteInfo = computed<UI_I_TableInfoItem[]>(() => {
|
|
192
|
+
return readyToCompleteOptions(backupForm.value, localization.value, strategyOptions.value)
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
</script>
|
|
196
196
|
<style scoped lang="scss"></style>
|