bfg-common 1.5.430 → 1.5.431
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/backup/storage/actions/add/Old.vue +0 -1
- package/components/common/pages/backups/modals/Modals.vue +1 -1
- package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +379 -376
- package/components/common/pages/backups/modals/createBackup/lib/config/steps.ts +2 -2
- package/components/common/pages/backups/modals/restore/Restore.vue +3 -3
- package/components/common/pages/backups/modals/restore/lib/config/steps.ts +2 -2
- package/package.json +42 -42
@@ -75,7 +75,6 @@
|
|
75
75
|
<script setup lang="ts">
|
76
76
|
import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
77
77
|
import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
78
|
-
import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
|
79
78
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
80
79
|
import type { UI_T_Project } from '~/lib/models/types'
|
81
80
|
import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
|
@@ -41,6 +41,7 @@
|
|
41
41
|
</template>
|
42
42
|
|
43
43
|
<script lang="ts" setup>
|
44
|
+
import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
44
45
|
import type { UI_T_Project } from '~/lib/models/types'
|
45
46
|
import type { UI_I_SendTaskParams, UI_I_ModalPayload } from '~/lib/models/interfaces'
|
46
47
|
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
@@ -52,7 +53,6 @@ import type {
|
|
52
53
|
} from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
53
54
|
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
54
55
|
import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
|
55
|
-
import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
|
56
56
|
import type { UI_I_BackupAction } from '~/components/common/pages/backups/lib/models/interfaces'
|
57
57
|
import type { UI_I_NameCheck } from '~/components/common/pages/backups/modals/restore/name/lib/models/interfaces'
|
58
58
|
import { sendTask } from '~/lib/utils/sendTask'
|
@@ -1,376 +1,379 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="create-backup">
|
3
|
-
<atoms-wizard
|
4
|
-
show
|
5
|
-
:wizard="wizard"
|
6
|
-
:selected-scheme="selectedScheme"
|
7
|
-
:title="title"
|
8
|
-
:localization="localization"
|
9
|
-
:test-id="testId"
|
10
|
-
@change-steps="onChangeSteps"
|
11
|
-
@hide="onHideModal"
|
12
|
-
@submit="onFinish"
|
13
|
-
>
|
14
|
-
<template #modalBody="{ selectedStep }">
|
15
|
-
<atoms-alert
|
16
|
-
v-show="errors.length"
|
17
|
-
status="alert-danger"
|
18
|
-
:items="errors"
|
19
|
-
test-id="create-backup-alert"
|
20
|
-
@remove="onRemoveValidationErrors"
|
21
|
-
/>
|
22
|
-
|
23
|
-
<common-pages-scheduled-tasks-modals-common-new-task-form
|
24
|
-
v-show="selectedStep.id === dynamicSteps.schedulingOptions"
|
25
|
-
v-model="modelSchedulerTask"
|
26
|
-
:target="props.selectedVmName"
|
27
|
-
class="new-task-form"
|
28
|
-
/>
|
29
|
-
|
30
|
-
<common-pages-backups-modals-create-backup-general
|
31
|
-
v-show="selectedStep.id === dynamicSteps.general"
|
32
|
-
v-model="model"
|
33
|
-
:show="selectedStep.id === dynamicSteps.general"
|
34
|
-
:general-submit="generalSubmit"
|
35
|
-
@check-name="onCheckName"
|
36
|
-
/>
|
37
|
-
|
38
|
-
<common-pages-backups-modals-create-backup-disks
|
39
|
-
v-show="selectedStep.id === dynamicSteps.disks"
|
40
|
-
v-model="model"
|
41
|
-
:disks="props.disks"
|
42
|
-
:disks-loading="props.disksLoading"
|
43
|
-
/>
|
44
|
-
|
45
|
-
<common-pages-backups-modals-create-backup-datastores
|
46
|
-
v-show="selectedStep.id === dynamicSteps.datastores"
|
47
|
-
v-model="model"
|
48
|
-
:datastore-table="props.datastoreTable"
|
49
|
-
:datastore-table-loading="props.datastoreTableLoading"
|
50
|
-
@change="onChangeDatastore"
|
51
|
-
/>
|
52
|
-
|
53
|
-
<common-pages-backups-modals-create-backup-configuration
|
54
|
-
v-show="selectedStep.id === dynamicSteps.configuration"
|
55
|
-
v-model="model"
|
56
|
-
/>
|
57
|
-
|
58
|
-
<common-ready-to-complete
|
59
|
-
v-show="selectedStep.id === dynamicSteps.readyComplete"
|
60
|
-
:data="readyToCompleteInfo"
|
61
|
-
/>
|
62
|
-
</template>
|
63
|
-
</atoms-wizard>
|
64
|
-
</div>
|
65
|
-
</template>
|
66
|
-
|
67
|
-
<script setup lang="ts">
|
68
|
-
import type {
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
import
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
(event: '
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
const
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
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
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
}
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
}
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
//
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
})
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
const
|
360
|
-
errors.value =
|
361
|
-
}
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
const
|
367
|
-
emits('
|
368
|
-
}
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
1
|
+
<template>
|
2
|
+
<div class="create-backup">
|
3
|
+
<atoms-wizard
|
4
|
+
show
|
5
|
+
:wizard="wizard"
|
6
|
+
:selected-scheme="selectedScheme"
|
7
|
+
:title="title"
|
8
|
+
:localization="localization"
|
9
|
+
:test-id="testId"
|
10
|
+
@change-steps="onChangeSteps"
|
11
|
+
@hide="onHideModal"
|
12
|
+
@submit="onFinish"
|
13
|
+
>
|
14
|
+
<template #modalBody="{ selectedStep }">
|
15
|
+
<atoms-alert
|
16
|
+
v-show="errors.length"
|
17
|
+
status="alert-danger"
|
18
|
+
:items="errors"
|
19
|
+
test-id="create-backup-alert"
|
20
|
+
@remove="onRemoveValidationErrors"
|
21
|
+
/>
|
22
|
+
|
23
|
+
<common-pages-scheduled-tasks-modals-common-new-task-form
|
24
|
+
v-show="selectedStep.id === dynamicSteps.schedulingOptions"
|
25
|
+
v-model="modelSchedulerTask"
|
26
|
+
:target="props.selectedVmName"
|
27
|
+
class="new-task-form"
|
28
|
+
/>
|
29
|
+
|
30
|
+
<common-pages-backups-modals-create-backup-general
|
31
|
+
v-show="selectedStep.id === dynamicSteps.general"
|
32
|
+
v-model="model"
|
33
|
+
:show="selectedStep.id === dynamicSteps.general"
|
34
|
+
:general-submit="generalSubmit"
|
35
|
+
@check-name="onCheckName"
|
36
|
+
/>
|
37
|
+
|
38
|
+
<common-pages-backups-modals-create-backup-disks
|
39
|
+
v-show="selectedStep.id === dynamicSteps.disks"
|
40
|
+
v-model="model"
|
41
|
+
:disks="props.disks"
|
42
|
+
:disks-loading="props.disksLoading"
|
43
|
+
/>
|
44
|
+
|
45
|
+
<common-pages-backups-modals-create-backup-datastores
|
46
|
+
v-show="selectedStep.id === dynamicSteps.datastores"
|
47
|
+
v-model="model"
|
48
|
+
:datastore-table="props.datastoreTable"
|
49
|
+
:datastore-table-loading="props.datastoreTableLoading"
|
50
|
+
@change="onChangeDatastore"
|
51
|
+
/>
|
52
|
+
|
53
|
+
<common-pages-backups-modals-create-backup-configuration
|
54
|
+
v-show="selectedStep.id === dynamicSteps.configuration"
|
55
|
+
v-model="model"
|
56
|
+
/>
|
57
|
+
|
58
|
+
<common-ready-to-complete
|
59
|
+
v-show="selectedStep.id === dynamicSteps.readyComplete"
|
60
|
+
:data="readyToCompleteInfo"
|
61
|
+
/>
|
62
|
+
</template>
|
63
|
+
</atoms-wizard>
|
64
|
+
</div>
|
65
|
+
</template>
|
66
|
+
|
67
|
+
<script setup lang="ts">
|
68
|
+
import type {
|
69
|
+
UI_I_WizardStep,
|
70
|
+
UI_I_ValidationReturn,
|
71
|
+
} from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
72
|
+
import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
73
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
74
|
+
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
|
75
|
+
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
76
|
+
import type {
|
77
|
+
UI_I_BackupDatastoreTable,
|
78
|
+
UI_I_CreateBackupForm,
|
79
|
+
UI_I_Pvm,
|
80
|
+
} from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
81
|
+
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
82
|
+
import type { UI_I_NameCheck } from '~/components/common/pages/backups/modals/restore/name/lib/models/interfaces'
|
83
|
+
import {
|
84
|
+
stepsSchemeInitial,
|
85
|
+
stepsFunc,
|
86
|
+
dynamicSteps,
|
87
|
+
} from '~/components/common/pages/backups/modals/createBackup/lib/config/steps'
|
88
|
+
import { strategyOptionsFunc } from '~/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions'
|
89
|
+
|
90
|
+
const model = defineModel<UI_I_CreateBackupForm>({ required: true })
|
91
|
+
const modelSchedulerTask = defineModel<UI_I_ScheduleNewTasksForm>(
|
92
|
+
'schedulerForm',
|
93
|
+
{ required: true }
|
94
|
+
)
|
95
|
+
|
96
|
+
const props = defineProps<{
|
97
|
+
isEdit: boolean
|
98
|
+
target: string
|
99
|
+
isScheduledTasks: boolean
|
100
|
+
isEditScheduledTasks: boolean
|
101
|
+
selectedVmName: string
|
102
|
+
disks: UI_I_Pvm['disk_devices']
|
103
|
+
disksLoading: boolean
|
104
|
+
datastoreTable: UI_I_BackupDatastoreTable
|
105
|
+
datastoreTableLoading: boolean
|
106
|
+
}>()
|
107
|
+
|
108
|
+
const emits = defineEmits<{
|
109
|
+
(event: 'change-step-create-backup', value: UI_I_WizardStep[]): void
|
110
|
+
(event: 'check-name', value: UI_I_NameCheck): void
|
111
|
+
(event: 'finish'): void
|
112
|
+
(event: 'hide'): void
|
113
|
+
}>()
|
114
|
+
|
115
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
116
|
+
const { $binary }: any = useNuxtApp()
|
117
|
+
|
118
|
+
const title = computed<string>(() => {
|
119
|
+
const { createBackup, updateBackup, scheduleNewTasks, scheduleTaskEdit } =
|
120
|
+
localization.value.common
|
121
|
+
let result = props.isEdit ? updateBackup : createBackup
|
122
|
+
if (props.isScheduledTasks) {
|
123
|
+
const schedulerMode = props.isEditScheduledTasks
|
124
|
+
? scheduleTaskEdit
|
125
|
+
: scheduleNewTasks
|
126
|
+
|
127
|
+
result = `${schedulerMode} (${createBackup})`
|
128
|
+
}
|
129
|
+
|
130
|
+
return result
|
131
|
+
})
|
132
|
+
|
133
|
+
const testId = ref<string>(props.isEdit ? 'update-backup' : 'create-backup')
|
134
|
+
|
135
|
+
const wizard: Wizard = new Wizard(
|
136
|
+
stepsFunc(localization.value),
|
137
|
+
stepsSchemeInitial(props.isScheduledTasks)
|
138
|
+
)
|
139
|
+
|
140
|
+
watch(
|
141
|
+
modelSchedulerTask,
|
142
|
+
(newValue: UI_I_ScheduleNewTasksForm) => {
|
143
|
+
if (props.isScheduledTasks) wizard.setDisabledNextButton(newValue.isValid)
|
144
|
+
},
|
145
|
+
{ immediate: true, deep: true }
|
146
|
+
)
|
147
|
+
|
148
|
+
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
149
|
+
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
|
150
|
+
emits('change-step-create-backup', value)
|
151
|
+
wizard.changeSteps(value, validationFunc)
|
152
|
+
}
|
153
|
+
|
154
|
+
const generalSubmit = ref<null | Function>(null)
|
155
|
+
|
156
|
+
const validationFunc = async (
|
157
|
+
value: UI_I_WizardStep[],
|
158
|
+
currentStep: UI_I_WizardStep,
|
159
|
+
nextStep: UI_I_WizardStep
|
160
|
+
): Promise<UI_I_ValidationReturn> => {
|
161
|
+
let stepHasError = false
|
162
|
+
const stepShouldStop = {
|
163
|
+
ifOnCurrentStep: false,
|
164
|
+
ifFromAnyStep: false,
|
165
|
+
stoppageStepId: -1,
|
166
|
+
}
|
167
|
+
|
168
|
+
if (
|
169
|
+
wizard.isValidateForStep(dynamicSteps.general, currentStep.id, nextStep.id)
|
170
|
+
) {
|
171
|
+
const nameValidation = await checkName(value)
|
172
|
+
|
173
|
+
value = nameValidation.newValue
|
174
|
+
stepHasError = stepHasError || nameValidation.stepHasError
|
175
|
+
}
|
176
|
+
|
177
|
+
if (
|
178
|
+
wizard.isValidateForStep(dynamicSteps.disks, currentStep.id, nextStep.id)
|
179
|
+
) {
|
180
|
+
const validation = checkDisks(value)
|
181
|
+
|
182
|
+
value = validation.newValue
|
183
|
+
stepHasError = stepHasError || validation.stepHasError
|
184
|
+
}
|
185
|
+
|
186
|
+
if (
|
187
|
+
wizard.isValidateForStep(
|
188
|
+
dynamicSteps.datastores,
|
189
|
+
currentStep.id,
|
190
|
+
nextStep.id
|
191
|
+
)
|
192
|
+
) {
|
193
|
+
const validation = checkDatastore(value)
|
194
|
+
|
195
|
+
value = validation.newValue
|
196
|
+
stepHasError = stepHasError || validation.stepHasError
|
197
|
+
}
|
198
|
+
|
199
|
+
return {
|
200
|
+
newValue: value,
|
201
|
+
stepHasError,
|
202
|
+
stepShouldStop,
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
const checkName = async (
|
207
|
+
value: UI_I_WizardStep[]
|
208
|
+
): Promise<UI_I_ValidationReturn> => {
|
209
|
+
let stepHasError = false
|
210
|
+
|
211
|
+
const { name } = model.value
|
212
|
+
if (!name) {
|
213
|
+
stepHasError = wizard.setValidation(dynamicSteps.general, 'name', {
|
214
|
+
fieldMessage: localization.value.common.nameIsRequired,
|
215
|
+
alertMessage: localization.value.common.nameIsRequired,
|
216
|
+
})
|
217
|
+
return {
|
218
|
+
stepHasError,
|
219
|
+
newValue: value,
|
220
|
+
}
|
221
|
+
}
|
222
|
+
return new Promise((resolve) => {
|
223
|
+
generalSubmit.value = (isValid: boolean): void => {
|
224
|
+
if (!isValid) {
|
225
|
+
stepHasError = wizard.setValidation(dynamicSteps.general, 'name', {
|
226
|
+
fieldMessage: 'aaa',
|
227
|
+
alertMessage: 'aaa',
|
228
|
+
})
|
229
|
+
} else if (wizard.hasMessage(dynamicSteps.general, 'name')) {
|
230
|
+
value = wizard.removeValidation(dynamicSteps.general, 'name', value)
|
231
|
+
}
|
232
|
+
|
233
|
+
resolve({
|
234
|
+
stepHasError,
|
235
|
+
newValue: value,
|
236
|
+
})
|
237
|
+
generalSubmit.value = null
|
238
|
+
}
|
239
|
+
})
|
240
|
+
}
|
241
|
+
const onCheckName = async (data: UI_I_NameCheck): Promise<void> => {
|
242
|
+
emits('check-name', data)
|
243
|
+
}
|
244
|
+
|
245
|
+
const checkDisks = (value: UI_I_WizardStep[]): UI_I_ValidationReturn => {
|
246
|
+
let stepHasError = false
|
247
|
+
|
248
|
+
const isValidStores = !!model.value?.disk_devices.length
|
249
|
+
if (!isValidStores) {
|
250
|
+
stepHasError = wizard.setValidation(dynamicSteps.disks, 'disk_devices', {
|
251
|
+
fieldMessage: localization.value.common.diskIsRequired,
|
252
|
+
alertMessage: localization.value.common.diskIsRequired,
|
253
|
+
})
|
254
|
+
showValidationErrors([localization.value.common.diskIsRequired])
|
255
|
+
} else if (wizard.hasMessage(dynamicSteps.disks, 'disk_devices')) {
|
256
|
+
value = wizard.removeValidation(dynamicSteps.disks, 'disk_devices', value)
|
257
|
+
onRemoveValidationErrors()
|
258
|
+
}
|
259
|
+
|
260
|
+
return {
|
261
|
+
stepHasError,
|
262
|
+
newValue: value,
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
const checkDatastore = (value: UI_I_WizardStep[]): UI_I_ValidationReturn => {
|
267
|
+
let stepHasError = false
|
268
|
+
|
269
|
+
const isValidStorage = !!model.value?.backup_storage.length
|
270
|
+
if (!isValidStorage) {
|
271
|
+
stepHasError = wizard.setValidation(
|
272
|
+
dynamicSteps.datastores,
|
273
|
+
'backup_storage',
|
274
|
+
{
|
275
|
+
fieldMessage: localization.value.common.datastoreIsRequired,
|
276
|
+
alertMessage: localization.value.common.datastoreIsRequired,
|
277
|
+
}
|
278
|
+
)
|
279
|
+
showValidationErrors([localization.value.common.datastoreIsRequired])
|
280
|
+
} else if (wizard.hasMessage(dynamicSteps.datastores, 'backup_storage')) {
|
281
|
+
value = wizard.removeValidation(
|
282
|
+
dynamicSteps.datastores,
|
283
|
+
'backup_storage',
|
284
|
+
value
|
285
|
+
)
|
286
|
+
onRemoveValidationErrors()
|
287
|
+
}
|
288
|
+
|
289
|
+
return {
|
290
|
+
stepHasError,
|
291
|
+
newValue: value,
|
292
|
+
}
|
293
|
+
}
|
294
|
+
|
295
|
+
const selectedDatastoresNames = ref<string[]>([])
|
296
|
+
const onChangeDatastore = (names: string[]): void => {
|
297
|
+
selectedDatastoresNames.value = names
|
298
|
+
}
|
299
|
+
|
300
|
+
const strategyOptions = ref<UI_I_SelectInputItem[]>(
|
301
|
+
strategyOptionsFunc(localization.value)
|
302
|
+
)
|
303
|
+
|
304
|
+
const readyToCompleteInfo = computed<UI_I_TableInfoItem[]>(() => {
|
305
|
+
// General
|
306
|
+
const result = [
|
307
|
+
{
|
308
|
+
label: localization.value.common.name,
|
309
|
+
value: model.value.name,
|
310
|
+
},
|
311
|
+
{
|
312
|
+
label: localization.value.common.description,
|
313
|
+
value: model.value.description,
|
314
|
+
},
|
315
|
+
]
|
316
|
+
|
317
|
+
// Disks
|
318
|
+
model.value.disk_devices.forEach((disk_device, i) => {
|
319
|
+
result.push({
|
320
|
+
label: `${localization.value.common.disk} ${i + 1}`,
|
321
|
+
value: disk_device.location,
|
322
|
+
})
|
323
|
+
})
|
324
|
+
|
325
|
+
// Datastores
|
326
|
+
result.push({
|
327
|
+
label: localization.value.common.datastore,
|
328
|
+
value: selectedDatastoresNames.value.join(', '),
|
329
|
+
})
|
330
|
+
|
331
|
+
// Configuration
|
332
|
+
result.push({
|
333
|
+
label: localization.value.common.strategy,
|
334
|
+
value:
|
335
|
+
strategyOptions.value.find(
|
336
|
+
(option) => option.value === model.value.strategy
|
337
|
+
)?.label || '',
|
338
|
+
})
|
339
|
+
// result.push({
|
340
|
+
// label: localization.value.common.backupWindow,
|
341
|
+
// value: model.value.start_window_min + '',
|
342
|
+
// })
|
343
|
+
|
344
|
+
const gbSizeByB = 1_073_741_824
|
345
|
+
const maxBandwidth =
|
346
|
+
model.value.bandwidth_limit >= gbSizeByB
|
347
|
+
? $binary.bToGb(model.value.bandwidth_limit) + ' Gbps'
|
348
|
+
: $binary.bToMb(model.value.bandwidth_limit) + ' Mbps'
|
349
|
+
|
350
|
+
result.push({
|
351
|
+
label: localization.value.common.maxBandwidth,
|
352
|
+
value: maxBandwidth,
|
353
|
+
})
|
354
|
+
|
355
|
+
return result
|
356
|
+
})
|
357
|
+
|
358
|
+
const errors = ref<string[]>([])
|
359
|
+
const showValidationErrors = (data: string[]): void => {
|
360
|
+
errors.value = data
|
361
|
+
}
|
362
|
+
const onRemoveValidationErrors = (): void => {
|
363
|
+
errors.value = []
|
364
|
+
}
|
365
|
+
|
366
|
+
const onFinish = (): void => {
|
367
|
+
emits('finish')
|
368
|
+
}
|
369
|
+
const onHideModal = (): void => {
|
370
|
+
emits('hide')
|
371
|
+
}
|
372
|
+
</script>
|
373
|
+
|
374
|
+
<style scoped lang="scss">
|
375
|
+
:deep(.modal-body) {
|
376
|
+
display: flex;
|
377
|
+
flex-direction: column;
|
378
|
+
}
|
379
|
+
</style>
|
@@ -1,7 +1,7 @@
|
|
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'
|
1
3
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
2
|
-
import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
|
3
4
|
import type { UI_I_DynamicSteps } from '~/components/common/pages/backups/modals/createBackup/lib/models/interfaces'
|
4
|
-
import { UI_E_WIZARD_STATUS } from '~/components/atoms/wizard/lib/models/enums'
|
5
5
|
|
6
6
|
export const dynamicSteps: UI_I_DynamicSteps = {
|
7
7
|
schedulingOptions: 0,
|
@@ -85,12 +85,12 @@
|
|
85
85
|
</template>
|
86
86
|
|
87
87
|
<script setup lang="ts">
|
88
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
89
88
|
import type {
|
90
89
|
UI_I_WizardStep,
|
91
90
|
UI_I_ValidationReturn,
|
92
|
-
} from '~/components/
|
93
|
-
import Wizard from '~/components/
|
91
|
+
} from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
92
|
+
import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
93
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
94
94
|
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
95
95
|
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
|
96
96
|
import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
|
@@ -1,6 +1,6 @@
|
|
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'
|
1
3
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
2
|
-
import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
|
3
|
-
import { UI_E_WIZARD_STATUS } from '~/components/atoms/wizard/lib/models/enums'
|
4
4
|
|
5
5
|
export const dynamicSteps = {
|
6
6
|
selectType: 0,
|
package/package.json
CHANGED
@@ -1,42 +1,42 @@
|
|
1
|
-
{
|
2
|
-
"name": "bfg-common",
|
3
|
-
"private": false,
|
4
|
-
"version": "1.5.
|
5
|
-
"scripts": {
|
6
|
-
"build": "nuxt build",
|
7
|
-
"dev": "nuxt dev --port=3002",
|
8
|
-
"generate": "nuxt generate",
|
9
|
-
"preview": "nuxt preview",
|
10
|
-
"postinstall": "nuxt prepare",
|
11
|
-
"minify": "node minify.js",
|
12
|
-
"prepublishOnly": "node minify.js"
|
13
|
-
},
|
14
|
-
"devDependencies": {
|
15
|
-
"@novnc/novnc": "1.4.0",
|
16
|
-
"@vueuse/core": "10.1.2",
|
17
|
-
"@vueuse/nuxt": "10.1.2",
|
18
|
-
"eslint-config-prettier": "^8.5.0",
|
19
|
-
"nuxt": "3.11.2",
|
20
|
-
"prettier": "2.7.1",
|
21
|
-
"sass": "^1.54.9",
|
22
|
-
"sass-loader": "^10.3.1",
|
23
|
-
"terser": "^5.22.0",
|
24
|
-
"vite-plugin-eslint": "^1.8.1",
|
25
|
-
"xterm": "^5.1.0",
|
26
|
-
"xterm-addon-attach": "^0.8.0",
|
27
|
-
"xterm-addon-fit": "^0.7.0",
|
28
|
-
"xterm-addon-serialize": "^0.9.0",
|
29
|
-
"xterm-addon-unicode11": "^0.5.0",
|
30
|
-
"xterm-addon-web-links": "^0.8.0",
|
31
|
-
"eslint-plugin-myrules": "file:./eslint"
|
32
|
-
},
|
33
|
-
"dependencies": {
|
34
|
-
"@nuxtjs/eslint-config-typescript": "^12.0.0",
|
35
|
-
"@vueuse/components": "^10.1.2",
|
36
|
-
"date-fns": "^2.29.3",
|
37
|
-
"bfg-nuxt-3-graph": "1.0.26",
|
38
|
-
"bfg-uikit": "1.0.502",
|
39
|
-
"html2canvas": "^1.4.1",
|
40
|
-
"prettier-eslint": "^15.0.1"
|
41
|
-
}
|
42
|
-
}
|
1
|
+
{
|
2
|
+
"name": "bfg-common",
|
3
|
+
"private": false,
|
4
|
+
"version": "1.5.431",
|
5
|
+
"scripts": {
|
6
|
+
"build": "nuxt build",
|
7
|
+
"dev": "nuxt dev --port=3002",
|
8
|
+
"generate": "nuxt generate",
|
9
|
+
"preview": "nuxt preview",
|
10
|
+
"postinstall": "nuxt prepare",
|
11
|
+
"minify": "node minify.js",
|
12
|
+
"prepublishOnly": "node minify.js"
|
13
|
+
},
|
14
|
+
"devDependencies": {
|
15
|
+
"@novnc/novnc": "1.4.0",
|
16
|
+
"@vueuse/core": "10.1.2",
|
17
|
+
"@vueuse/nuxt": "10.1.2",
|
18
|
+
"eslint-config-prettier": "^8.5.0",
|
19
|
+
"nuxt": "3.11.2",
|
20
|
+
"prettier": "2.7.1",
|
21
|
+
"sass": "^1.54.9",
|
22
|
+
"sass-loader": "^10.3.1",
|
23
|
+
"terser": "^5.22.0",
|
24
|
+
"vite-plugin-eslint": "^1.8.1",
|
25
|
+
"xterm": "^5.1.0",
|
26
|
+
"xterm-addon-attach": "^0.8.0",
|
27
|
+
"xterm-addon-fit": "^0.7.0",
|
28
|
+
"xterm-addon-serialize": "^0.9.0",
|
29
|
+
"xterm-addon-unicode11": "^0.5.0",
|
30
|
+
"xterm-addon-web-links": "^0.8.0",
|
31
|
+
"eslint-plugin-myrules": "file:./eslint"
|
32
|
+
},
|
33
|
+
"dependencies": {
|
34
|
+
"@nuxtjs/eslint-config-typescript": "^12.0.0",
|
35
|
+
"@vueuse/components": "^10.1.2",
|
36
|
+
"date-fns": "^2.29.3",
|
37
|
+
"bfg-nuxt-3-graph": "1.0.26",
|
38
|
+
"bfg-uikit": "1.0.502",
|
39
|
+
"html2canvas": "^1.4.1",
|
40
|
+
"prettier-eslint": "^15.0.1"
|
41
|
+
}
|
42
|
+
}
|