bfg-common 1.5.726 → 1.5.728
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/CODE_STYLE.md +109 -109
- package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
- package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
- package/assets/img/icons/icons-sprite-light-3.svg +227 -227
- package/assets/img/icons/icons-sprite-light-5.svg +488 -488
- package/assets/localization/local_be.json +2 -0
- package/assets/localization/local_en.json +2 -0
- package/assets/localization/local_hy.json +2 -0
- package/assets/localization/local_kk.json +2 -0
- package/assets/localization/local_ru.json +2 -0
- package/assets/localization/local_zh.json +2 -0
- package/components/atoms/TheIcon3.vue +50 -50
- package/components/atoms/collapse/CollapseNav.vue +170 -170
- package/components/atoms/perPage/PerPage.vue +58 -58
- package/components/atoms/table/dataGrid/DataGrid.vue +1718 -1718
- package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
- package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
- package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
- package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
- package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
- package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
- package/components/common/diagramMain/port/Port.vue +580 -580
- package/components/common/layout/console/Console.vue +70 -70
- package/components/common/layout/theHeader/New.vue +1 -2
- package/components/common/layout/theHeader/Old.vue +2 -2
- package/components/common/layout/theHeader/TheHeader.vue +0 -2
- package/components/common/layout/theHeader/userMenu/UserMenu.vue +2 -2
- package/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types.ts +7 -7
- package/components/common/pages/backups/DetailView.vue +52 -52
- package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
- package/components/common/pages/backups/modals/Modals.vue +243 -243
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
- package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
- package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
- package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
- package/components/common/pages/backups/modals/restore/Restore.vue +289 -303
- package/components/common/pages/backups/modals/restore/lib/config/readyToCompleteOptions.ts +84 -84
- package/components/common/pages/backups/modals/restore/lib/config/restoreCodes.ts +2 -1
- package/components/common/pages/backups/modals/restore/lib/config/steps.ts +121 -113
- package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
- package/components/common/pages/backups/modals/restore/types/{TypesNew.vue → New.vue} +95 -95
- package/components/common/pages/backups/modals/restore/types/{TypesOld.vue → Old.vue} +62 -61
- package/components/common/pages/backups/modals/restore/types/Types.vue +31 -19
- 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 +5 -0
- package/components/common/pages/home/lib/models/interfaces.ts +48 -48
- package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
- package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
- package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
- package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
- package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
- package/components/common/pages/tasks/Tasks.vue +125 -125
- package/components/common/pages/tasks/table/Table.vue +373 -373
- package/components/common/pages/tasks/table/lib/config/config.ts +279 -279
- package/components/common/pages/tasks/table/lib/models/interfaces.ts +9 -9
- package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
- package/components/common/select/radio/RadioGroup.vue +137 -137
- package/components/common/spiceConsole/Drawer.vue +420 -420
- package/components/common/spiceConsole/SpiceConsole.vue +184 -184
- package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
- package/components/common/tools/Actions.vue +207 -207
- package/components/common/treeView/TreeView.vue +52 -52
- package/components/common/vm/actions/clone/lib/config/steps.ts +295 -295
- package/components/common/vm/actions/clone/new/New.vue +438 -438
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +283 -283
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +156 -156
- package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
- package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/options/New.vue +264 -264
- package/components/common/vm/actions/common/select/options/Options.vue +58 -58
- package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
- package/components/common/vm/actions/common/select/storage/new/New.vue +311 -311
- package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
- package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
- package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
- package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
- package/components/common/wizards/common/steps/computeResource/New.vue +93 -93
- package/components/common/wizards/common/steps/name/Name.vue +178 -178
- package/components/common/wizards/common/steps/name/New.vue +221 -221
- package/components/common/wizards/common/steps/name/Old.vue +121 -121
- package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
- package/components/common/wizards/common/steps/name/location/New.vue +40 -40
- package/components/common/wizards/datastore/add/Add.vue +228 -228
- package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
- package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
- package/composables/useAppVersion.ts +21 -21
- package/composables/useBrowse.ts +24 -24
- package/composables/useLocal.ts +6 -6
- package/composables/useLocalCommon.ts +39 -39
- package/lib/models/types.ts +59 -59
- package/package.json +2 -2
- package/plugins/console.ts +21 -21
- package/plugins/mouse.ts +21 -21
- package/plugins/panelStates.ts +70 -70
- package/plugins/text.ts +59 -59
- package/public/spice-console/application/clientgui.js +854 -854
- package/public/spice-console/application/packetfactory.js +211 -211
- package/public/spice-console/application/virtualmouse.js +147 -147
- package/public/spice-console/lib/images/bitmap.js +203 -203
- package/public/spice-console/network/spicechannel.js +440 -440
- package/public/spice-console/process/cursorprocess.js +128 -128
- package/public/spice-console/process/inputprocess.js +227 -227
- package/public/spice-console/process/mainprocess.js +212 -212
- package/public/spice-console/run.js +210 -210
- package/store/main/mutations.ts +7 -7
- package/store/main/state.ts +7 -7
- package/store/tasks/mappers/recentTasks.ts +123 -123
- package/store/tasks/mutations.ts +82 -82
- /package/components/common/pages/backups/modals/restore/{RestoreNew.vue → New.vue} +0 -0
- /package/components/common/pages/backups/modals/restore/{RestoreOld.vue → Old.vue} +0 -0
|
@@ -1,303 +1,289 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
v-model="model"
|
|
5
|
-
v-model:is-show-confirm="isShowConfirm"
|
|
6
|
-
:wizard="wizard"
|
|
7
|
-
:selected-scheme="selectedScheme"
|
|
8
|
-
:alert-messages="alertMessages"
|
|
9
|
-
:storage-submit="storageSubmit"
|
|
10
|
-
:datastore="props.datastore"
|
|
11
|
-
:datastore-loading="props.datastoreLoading"
|
|
12
|
-
:networks="props.networks"
|
|
13
|
-
:ready-complete-data="readyToCompleteInfo"
|
|
14
|
-
:selected-storage="selectedStorage"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@
|
|
18
|
-
@
|
|
19
|
-
@
|
|
20
|
-
@
|
|
21
|
-
@submit-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
const
|
|
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
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
emits('
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
</script>
|
|
292
|
-
|
|
293
|
-
<style scoped lang="scss">
|
|
294
|
-
:deep(.modal-body) {
|
|
295
|
-
display: flex;
|
|
296
|
-
flex-direction: column;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
.loader-wrap {
|
|
300
|
-
background-color: rgba(0, 0, 0, 0.3);
|
|
301
|
-
z-index: var(--z-fixed);
|
|
302
|
-
}
|
|
303
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
v-model="model"
|
|
5
|
+
v-model:is-show-confirm="isShowConfirm"
|
|
6
|
+
:wizard="wizard"
|
|
7
|
+
:selected-scheme="selectedScheme"
|
|
8
|
+
:alert-messages="alertMessages"
|
|
9
|
+
:storage-submit="storageSubmit"
|
|
10
|
+
:datastore="props.datastore"
|
|
11
|
+
:datastore-loading="props.datastoreLoading"
|
|
12
|
+
:networks="props.networks"
|
|
13
|
+
:ready-complete-data="readyToCompleteInfo"
|
|
14
|
+
:selected-storage="selectedStorage"
|
|
15
|
+
:is-loading="isLoading"
|
|
16
|
+
:errors="errors"
|
|
17
|
+
@change-storage="onChangeStorage"
|
|
18
|
+
@get-datastore="getDatastoreTableFunc"
|
|
19
|
+
@get-networks="onGetNetworks"
|
|
20
|
+
@change-steps="onChangeSteps"
|
|
21
|
+
@submit-confirm="onFinish"
|
|
22
|
+
@hide="onHideModal"
|
|
23
|
+
@submit-wizard="onSubmitWizard"
|
|
24
|
+
@remove-validation-errors="onRemoveValidationErrors"
|
|
25
|
+
/>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
import type {
|
|
30
|
+
UI_I_WizardStep,
|
|
31
|
+
UI_I_ValidationReturn,
|
|
32
|
+
} from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
33
|
+
import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
|
34
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
35
|
+
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
36
|
+
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
|
|
37
|
+
import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
|
|
38
|
+
import type { UI_I_NameCheck } from '~/components/common/pages/backups/modals/restore/name/lib/models/interfaces'
|
|
39
|
+
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
40
|
+
import {
|
|
41
|
+
stepsSchemeInitial,
|
|
42
|
+
stepsFunc,
|
|
43
|
+
dynamicSteps,
|
|
44
|
+
} from '~/components/common/pages/backups/modals/restore/lib/config/steps'
|
|
45
|
+
import { restoreCodes } from '~/components/common/pages/backups/modals/restore/lib/config/restoreCodes'
|
|
46
|
+
import { readyToCompleteOptions } from '~/components/common/pages/backups/modals/restore/lib/config/readyToCompleteOptions'
|
|
47
|
+
import {
|
|
48
|
+
checkDisksValidation,
|
|
49
|
+
checkNameValidation,
|
|
50
|
+
} from '~/components/common/pages/backups/modals/restore/validation/validation'
|
|
51
|
+
|
|
52
|
+
const model = defineModel<UI_I_RestoreForm>({ required: true })
|
|
53
|
+
|
|
54
|
+
const props = defineProps<{
|
|
55
|
+
datastore: UI_I_DatastoreTableItem[]
|
|
56
|
+
datastoreLoading: boolean
|
|
57
|
+
networks: UI_I_NetworkTableItem[]
|
|
58
|
+
}>()
|
|
59
|
+
const emits = defineEmits<{
|
|
60
|
+
(event: 'get-datastore', value: string): void
|
|
61
|
+
(event: 'get-networks', value: string): void
|
|
62
|
+
(event: 'check-name', value: UI_I_NameCheck): void
|
|
63
|
+
(event: 'finish'): void
|
|
64
|
+
(event: 'hide'): void
|
|
65
|
+
}>()
|
|
66
|
+
|
|
67
|
+
const { $store }: any = useNuxtApp()
|
|
68
|
+
|
|
69
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
70
|
+
|
|
71
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
72
|
+
const currentComponent = computed(() =>
|
|
73
|
+
isNewView.value
|
|
74
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
75
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
const wizard: Wizard = new Wizard(
|
|
79
|
+
stepsFunc(localization.value),
|
|
80
|
+
stepsSchemeInitial
|
|
81
|
+
)
|
|
82
|
+
const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
|
|
83
|
+
|
|
84
|
+
watch(
|
|
85
|
+
() => model.value.restore_code,
|
|
86
|
+
(newValue) => {
|
|
87
|
+
wizard.changeScheme(newValue - 1)
|
|
88
|
+
},
|
|
89
|
+
{ immediate: true }
|
|
90
|
+
)
|
|
91
|
+
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
|
92
|
+
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
|
|
93
|
+
wizard.changeSteps(value, validationFunc)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const storageSubmit = ref<null | Function>(null)
|
|
97
|
+
|
|
98
|
+
const validationFunc = async (
|
|
99
|
+
value: UI_I_WizardStep[],
|
|
100
|
+
currentStep: UI_I_WizardStep,
|
|
101
|
+
nextStep: UI_I_WizardStep
|
|
102
|
+
): Promise<UI_I_ValidationReturn> => {
|
|
103
|
+
let stepHasError = false
|
|
104
|
+
const stepShouldStop = {
|
|
105
|
+
ifOnCurrentStep: false,
|
|
106
|
+
ifFromAnyStep: false,
|
|
107
|
+
stoppageStepId: -1,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
wizard.setLoader(true)
|
|
111
|
+
|
|
112
|
+
if (
|
|
113
|
+
wizard.isValidateForStep(
|
|
114
|
+
dynamicSteps.selectName,
|
|
115
|
+
currentStep.id,
|
|
116
|
+
nextStep.id
|
|
117
|
+
)
|
|
118
|
+
) {
|
|
119
|
+
const nameValidation = await checkNameValidation(
|
|
120
|
+
value,
|
|
121
|
+
model.value.pvm.name,
|
|
122
|
+
wizard,
|
|
123
|
+
localization.value,
|
|
124
|
+
showValidationErrors,
|
|
125
|
+
onRemoveValidationErrors,
|
|
126
|
+
emits
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
value = nameValidation.newValue
|
|
130
|
+
stepHasError = stepHasError || nameValidation.stepHasError
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (
|
|
134
|
+
wizard.isValidateForStep(
|
|
135
|
+
dynamicSteps.selectStorage,
|
|
136
|
+
currentStep.id,
|
|
137
|
+
nextStep.id
|
|
138
|
+
)
|
|
139
|
+
) {
|
|
140
|
+
const validation = await checkStorage(value)
|
|
141
|
+
|
|
142
|
+
value = validation.newValue
|
|
143
|
+
stepHasError = stepHasError || validation.stepHasError
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (
|
|
147
|
+
wizard.isValidateForStep(
|
|
148
|
+
dynamicSteps.selectDisks,
|
|
149
|
+
currentStep.id,
|
|
150
|
+
nextStep.id
|
|
151
|
+
)
|
|
152
|
+
) {
|
|
153
|
+
const validation = checkDisksValidation(
|
|
154
|
+
value,
|
|
155
|
+
!!model.value?.pvm.disk_devices.length,
|
|
156
|
+
wizard,
|
|
157
|
+
localization.value,
|
|
158
|
+
showValidationErrors,
|
|
159
|
+
onRemoveValidationErrors
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
value = validation.newValue
|
|
163
|
+
stepHasError = stepHasError || validation.stepHasError
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
wizard.setLoader(false)
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
newValue: value,
|
|
170
|
+
stepHasError,
|
|
171
|
+
stepShouldStop,
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const checkStorage = async (
|
|
176
|
+
value: UI_I_WizardStep[]
|
|
177
|
+
): Promise<UI_I_ValidationReturn> => {
|
|
178
|
+
let stepHasError = false
|
|
179
|
+
|
|
180
|
+
return new Promise((resolve) => {
|
|
181
|
+
storageSubmit.value = (isValid: boolean): void => {
|
|
182
|
+
if (!isValid) {
|
|
183
|
+
stepHasError = wizard.setValidation(
|
|
184
|
+
dynamicSteps.selectStorage,
|
|
185
|
+
'storage',
|
|
186
|
+
{
|
|
187
|
+
fieldMessage: localization.value.common.selectStorage,
|
|
188
|
+
alertMessage:
|
|
189
|
+
localization.value.common.selectValidDestinationStorage,
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
} else if (wizard.hasMessage(dynamicSteps.selectStorage, 'storage')) {
|
|
193
|
+
value = wizard.removeValidation(
|
|
194
|
+
dynamicSteps.selectStorage,
|
|
195
|
+
'storage',
|
|
196
|
+
value
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
resolve({
|
|
201
|
+
stepHasError,
|
|
202
|
+
newValue: value,
|
|
203
|
+
})
|
|
204
|
+
storageSubmit.value = null
|
|
205
|
+
}
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const getDatastoreTableFunc = async (): Promise<void> => {
|
|
210
|
+
emits('get-datastore', model.value.bucket)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const selectedStorageName = ref<string>('')
|
|
214
|
+
const selectedStorage = ref<UI_I_DatastoreTableItem | null>(null)
|
|
215
|
+
const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
|
|
216
|
+
if (!storage) return
|
|
217
|
+
|
|
218
|
+
selectedStorageName.value = storage.name
|
|
219
|
+
selectedStorage.value = storage
|
|
220
|
+
model.value.pvm.storage = {
|
|
221
|
+
id: storage.id,
|
|
222
|
+
folder: '',
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const isLoading = ref<boolean>(true)
|
|
227
|
+
// В Сфере и Прокураторе одно и тоже
|
|
228
|
+
const getPvm = async (): Promise<void> => {
|
|
229
|
+
await $store.dispatch('backup/A_GET_PVM', {
|
|
230
|
+
target: model.value.backup_storage,
|
|
231
|
+
bucketId: model.value.bucket, // TODO bucket поменять на vm так как это сейчас vm
|
|
232
|
+
backupId: model.value.backup,
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
model.value.pvm = useDeepCopy($store.getters['backup/getPvm'])
|
|
236
|
+
model.value.pvm.disk_devices = [] // ToDo если не обнулить тогда в форме всегда будет выбранны диски
|
|
237
|
+
isLoading.value = false
|
|
238
|
+
}
|
|
239
|
+
getPvm()
|
|
240
|
+
|
|
241
|
+
const readyToCompleteInfo = computed<UI_I_TableInfoItem[]>(() =>
|
|
242
|
+
readyToCompleteOptions(
|
|
243
|
+
model.value,
|
|
244
|
+
localization.value,
|
|
245
|
+
selectedStorageName.value
|
|
246
|
+
)
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
const errors = ref<string[]>([])
|
|
250
|
+
const showValidationErrors = (data: string[]): void => {
|
|
251
|
+
errors.value = data
|
|
252
|
+
}
|
|
253
|
+
const onRemoveValidationErrors = (): void => {
|
|
254
|
+
errors.value = []
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const onFinish = (): void => {
|
|
258
|
+
emits('finish')
|
|
259
|
+
}
|
|
260
|
+
const onHideModal = (): void => {
|
|
261
|
+
emits('hide')
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
const isShowConfirm = ref<boolean>(false)
|
|
265
|
+
|
|
266
|
+
const onSubmitWizard = (): void => {
|
|
267
|
+
if (model.value.restore_code === restoreCodes.existing) {
|
|
268
|
+
isShowConfirm.value = true
|
|
269
|
+
} else {
|
|
270
|
+
onFinish()
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const onGetNetworks = (hostId: string): void => {
|
|
275
|
+
emits('get-networks', hostId)
|
|
276
|
+
}
|
|
277
|
+
</script>
|
|
278
|
+
|
|
279
|
+
<style scoped lang="scss">
|
|
280
|
+
:deep(.modal-body) {
|
|
281
|
+
display: flex;
|
|
282
|
+
flex-direction: column;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.loader-wrap {
|
|
286
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
287
|
+
z-index: var(--z-fixed);
|
|
288
|
+
}
|
|
289
|
+
</style>
|