bfg-common 1.5.539 → 1.5.541
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/pages/backups/modals/createBackup/CreateBackup.vue +195 -195
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/TableView.vue +3 -3
- package/components/common/pages/backups/modals/createBackup/disks/tableView/new/lib/config/table.ts +1 -0
- package/components/common/pages/backups/modals/restore/Restore.vue +78 -196
- package/components/common/pages/backups/modals/restore/RestoreNew.vue +289 -0
- package/components/common/pages/backups/modals/restore/RestoreOld.vue +173 -0
- package/components/common/pages/backups/modals/restore/disks/Disks.vue +32 -27
- package/components/common/pages/backups/modals/restore/disks/DisksNew.vue +17 -0
- package/components/common/pages/backups/modals/restore/disks/DisksOld.vue +21 -0
- package/components/common/pages/backups/modals/restore/disks/tableView/new/Table.vue +126 -0
- package/components/common/pages/backups/modals/restore/disks/tableView/new/lib/config/table.ts +175 -0
- package/components/common/pages/backups/modals/restore/disks/tableView/{TableView.vue → old/Table.vue} +6 -3
- package/components/common/pages/backups/modals/restore/disks/tableView/{lib → old/lib}/config/keys.ts +1 -1
- package/components/common/pages/backups/modals/restore/disks/tableView/{lib → old/lib}/config/table.ts +117 -117
- package/components/common/pages/backups/modals/restore/disks/tableView/{lib → old/lib}/models/types.ts +1 -1
- package/components/common/pages/backups/modals/restore/lib/config/readyToCompleteOptions.ts +62 -0
- package/components/common/pages/backups/modals/restore/lib/config/steps.ts +21 -21
- package/components/common/pages/backups/modals/restore/name/Name.vue +31 -166
- package/components/common/pages/backups/modals/restore/name/NameNew.vue +98 -0
- package/components/common/pages/backups/modals/restore/name/NameOld.vue +86 -0
- package/components/common/pages/backups/modals/restore/networks/Networks.vue +64 -70
- package/components/common/pages/backups/modals/restore/networks/NetworksNew.vue +78 -0
- package/components/common/pages/backups/modals/restore/networks/NetworksOld.vue +48 -0
- package/components/common/pages/backups/modals/restore/networks/table/new/Table.vue +269 -0
- package/components/common/pages/backups/modals/restore/networks/table/new/lib/config/table.ts +127 -0
- package/components/common/pages/backups/modals/restore/networks/table/{Table.vue → old/Table.vue} +219 -214
- package/components/common/pages/backups/modals/restore/networks/table/{adapterType → old/adapterType}/AdapterType.vue +1 -1
- package/components/common/pages/backups/modals/restore/networks/table/{lib → old/lib}/config/networkTable.ts +1 -1
- package/components/common/pages/backups/modals/restore/networks/table/old/lib/config/tableKeys.ts +8 -0
- package/components/common/pages/backups/modals/restore/types/Types.vue +9 -50
- package/components/common/pages/backups/modals/restore/types/TypesNew.vue +95 -0
- package/components/common/pages/backups/modals/restore/types/TypesOld.vue +61 -0
- package/components/common/pages/backups/modals/restore/types/lib/config/descriptions.ts +1 -0
- package/components/common/pages/backups/modals/restore/types/lib/config/typeOptions.ts +25 -25
- package/components/common/pages/backups/modals/restore/validation/validation.ts +108 -0
- package/components/common/pages/hardwareHealth/tableView/lib/config/sensorTable.ts +1 -1
- package/components/common/pages/hardwareHealth/tableView/modal/SensorWarning.vue +1 -1
- package/components/common/tooltip/Help.vue +5 -0
- package/package.json +1 -1
- package/components/common/pages/backups/modals/restore/networks/table/lib/config/tableKeys.ts +0 -10
- /package/components/common/pages/backups/modals/restore/networks/table/{adapterType → old/adapterType}/lib/config/options.ts +0 -0
- /package/components/common/pages/backups/modals/restore/networks/table/{lib → old/lib}/models/types.ts +0 -0
|
@@ -1,86 +1,42 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
v-show="selectedStep.id === dynamicSteps.selectName"
|
|
41
|
-
v-model="model"
|
|
42
|
-
:show="selectedStep.id === dynamicSteps.selectName"
|
|
43
|
-
:name-form-submit="nameFormSubmit"
|
|
44
|
-
@check-name="onCheckName"
|
|
45
|
-
/>
|
|
46
|
-
|
|
47
|
-
<!-- TODO refactoring-->
|
|
48
|
-
<common-vm-actions-common-select-storage
|
|
49
|
-
v-show="selectedStep.id === dynamicSteps.selectStorage"
|
|
50
|
-
:storage-submit="storageSubmit"
|
|
51
|
-
:datastore="props.datastore"
|
|
52
|
-
:is-datastore-loading="props.datastoreLoading"
|
|
53
|
-
:storage="model.pvm.storage"
|
|
54
|
-
:get-datastore-table-func="getDatastoreTableFunc"
|
|
55
|
-
@submit="onChangeStorage"
|
|
56
|
-
/>
|
|
57
|
-
|
|
58
|
-
<common-pages-backups-modals-restore-disks
|
|
59
|
-
v-show="selectedStep.id === dynamicSteps.selectDisks"
|
|
60
|
-
v-model="model"
|
|
61
|
-
/>
|
|
62
|
-
<common-pages-backups-modals-restore-networks
|
|
63
|
-
v-if="selectedStep.id === dynamicSteps.selectNetwork"
|
|
64
|
-
v-model="model"
|
|
65
|
-
:alert-messages="[]"
|
|
66
|
-
:networks="props.networks"
|
|
67
|
-
@get-networks="onGetNetworks"
|
|
68
|
-
/>
|
|
69
|
-
|
|
70
|
-
<common-ready-to-complete
|
|
71
|
-
v-show="selectedStep.id === dynamicSteps.readyComplete"
|
|
72
|
-
:data="readyToCompleteInfo"
|
|
73
|
-
/>
|
|
74
|
-
</template>
|
|
75
|
-
</atoms-wizard>
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<common-modals-confirmation
|
|
79
|
-
v-if="isShowConfirm"
|
|
80
|
-
:headline="localization.common.attention"
|
|
81
|
-
:description="localization.common.restoreBackupConfirmDescription"
|
|
82
|
-
@hide-modal="isShowConfirm = false"
|
|
83
|
-
@confirm="onFinish"
|
|
2
|
+
<common-pages-backups-modals-restore-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
v-model="model"
|
|
5
|
+
:wizard="wizard"
|
|
6
|
+
:selected-scheme="selectedScheme"
|
|
7
|
+
:alert-messages="alertMessages"
|
|
8
|
+
:storage-submit="storageSubmit"
|
|
9
|
+
:datastore="props.datastore"
|
|
10
|
+
:datastore-loading="props.datastoreLoading"
|
|
11
|
+
:networks="props.networks"
|
|
12
|
+
:ready-complete-data="readyToCompleteInfo"
|
|
13
|
+
:selected-storage="selectedStorage"
|
|
14
|
+
@change-storage="onChangeStorage"
|
|
15
|
+
@get-datastore="getDatastoreTableFunc"
|
|
16
|
+
@get-networks="onGetNetworks"
|
|
17
|
+
@change-steps="onChangeSteps"
|
|
18
|
+
@hide="onHideModal"
|
|
19
|
+
@submit="onRestore"
|
|
20
|
+
/>
|
|
21
|
+
<common-pages-backups-modals-restore-old
|
|
22
|
+
v-else
|
|
23
|
+
v-model="model"
|
|
24
|
+
:wizard="wizard"
|
|
25
|
+
:selected-scheme="selectedScheme"
|
|
26
|
+
:ready-complete-data="readyToCompleteInfo"
|
|
27
|
+
:storage-submit="storageSubmit"
|
|
28
|
+
:is-loading="isLoading"
|
|
29
|
+
:errors="errors"
|
|
30
|
+
:datastore="props.datastore"
|
|
31
|
+
:datastore-loading="props.datastoreLoading"
|
|
32
|
+
:networks="props.networks"
|
|
33
|
+
@remove-validation-errors="onRemoveValidationErrors"
|
|
34
|
+
@change-storage="onChangeStorage"
|
|
35
|
+
@get-datastore="getDatastoreTableFunc"
|
|
36
|
+
@get-networks="onGetNetworks"
|
|
37
|
+
@change-steps="onChangeSteps"
|
|
38
|
+
@finish="onRestore"
|
|
39
|
+
@hide="onHideModal"
|
|
84
40
|
/>
|
|
85
41
|
</template>
|
|
86
42
|
|
|
@@ -102,6 +58,11 @@ import {
|
|
|
102
58
|
dynamicSteps,
|
|
103
59
|
} from '~/components/common/pages/backups/modals/restore/lib/config/steps'
|
|
104
60
|
import { restoreCodes } from '~/components/common/pages/backups/modals/restore/lib/config/restoreCodes'
|
|
61
|
+
import { readyToCompleteOptions } from '~/components/common/pages/backups/modals/restore/lib/config/readyToCompleteOptions'
|
|
62
|
+
import {
|
|
63
|
+
checkDisksValidation,
|
|
64
|
+
checkNameValidation,
|
|
65
|
+
} from '~/components/common/pages/backups/modals/restore/validation/validation'
|
|
105
66
|
|
|
106
67
|
const model = defineModel<UI_I_RestoreForm>({ required: true })
|
|
107
68
|
|
|
@@ -122,10 +83,13 @@ const { $store }: any = useNuxtApp()
|
|
|
122
83
|
|
|
123
84
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
124
85
|
|
|
86
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
87
|
+
|
|
125
88
|
const wizard: Wizard = new Wizard(
|
|
126
89
|
stepsFunc(localization.value),
|
|
127
90
|
stepsSchemeInitial
|
|
128
91
|
)
|
|
92
|
+
const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
|
|
129
93
|
|
|
130
94
|
watch(
|
|
131
95
|
() => model.value.restore_code,
|
|
@@ -139,7 +103,6 @@ const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
|
|
|
139
103
|
wizard.changeSteps(value, validationFunc)
|
|
140
104
|
}
|
|
141
105
|
|
|
142
|
-
const nameFormSubmit = ref<null | Function>(null)
|
|
143
106
|
const storageSubmit = ref<null | Function>(null)
|
|
144
107
|
|
|
145
108
|
const validationFunc = async (
|
|
@@ -163,7 +126,15 @@ const validationFunc = async (
|
|
|
163
126
|
nextStep.id
|
|
164
127
|
)
|
|
165
128
|
) {
|
|
166
|
-
const nameValidation = await
|
|
129
|
+
const nameValidation = await checkNameValidation(
|
|
130
|
+
value,
|
|
131
|
+
model.value.pvm.name,
|
|
132
|
+
wizard,
|
|
133
|
+
localization.value,
|
|
134
|
+
showValidationErrors,
|
|
135
|
+
onRemoveValidationErrors,
|
|
136
|
+
emits
|
|
137
|
+
)
|
|
167
138
|
|
|
168
139
|
value = nameValidation.newValue
|
|
169
140
|
stepHasError = stepHasError || nameValidation.stepHasError
|
|
@@ -189,7 +160,14 @@ const validationFunc = async (
|
|
|
189
160
|
nextStep.id
|
|
190
161
|
)
|
|
191
162
|
) {
|
|
192
|
-
const validation =
|
|
163
|
+
const validation = checkDisksValidation(
|
|
164
|
+
value,
|
|
165
|
+
!!model.value?.pvm.disk_devices.length,
|
|
166
|
+
wizard,
|
|
167
|
+
localization.value,
|
|
168
|
+
showValidationErrors,
|
|
169
|
+
onRemoveValidationErrors
|
|
170
|
+
)
|
|
193
171
|
|
|
194
172
|
value = validation.newValue
|
|
195
173
|
stepHasError = stepHasError || validation.stepHasError
|
|
@@ -204,31 +182,6 @@ const validationFunc = async (
|
|
|
204
182
|
}
|
|
205
183
|
}
|
|
206
184
|
|
|
207
|
-
const checkName = async (
|
|
208
|
-
value: UI_I_WizardStep[]
|
|
209
|
-
): Promise<UI_I_ValidationReturn> => {
|
|
210
|
-
let stepHasError = false
|
|
211
|
-
|
|
212
|
-
return new Promise((resolve) => {
|
|
213
|
-
nameFormSubmit.value = (isValid: boolean): void => {
|
|
214
|
-
if (!isValid) {
|
|
215
|
-
stepHasError = wizard.setValidation(dynamicSteps.selectName, 'name', {
|
|
216
|
-
fieldMessage: 'aaa',
|
|
217
|
-
alertMessage: 'aaa',
|
|
218
|
-
})
|
|
219
|
-
} else if (wizard.hasMessage(dynamicSteps.selectName, 'name')) {
|
|
220
|
-
value = wizard.removeValidation(dynamicSteps.selectName, 'name', value)
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
resolve({
|
|
224
|
-
stepHasError,
|
|
225
|
-
newValue: value,
|
|
226
|
-
})
|
|
227
|
-
nameFormSubmit.value = null
|
|
228
|
-
}
|
|
229
|
-
})
|
|
230
|
-
}
|
|
231
|
-
|
|
232
185
|
const checkStorage = async (
|
|
233
186
|
value: UI_I_WizardStep[]
|
|
234
187
|
): Promise<UI_I_ValidationReturn> => {
|
|
@@ -241,8 +194,9 @@ const checkStorage = async (
|
|
|
241
194
|
dynamicSteps.selectStorage,
|
|
242
195
|
'storage',
|
|
243
196
|
{
|
|
244
|
-
fieldMessage:
|
|
245
|
-
alertMessage:
|
|
197
|
+
fieldMessage: localization.value.common.selectStorage,
|
|
198
|
+
alertMessage:
|
|
199
|
+
localization.value.common.selectValidDestinationStorage,
|
|
246
200
|
}
|
|
247
201
|
)
|
|
248
202
|
} else if (wizard.hasMessage(dynamicSteps.selectStorage, 'storage')) {
|
|
@@ -262,53 +216,23 @@ const checkStorage = async (
|
|
|
262
216
|
})
|
|
263
217
|
}
|
|
264
218
|
|
|
265
|
-
const checkDisks = (value: UI_I_WizardStep[]): UI_I_ValidationReturn => {
|
|
266
|
-
let stepHasError = false
|
|
267
|
-
|
|
268
|
-
const isValidStores = !!model.value?.pvm.disk_devices.length
|
|
269
|
-
if (!isValidStores) {
|
|
270
|
-
stepHasError = wizard.setValidation(
|
|
271
|
-
dynamicSteps.selectDisks,
|
|
272
|
-
'disk_devices',
|
|
273
|
-
{
|
|
274
|
-
fieldMessage: localization.value.common.diskIsRequired,
|
|
275
|
-
alertMessage: localization.value.common.diskIsRequired,
|
|
276
|
-
}
|
|
277
|
-
)
|
|
278
|
-
showValidationErrors([localization.value.common.diskIsRequired])
|
|
279
|
-
} else if (wizard.hasMessage(dynamicSteps.selectDisks, 'disk_devices')) {
|
|
280
|
-
value = wizard.removeValidation(
|
|
281
|
-
dynamicSteps.selectDisks,
|
|
282
|
-
'disk_devices',
|
|
283
|
-
value
|
|
284
|
-
)
|
|
285
|
-
onRemoveValidationErrors()
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
return {
|
|
289
|
-
stepHasError,
|
|
290
|
-
newValue: value,
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
219
|
const getDatastoreTableFunc = async (): Promise<void> => {
|
|
295
220
|
emits('get-datastore', model.value.bucket)
|
|
296
221
|
}
|
|
297
222
|
|
|
298
223
|
const selectedStorageName = ref<string>('')
|
|
224
|
+
const selectedStorage = ref<UI_I_DatastoreTableItem | null>(null)
|
|
299
225
|
const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
|
|
300
226
|
if (!storage) return
|
|
227
|
+
|
|
301
228
|
selectedStorageName.value = storage.name
|
|
229
|
+
selectedStorage.value = storage
|
|
302
230
|
model.value.pvm.storage = {
|
|
303
231
|
id: storage.id,
|
|
304
232
|
folder: '',
|
|
305
233
|
}
|
|
306
234
|
}
|
|
307
235
|
|
|
308
|
-
const onCheckName = async (data: UI_I_NameCheck): Promise<void> => {
|
|
309
|
-
emits('check-name', data)
|
|
310
|
-
}
|
|
311
|
-
|
|
312
236
|
const isLoading = ref<boolean>(true)
|
|
313
237
|
// В Сфере и Прокураторе одно и тоже
|
|
314
238
|
const getPvm = async (): Promise<void> => {
|
|
@@ -319,61 +243,18 @@ const getPvm = async (): Promise<void> => {
|
|
|
319
243
|
})
|
|
320
244
|
|
|
321
245
|
model.value.pvm = useDeepCopy($store.getters['backup/getPvm'])
|
|
246
|
+
model.value.pvm.disk_devices = [] // ToDo если не обнулить тогда в форме всегда будет выбранны диски
|
|
322
247
|
isLoading.value = false
|
|
323
248
|
}
|
|
324
249
|
getPvm()
|
|
325
250
|
|
|
326
|
-
const readyToCompleteInfo = computed<UI_I_TableInfoItem[]>(() =>
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
label: localization.value.common.backup,
|
|
334
|
-
value: model.value.backup,
|
|
335
|
-
})
|
|
336
|
-
break
|
|
337
|
-
case restoreCodes.asNew:
|
|
338
|
-
result.push({
|
|
339
|
-
label: localization.value.common.vmName,
|
|
340
|
-
value: model.value.pvm.name,
|
|
341
|
-
})
|
|
342
|
-
|
|
343
|
-
// Datastores
|
|
344
|
-
result.push({
|
|
345
|
-
label: localization.value.common.datastore,
|
|
346
|
-
value: selectedStorageName.value,
|
|
347
|
-
})
|
|
348
|
-
|
|
349
|
-
// Disks
|
|
350
|
-
model.value.pvm.disk_devices.forEach((disk_device, i) => {
|
|
351
|
-
if (!disk_device.source) return
|
|
352
|
-
|
|
353
|
-
result.push({
|
|
354
|
-
label: `${localization.value.common.disk} ${i}`,
|
|
355
|
-
value: disk_device.source,
|
|
356
|
-
})
|
|
357
|
-
})
|
|
358
|
-
|
|
359
|
-
// Networks
|
|
360
|
-
model.value.pvm.network_devices.forEach((network) => {
|
|
361
|
-
result.push({
|
|
362
|
-
label: localization.value.common.network,
|
|
363
|
-
value: network.network,
|
|
364
|
-
})
|
|
365
|
-
})
|
|
366
|
-
break
|
|
367
|
-
// case 1:
|
|
368
|
-
// result.push({
|
|
369
|
-
// label: localization.value.common.vmName,
|
|
370
|
-
// value: model.value.pvm.name,
|
|
371
|
-
// })
|
|
372
|
-
// break
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
return result
|
|
376
|
-
})
|
|
251
|
+
const readyToCompleteInfo = computed<UI_I_TableInfoItem[]>(() =>
|
|
252
|
+
readyToCompleteOptions(
|
|
253
|
+
model.value,
|
|
254
|
+
localization.value,
|
|
255
|
+
selectedStorageName.value
|
|
256
|
+
)
|
|
257
|
+
)
|
|
377
258
|
|
|
378
259
|
const errors = ref<string[]>([])
|
|
379
260
|
const showValidationErrors = (data: string[]): void => {
|
|
@@ -410,6 +291,7 @@ const onGetNetworks = (hostId: string): void => {
|
|
|
410
291
|
display: flex;
|
|
411
292
|
flex-direction: column;
|
|
412
293
|
}
|
|
294
|
+
|
|
413
295
|
.loader-wrap {
|
|
414
296
|
background-color: rgba(0, 0, 0, 0.3);
|
|
415
297
|
z-index: var(--z-fixed);
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-wizard
|
|
3
|
+
:steps="props.wizard.steps"
|
|
4
|
+
:selected-scheme="props.selectedScheme"
|
|
5
|
+
:is-loading="props.wizard.wizardLoader.status"
|
|
6
|
+
:title="title"
|
|
7
|
+
:texts="texts"
|
|
8
|
+
test-id="backup-restore-wizard"
|
|
9
|
+
show
|
|
10
|
+
class="restore-wizard"
|
|
11
|
+
@change-steps="onChangeSteps"
|
|
12
|
+
@hide="onHideModal"
|
|
13
|
+
@submit="onCreateDatastore"
|
|
14
|
+
>
|
|
15
|
+
<template #content="{ selectedStep }">
|
|
16
|
+
<ui-wizard-block
|
|
17
|
+
v-if="selectedStep.id === dynamicSteps.selectType"
|
|
18
|
+
:sub-title-height="height0"
|
|
19
|
+
>
|
|
20
|
+
<template #content>
|
|
21
|
+
<div class="pt-2 pb-4">
|
|
22
|
+
<common-pages-backups-modals-restore-types v-model="model" />
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
</ui-wizard-block>
|
|
26
|
+
|
|
27
|
+
<ui-wizard-block
|
|
28
|
+
v-if="selectedStep.id === dynamicSteps.selectName"
|
|
29
|
+
:sub-title-height="height1"
|
|
30
|
+
>
|
|
31
|
+
<template #subTitle>
|
|
32
|
+
<div ref="subTitleBlock1">
|
|
33
|
+
<ui-alert
|
|
34
|
+
v-if="props.alertMessages[dynamicSteps.selectName].length"
|
|
35
|
+
:messages="props.alertMessages[dynamicSteps.selectName]"
|
|
36
|
+
test-id="add-vm-backup-disks-error-alert"
|
|
37
|
+
type="error"
|
|
38
|
+
size="md"
|
|
39
|
+
class="mb-3"
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
<div class="subtitle-block flex-row w-full items-start">
|
|
43
|
+
<ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
<template #content>
|
|
48
|
+
<div class="mt-4 mb-4">
|
|
49
|
+
<common-pages-backups-modals-restore-name
|
|
50
|
+
v-model="model"
|
|
51
|
+
:show="selectedStep.id === dynamicSteps.selectName"
|
|
52
|
+
:messages-fields="selectedStep.fields"
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
</ui-wizard-block>
|
|
57
|
+
|
|
58
|
+
<ui-wizard-block
|
|
59
|
+
v-if="selectedStep.id === dynamicSteps.selectStorage"
|
|
60
|
+
:sub-title-height="height2"
|
|
61
|
+
>
|
|
62
|
+
<template #subTitle>
|
|
63
|
+
<div ref="subTitleBlock2">
|
|
64
|
+
<ui-alert
|
|
65
|
+
v-if="props.alertMessages[dynamicSteps.selectStorage].length"
|
|
66
|
+
:messages="props.alertMessages[dynamicSteps.selectStorage]"
|
|
67
|
+
test-id="backup-restore-datastores-error-alert"
|
|
68
|
+
type="error"
|
|
69
|
+
size="md"
|
|
70
|
+
class="mb-3"
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
<div class="subtitle-block flex-row w-full items-start">
|
|
74
|
+
<ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</template>
|
|
78
|
+
<template #content>
|
|
79
|
+
<div class="restore-select-storage mb-4">
|
|
80
|
+
<common-vm-actions-common-select-storage
|
|
81
|
+
:storage-submit="props.storageSubmit"
|
|
82
|
+
:is-datastore-loading="props.datastoreLoading"
|
|
83
|
+
:get-datastore-table-func="getDatastoreTableFunc"
|
|
84
|
+
:datastore="props.datastore"
|
|
85
|
+
:storage="props.selectedStorage"
|
|
86
|
+
hide-alert
|
|
87
|
+
@change-storage="onChangeStorage"
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
</template>
|
|
91
|
+
</ui-wizard-block>
|
|
92
|
+
|
|
93
|
+
<ui-wizard-block
|
|
94
|
+
v-if="selectedStep.id === dynamicSteps.selectDisks"
|
|
95
|
+
:sub-title-height="height3"
|
|
96
|
+
>
|
|
97
|
+
<template #subTitle>
|
|
98
|
+
<div ref="subTitleBlock3">
|
|
99
|
+
<ui-alert
|
|
100
|
+
v-if="props.alertMessages[dynamicSteps.selectDisks].length"
|
|
101
|
+
:messages="props.alertMessages[dynamicSteps.selectDisks]"
|
|
102
|
+
test-id="add-vm-backup-configuration-error-alert"
|
|
103
|
+
type="error"
|
|
104
|
+
size="md"
|
|
105
|
+
class="mb-3"
|
|
106
|
+
/>
|
|
107
|
+
|
|
108
|
+
<div class="subtitle-block flex-row items-start">
|
|
109
|
+
<ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</template>
|
|
113
|
+
<template #content>
|
|
114
|
+
<div class="mt-3">
|
|
115
|
+
<common-pages-backups-modals-restore-disks v-model="model" />
|
|
116
|
+
</div>
|
|
117
|
+
</template>
|
|
118
|
+
</ui-wizard-block>
|
|
119
|
+
|
|
120
|
+
<ui-wizard-block
|
|
121
|
+
v-if="selectedStep.id === dynamicSteps.selectNetwork"
|
|
122
|
+
:sub-title-height="height4"
|
|
123
|
+
>
|
|
124
|
+
<template #subTitle>
|
|
125
|
+
<div ref="subTitleBlock4">
|
|
126
|
+
<div class="subtitle-block flex-row items-start">
|
|
127
|
+
<ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</template>
|
|
131
|
+
<template #content>
|
|
132
|
+
<div class="mt-4">
|
|
133
|
+
<div class="ready-to-complete"></div>
|
|
134
|
+
<common-pages-backups-modals-restore-networks
|
|
135
|
+
v-model="model"
|
|
136
|
+
:alert-messages="[]"
|
|
137
|
+
:networks="props.networks"
|
|
138
|
+
@get-networks="onGetNetworks"
|
|
139
|
+
/>
|
|
140
|
+
</div>
|
|
141
|
+
</template>
|
|
142
|
+
</ui-wizard-block>
|
|
143
|
+
|
|
144
|
+
<ui-wizard-block
|
|
145
|
+
v-if="selectedStep.id === dynamicSteps.readyComplete"
|
|
146
|
+
:sub-title-height="height4"
|
|
147
|
+
>
|
|
148
|
+
<template #subTitle>
|
|
149
|
+
<div ref="subTitleBlock4">
|
|
150
|
+
<div class="subtitle-block flex-row items-start">
|
|
151
|
+
<ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</template>
|
|
155
|
+
<template #content>
|
|
156
|
+
<div class="mt-4">
|
|
157
|
+
<div class="ready-to-complete"></div>
|
|
158
|
+
<common-ready-to-complete :data="props.readyCompleteData" />
|
|
159
|
+
</div>
|
|
160
|
+
</template>
|
|
161
|
+
</ui-wizard-block>
|
|
162
|
+
</template>
|
|
163
|
+
</ui-wizard>
|
|
164
|
+
</template>
|
|
165
|
+
|
|
166
|
+
<script setup lang="ts">
|
|
167
|
+
import { useElementSize } from '@vueuse/core'
|
|
168
|
+
import type {
|
|
169
|
+
UI_I_WizardStep,
|
|
170
|
+
UI_I_WizardTexts,
|
|
171
|
+
} from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
172
|
+
import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
|
173
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
174
|
+
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
|
|
175
|
+
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
176
|
+
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
177
|
+
import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
|
|
178
|
+
import { dynamicSteps } from '~/components/common/pages/backups/modals/restore/lib/config/steps'
|
|
179
|
+
|
|
180
|
+
const model = defineModel<UI_I_RestoreForm>({ required: true })
|
|
181
|
+
|
|
182
|
+
const props = defineProps<{
|
|
183
|
+
wizard: Wizard
|
|
184
|
+
selectedScheme: number[]
|
|
185
|
+
alertMessages: string[][]
|
|
186
|
+
readyCompleteData: UI_I_TableInfoItem[]
|
|
187
|
+
storageSubmit: null | Function
|
|
188
|
+
selectedStorage: UI_I_DatastoreTableItem | null
|
|
189
|
+
datastore: UI_I_DatastoreTableItem[]
|
|
190
|
+
datastoreLoading: boolean
|
|
191
|
+
networks: UI_I_NetworkTableItem[]
|
|
192
|
+
}>()
|
|
193
|
+
const emits = defineEmits<{
|
|
194
|
+
(event: 'change-steps', value: UI_I_WizardStep[]): void
|
|
195
|
+
(event: 'change-storage', value: UI_I_DatastoreTableItem | null): void
|
|
196
|
+
(event: 'get-datastore', value: string): void
|
|
197
|
+
(event: 'get-networks', value: string): void
|
|
198
|
+
(event: 'hide'): void
|
|
199
|
+
(event: 'submit'): void
|
|
200
|
+
}>()
|
|
201
|
+
|
|
202
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
203
|
+
|
|
204
|
+
const title = computed<string>(() =>
|
|
205
|
+
localization.value.common.restoreFromBackup.replace('backup', 'Backup')
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
const texts = computed<UI_I_WizardTexts>(() => ({
|
|
209
|
+
cancel: localization.value.common.cancel,
|
|
210
|
+
back: localization.value.common.backCap,
|
|
211
|
+
processing: localization.value.common.processing,
|
|
212
|
+
next: localization.value.common.next,
|
|
213
|
+
finish: localization.value.common.restore,
|
|
214
|
+
incompleteTitle: localization.value.common.incompleteProcess,
|
|
215
|
+
incompleteMessage: localization.value.common.incompleteProcessMessage,
|
|
216
|
+
incompleteCancel: localization.value.common.cancel,
|
|
217
|
+
incompleteLeave: localization.value.common.leave,
|
|
218
|
+
step: localization.value.common.step,
|
|
219
|
+
of: localization.value.common.of2,
|
|
220
|
+
}))
|
|
221
|
+
|
|
222
|
+
const subTitleBlock0 = ref<HTMLElement | null>(null)
|
|
223
|
+
const { height: height0 } = useElementSize(subTitleBlock0)
|
|
224
|
+
|
|
225
|
+
const subTitleBlock1 = ref<HTMLElement | null>(null)
|
|
226
|
+
const { height: height1 } = useElementSize(subTitleBlock1)
|
|
227
|
+
|
|
228
|
+
const subTitleBlock2 = ref<HTMLElement | null>(null)
|
|
229
|
+
const { height: height2 } = useElementSize(subTitleBlock2)
|
|
230
|
+
|
|
231
|
+
const subTitleBlock3 = ref<HTMLElement | null>(null)
|
|
232
|
+
const { height: height3 } = useElementSize(subTitleBlock3)
|
|
233
|
+
|
|
234
|
+
const subTitleBlock4 = ref<HTMLElement | null>(null)
|
|
235
|
+
const { height: height4 } = useElementSize(subTitleBlock4)
|
|
236
|
+
|
|
237
|
+
const getDatastoreTableFunc = async (): Promise<void> => {
|
|
238
|
+
emits('get-datastore', model.value.bucket)
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
|
|
242
|
+
emits('change-steps', value)
|
|
243
|
+
|
|
244
|
+
const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
|
|
245
|
+
emits('change-storage', storage)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const onGetNetworks = (hostId: string): void => {
|
|
249
|
+
emits('get-networks', hostId)
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const onHideModal = (): void => emits('hide')
|
|
253
|
+
const onCreateDatastore = (): void => emits('submit')
|
|
254
|
+
</script>
|
|
255
|
+
|
|
256
|
+
<style scoped lang="scss">
|
|
257
|
+
.subtitle-block {
|
|
258
|
+
display: flex;
|
|
259
|
+
flex-direction: column;
|
|
260
|
+
row-gap: 16px;
|
|
261
|
+
border-bottom: 1px solid var(--wizard-line);
|
|
262
|
+
padding-bottom: 12px;
|
|
263
|
+
|
|
264
|
+
&.flex-row {
|
|
265
|
+
flex-direction: row;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
:deep(&__alert) {
|
|
269
|
+
padding: 10px 12px;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.ready-to-complete {
|
|
274
|
+
:deep(.details-list):nth-child(1) {
|
|
275
|
+
.details-item-value {
|
|
276
|
+
white-space: break-spaces;
|
|
277
|
+
overflow: auto;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.restore-wizard {
|
|
283
|
+
.restore-select-storage {
|
|
284
|
+
:deep(.ui-main-no-items-found span) {
|
|
285
|
+
font-size: 14px;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
</style>
|