bfg-common 1.5.154 → 1.5.155

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.
Files changed (30) hide show
  1. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  2. package/components/common/browse/lib/models/interfaces.ts +5 -5
  3. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  4. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  5. package/components/common/diagramMain/lib/models/types.ts +21 -21
  6. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  7. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  8. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  9. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  10. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  11. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  12. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  13. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
  14. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  15. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  16. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  17. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  18. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  19. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  20. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  21. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  22. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  23. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  24. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  25. package/components/common/diagramMain/port/Ports.vue +47 -47
  26. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +1 -2
  27. package/components/common/wizards/vm/migrate/Migrate.vue +344 -343
  28. package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +190 -188
  29. package/components/common/wizards/vm/migrate/select/computeResource/lib/config/tabsPannel.ts +39 -29
  30. package/package.json +1 -1
@@ -1,343 +1,344 @@
1
- <template>
2
- <div class="migrate-vm">
3
- <atoms-wizard
4
- show
5
- :wizard="wizard"
6
- :selected-scheme="selectedScheme"
7
- :title="title"
8
- :localization="localization"
9
- class="migrate-vm-wizard"
10
- test-id="migrate-vm-wizard"
11
- @change-steps="onChangeSteps"
12
- @hide="onHideModal"
13
- @submit="onFinish"
14
- >
15
- <template #description="{ selectedStep }">
16
- <div class="flex items-center justify-between">
17
- <h2 class="custom-sub-title">
18
- {{ selectedStep.subTitle }}
19
- </h2>
20
- <common-wizards-vm-migrate-vm-origin
21
- v-if="props.vmOrigin"
22
- :vm-origin="props.vmOrigin"
23
- />
24
- </div>
25
- </template>
26
- <template #modalBody="{ selectedStep }">
27
- <common-pages-scheduled-tasks-modals-common-new-task-form
28
- v-if="selectedStep.id === dynamicSteps.schedulingOptions"
29
- v-model="modelSchedulerTask"
30
- :target="selectedVirtualMachine"
31
- />
32
-
33
- <common-wizards-vm-migrate-select-type
34
- v-if="selectedStep.id === dynamicSteps.selectMigrationType"
35
- v-model="form.migrate_type"
36
- :project="props.project"
37
- />
38
-
39
- <common-wizards-vm-migrate-select-target-server
40
- v-if="selectedStep.id === dynamicSteps.selectTargetVCenterSer"
41
- v-model="form.target_server"
42
- v-model:connect-server="isConnectSourceServer"
43
- :wizard="wizard"
44
- />
45
-
46
- <common-wizards-vm-migrate-select-compute-resource
47
- v-if="isSphere"
48
- v-show="selectedStep.id === dynamicSteps.selectComputeResource"
49
- v-model="form"
50
- :alert-messages="alertMessages[3]"
51
- :get-compute-resource-data="props.getComputeResourceData"
52
- :compute-resource-data="props.computeResourceTableData"
53
- :compute-resource-tree="props.computeResourceTree"
54
- @hide-alert="onHideAlert"
55
- />
56
-
57
- <common-wizards-vm-migrate-select-storage
58
- v-show="selectedStep.id === dynamicSteps.selectStorage"
59
- v-model="form"
60
- :alert-messages="alertMessages[4]"
61
- :get-datastore-table-func="props.getDatastoreTableFunc"
62
- :datastore="props.datastore"
63
- :connected-storage-id-default="connectedStorageIdOnVm"
64
- :configure-per-disks="props.configurePerDisks"
65
- @hide-alert="onHideAlert"
66
- />
67
-
68
- <common-wizards-vm-migrate-select-network
69
- v-if="isSphere"
70
- v-show="selectedStep.id === dynamicSteps.selectNetworks"
71
- v-model="form.network"
72
- :vm-info="props.vmInfo"
73
- :networks="props.networks"
74
- />
75
-
76
- <common-wizards-vm-migrate-select-priority
77
- v-if="selectedStep.id === dynamicSteps.migrationStrategy"
78
- v-model="form.vMotion_priority"
79
- :vm-state="props.vmState"
80
- />
81
-
82
- <common-ready-to-complete
83
- v-if="selectedStep.id === dynamicSteps.readyComplete"
84
- :data="dataReadyView"
85
- />
86
- </template>
87
- </atoms-wizard>
88
- </div>
89
- </template>
90
-
91
- <script setup lang="ts">
92
- import type {
93
- UI_I_WizardStep,
94
- UI_I_ValidationReturn,
95
- } from '~/components/atoms/wizard/lib/models/interfaces'
96
- import Wizard from '~/components/atoms/wizard/lib/utils/utils'
97
- import {
98
- dynamicSteps,
99
- stepsFunc,
100
- stepsSchemeInitial,
101
- } from '~/components/common/wizards/vm/migrate/lib/config/steps'
102
- import type { UI_I_Localization } from '~/lib/models/interfaces'
103
- import type { UI_T_Project } from '~/lib/models/types'
104
- import type {
105
- UI_I_MigrateFormLocal,
106
- UI_I_ChangeStepsSchemes,
107
- } from '~/components/common/wizards/vm/migrate/lib/models/interfaces'
108
- import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/select/type/lib/models/types'
109
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
110
- import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
111
- import type { UI_I_VmSettings } from '~/lib/models/store/vm/interfaces'
112
- import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
113
- import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/configure/disk/table/lib/models/interfaces'
114
- import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
115
- import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
116
- import type { UI_I_VmOrigin } from '~/components/common/wizards/vm/migrate/vmOrigin/lib/models/interfaces'
117
- import { constructDataReadyViewFunc } from '~/components/common/wizards/vm/migrate/lib/config/constructDataReady'
118
- import * as validation from '~/components/common/wizards/vm/migrate/lib/validations'
119
-
120
- const props = withDefaults(
121
- defineProps<{
122
- project: UI_T_Project
123
- isScheduledTasks: boolean
124
- isEditScheduledTasks: boolean
125
- vmSettings: UI_I_VmSettings | null
126
- vmName: string
127
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
128
- getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
129
- datastore: UI_I_DatastoreTableItem[]
130
- configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
131
- computeResourceTableData?: any
132
- computeResourceTree?: UI_I_TreeNode | null
133
- selectedVirtualMachine?: string
134
- vmState?: number
135
- vmInfo?: any | null
136
- networks?: any
137
- vmOrigin?: UI_I_VmOrigin | null
138
- }>(),
139
- {
140
- computeResourceTree: null,
141
- vmOrigin: null,
142
- }
143
- )
144
- const emits = defineEmits<{
145
- (event: 'finish', value: UI_I_MigrateFormLocal): void
146
- (event: 'get-networks', value: string): void
147
- (event: 'hide'): void
148
- }>()
149
- const modelSchedulerTask = defineModel<UI_I_ScheduleNewTasksForm>(
150
- 'schedulerForm',
151
- { required: true }
152
- )
153
-
154
- const localization = computed<UI_I_Localization>(() => useLocal())
155
-
156
- const isSphere = ref<boolean>(props.project === 'sphere')
157
-
158
- const wizard: Wizard = new Wizard(
159
- stepsFunc(localization.value, props.isScheduledTasks),
160
- stepsSchemeInitial
161
- )
162
-
163
- const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
164
- const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
165
-
166
- const title = computed<string>(() => {
167
- const { scheduleNewTasks, scheduleTaskEdit, migrate } =
168
- localization.value.common
169
- let result = migrate
170
- if (props.isScheduledTasks) {
171
- const schedulerMode = props.isEditScheduledTasks
172
- ? scheduleTaskEdit
173
- : scheduleNewTasks
174
-
175
- result = `${schedulerMode} (${migrate})`
176
- }
177
-
178
- return result
179
- })
180
-
181
- const isConnectSourceServer = ref<boolean>(false)
182
- const form = ref<UI_I_MigrateFormLocal>({
183
- migrate_type: props.project === 'procurator' ? 'storage' : 'resource',
184
- disk_format: 0,
185
- storage: null,
186
- configure: {
187
- type: 'batch-configure',
188
- disks: [],
189
- },
190
- target_server: {
191
- fqdn: '',
192
- user: '',
193
- password: '',
194
- },
195
- network: {},
196
- resource: {
197
- selectedNode: null,
198
- host: null,
199
- cluster: null,
200
- resourcePool: null,
201
- vApps: null,
202
- },
203
- vMotion_priority:
204
- props.vmState === 2 ? 'live' : props.vmState === 1 ? 'offline' : '',
205
- })
206
-
207
- const validationFunc = async (
208
- value: UI_I_WizardStep[],
209
- currentStep: UI_I_WizardStep,
210
- nextStep: UI_I_WizardStep
211
- ): Promise<UI_I_ValidationReturn> => {
212
- let stepHasError = false
213
-
214
- if (
215
- wizard.isValidateForStep(
216
- dynamicSteps.selectComputeResource,
217
- currentStep.id,
218
- nextStep.id
219
- )
220
- ) {
221
- const nameValidation = await validation.checkSelectedResourceSync(
222
- localization.value,
223
- form.value.resource,
224
- wizard,
225
- value
226
- )
227
-
228
- value = nameValidation.newValue
229
-
230
- stepHasError = nameValidation.stepHasError
231
- }
232
-
233
- if (
234
- wizard.isValidateForStep(
235
- dynamicSteps.selectStorage,
236
- currentStep.id,
237
- nextStep.id
238
- )
239
- ) {
240
- const nameValidation = await validation.checkSelectedDatastoreSync(
241
- localization.value,
242
- form.value.storage,
243
- wizard,
244
- value
245
- )
246
-
247
- value = nameValidation.newValue
248
-
249
- stepHasError = nameValidation.stepHasError
250
- }
251
-
252
- return {
253
- newValue: value,
254
- stepHasError,
255
- }
256
- }
257
- const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
258
- wizard.changeSteps(value, validationFunc)
259
-
260
- // Choosing Scheme
261
- watch(
262
- () => form.value.migrate_type,
263
- (newValue: UI_T_VmMigrateType) => {
264
- const schemes: UI_I_ChangeStepsSchemes = {
265
- procurator: {
266
- storage: props.isScheduledTasks ? 1 : 0,
267
- },
268
- sphere: {
269
- storage: props.isScheduledTasks ? 1 : 0,
270
- resource: props.isScheduledTasks ? 3 : 2,
271
- 'resource-storage': 4,
272
- server: 5,
273
- },
274
- }
275
-
276
- const projectSchemes = schemes[props.project]
277
-
278
- if (projectSchemes && projectSchemes[newValue] !== undefined) {
279
- wizard.changeScheme(projectSchemes[newValue] as number)
280
- }
281
- },
282
- { deep: true, immediate: true }
283
- )
284
- // Get networks
285
- watch(
286
- () => form.value.resource.host,
287
- (newValue) => {
288
- emits('get-networks', newValue.id)
289
- }
290
- )
291
-
292
- watch(
293
- modelSchedulerTask,
294
- (newValue: UI_I_ScheduleNewTasksForm) => {
295
- if (props.isScheduledTasks) wizard.setDisabledNextButton(newValue.isValid)
296
- },
297
- { immediate: true, deep: true }
298
- )
299
-
300
- const loading = ref<boolean>(false)
301
-
302
- const connectedStorageIdOnVm = computed<string>(
303
- () => props.vmSettings?.storage.id || ''
304
- )
305
-
306
- const dataReadyView = computed<UI_I_TableInfoItem>(() =>
307
- constructDataReadyViewFunc(props.vmName, form.value)
308
- )
309
- const onFinish = (): void => {
310
- loading.value = true
311
- emits('finish', form.value)
312
- loading.value = false
313
- }
314
-
315
- const onHideModal = (): void => {
316
- emits('hide')
317
- }
318
-
319
- const onHideAlert = (stepId: number): void => {
320
- wizard.hideAlertMessagesByStepId(stepId)
321
- }
322
- </script>
323
-
324
- <style scoped lang="scss">
325
- @import 'assets/scss/common/mixins.scss';
326
- .migrate-vm {
327
- .custom-sub-title {
328
- font-weight: 400;
329
- font-size: 13px;
330
- line-height: inherit;
331
- color: var(--add-vm-context-sub-title);
332
- }
333
-
334
- :deep(.modal-body) {
335
- height: inherit;
336
- @include flex($dir: column);
337
-
338
- .content-heading > div {
339
- width: 100%;
340
- }
341
- }
342
- }
343
- </style>
1
+ <template>
2
+ <div class="migrate-vm">
3
+ <atoms-wizard
4
+ show
5
+ :wizard="wizard"
6
+ :selected-scheme="selectedScheme"
7
+ :title="title"
8
+ :localization="localization"
9
+ class="migrate-vm-wizard"
10
+ test-id="migrate-vm-wizard"
11
+ @change-steps="onChangeSteps"
12
+ @hide="onHideModal"
13
+ @submit="onFinish"
14
+ >
15
+ <template #description="{ selectedStep }">
16
+ <div class="flex items-center justify-between">
17
+ <h2 class="custom-sub-title">
18
+ {{ selectedStep.subTitle }}
19
+ </h2>
20
+ <common-wizards-vm-migrate-vm-origin
21
+ v-if="props.vmOrigin"
22
+ :vm-origin="props.vmOrigin"
23
+ />
24
+ </div>
25
+ </template>
26
+ <template #modalBody="{ selectedStep }">
27
+ <common-pages-scheduled-tasks-modals-common-new-task-form
28
+ v-if="selectedStep.id === dynamicSteps.schedulingOptions"
29
+ v-model="modelSchedulerTask"
30
+ :target="selectedVirtualMachine"
31
+ />
32
+
33
+ <common-wizards-vm-migrate-select-type
34
+ v-if="selectedStep.id === dynamicSteps.selectMigrationType"
35
+ v-model="form.migrate_type"
36
+ :project="props.project"
37
+ />
38
+
39
+ <common-wizards-vm-migrate-select-target-server
40
+ v-if="selectedStep.id === dynamicSteps.selectTargetVCenterSer"
41
+ v-model="form.target_server"
42
+ v-model:connect-server="isConnectSourceServer"
43
+ :wizard="wizard"
44
+ />
45
+
46
+ <common-wizards-vm-migrate-select-compute-resource
47
+ v-if="isSphere"
48
+ v-show="selectedStep.id === dynamicSteps.selectComputeResource"
49
+ v-model="form"
50
+ :vm-state="props.vmState"
51
+ :alert-messages="alertMessages[3]"
52
+ :get-compute-resource-data="props.getComputeResourceData"
53
+ :compute-resource-data="props.computeResourceTableData"
54
+ :compute-resource-tree="props.computeResourceTree"
55
+ @hide-alert="onHideAlert"
56
+ />
57
+
58
+ <common-wizards-vm-migrate-select-storage
59
+ v-show="selectedStep.id === dynamicSteps.selectStorage"
60
+ v-model="form"
61
+ :alert-messages="alertMessages[4]"
62
+ :get-datastore-table-func="props.getDatastoreTableFunc"
63
+ :datastore="props.datastore"
64
+ :connected-storage-id-default="connectedStorageIdOnVm"
65
+ :configure-per-disks="props.configurePerDisks"
66
+ @hide-alert="onHideAlert"
67
+ />
68
+
69
+ <common-wizards-vm-migrate-select-network
70
+ v-if="isSphere"
71
+ v-show="selectedStep.id === dynamicSteps.selectNetworks"
72
+ v-model="form.network"
73
+ :vm-info="props.vmInfo"
74
+ :networks="props.networks"
75
+ />
76
+
77
+ <common-wizards-vm-migrate-select-priority
78
+ v-if="selectedStep.id === dynamicSteps.migrationStrategy"
79
+ v-model="form.vMotion_priority"
80
+ :vm-state="props.vmState"
81
+ />
82
+
83
+ <common-ready-to-complete
84
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
85
+ :data="dataReadyView"
86
+ />
87
+ </template>
88
+ </atoms-wizard>
89
+ </div>
90
+ </template>
91
+
92
+ <script setup lang="ts">
93
+ import type {
94
+ UI_I_WizardStep,
95
+ UI_I_ValidationReturn,
96
+ } from '~/components/atoms/wizard/lib/models/interfaces'
97
+ import Wizard from '~/components/atoms/wizard/lib/utils/utils'
98
+ import {
99
+ dynamicSteps,
100
+ stepsFunc,
101
+ stepsSchemeInitial,
102
+ } from '~/components/common/wizards/vm/migrate/lib/config/steps'
103
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
104
+ import type { UI_T_Project } from '~/lib/models/types'
105
+ import type {
106
+ UI_I_MigrateFormLocal,
107
+ UI_I_ChangeStepsSchemes,
108
+ } from '~/components/common/wizards/vm/migrate/lib/models/interfaces'
109
+ import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/select/type/lib/models/types'
110
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
111
+ import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
112
+ import type { UI_I_VmSettings } from '~/lib/models/store/vm/interfaces'
113
+ import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
114
+ import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/configure/disk/table/lib/models/interfaces'
115
+ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
116
+ import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
117
+ import type { UI_I_VmOrigin } from '~/components/common/wizards/vm/migrate/vmOrigin/lib/models/interfaces'
118
+ import { constructDataReadyViewFunc } from '~/components/common/wizards/vm/migrate/lib/config/constructDataReady'
119
+ import * as validation from '~/components/common/wizards/vm/migrate/lib/validations'
120
+
121
+ const props = withDefaults(
122
+ defineProps<{
123
+ project: UI_T_Project
124
+ isScheduledTasks: boolean
125
+ isEditScheduledTasks: boolean
126
+ vmSettings: UI_I_VmSettings | null
127
+ vmName: string
128
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
129
+ getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
130
+ datastore: UI_I_DatastoreTableItem[]
131
+ configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
132
+ computeResourceTableData?: any
133
+ computeResourceTree?: UI_I_TreeNode | null
134
+ selectedVirtualMachine?: string
135
+ vmState?: number
136
+ vmInfo?: any | null
137
+ networks?: any
138
+ vmOrigin?: UI_I_VmOrigin | null
139
+ }>(),
140
+ {
141
+ computeResourceTree: null,
142
+ vmOrigin: null,
143
+ }
144
+ )
145
+ const emits = defineEmits<{
146
+ (event: 'finish', value: UI_I_MigrateFormLocal): void
147
+ (event: 'get-networks', value: string): void
148
+ (event: 'hide'): void
149
+ }>()
150
+ const modelSchedulerTask = defineModel<UI_I_ScheduleNewTasksForm>(
151
+ 'schedulerForm',
152
+ { required: true }
153
+ )
154
+
155
+ const localization = computed<UI_I_Localization>(() => useLocal())
156
+
157
+ const isSphere = ref<boolean>(props.project === 'sphere')
158
+
159
+ const wizard: Wizard = new Wizard(
160
+ stepsFunc(localization.value, props.isScheduledTasks),
161
+ stepsSchemeInitial
162
+ )
163
+
164
+ const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
165
+ const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
166
+
167
+ const title = computed<string>(() => {
168
+ const { scheduleNewTasks, scheduleTaskEdit, migrate } =
169
+ localization.value.common
170
+ let result = migrate
171
+ if (props.isScheduledTasks) {
172
+ const schedulerMode = props.isEditScheduledTasks
173
+ ? scheduleTaskEdit
174
+ : scheduleNewTasks
175
+
176
+ result = `${schedulerMode} (${migrate})`
177
+ }
178
+
179
+ return result
180
+ })
181
+
182
+ const isConnectSourceServer = ref<boolean>(false)
183
+ const form = ref<UI_I_MigrateFormLocal>({
184
+ migrate_type: props.project === 'procurator' ? 'storage' : 'resource',
185
+ disk_format: 0,
186
+ storage: null,
187
+ configure: {
188
+ type: 'batch-configure',
189
+ disks: [],
190
+ },
191
+ target_server: {
192
+ fqdn: '',
193
+ user: '',
194
+ password: '',
195
+ },
196
+ network: {},
197
+ resource: {
198
+ selectedNode: null,
199
+ host: null,
200
+ cluster: null,
201
+ resourcePool: null,
202
+ vApps: null,
203
+ },
204
+ vMotion_priority:
205
+ props.vmState === 2 ? 'live' : props.vmState === 1 ? 'offline' : '',
206
+ })
207
+
208
+ const validationFunc = async (
209
+ value: UI_I_WizardStep[],
210
+ currentStep: UI_I_WizardStep,
211
+ nextStep: UI_I_WizardStep
212
+ ): Promise<UI_I_ValidationReturn> => {
213
+ let stepHasError = false
214
+
215
+ if (
216
+ wizard.isValidateForStep(
217
+ dynamicSteps.selectComputeResource,
218
+ currentStep.id,
219
+ nextStep.id
220
+ )
221
+ ) {
222
+ const nameValidation = await validation.checkSelectedResourceSync(
223
+ localization.value,
224
+ form.value.resource,
225
+ wizard,
226
+ value
227
+ )
228
+
229
+ value = nameValidation.newValue
230
+
231
+ stepHasError = nameValidation.stepHasError
232
+ }
233
+
234
+ if (
235
+ wizard.isValidateForStep(
236
+ dynamicSteps.selectStorage,
237
+ currentStep.id,
238
+ nextStep.id
239
+ )
240
+ ) {
241
+ const nameValidation = await validation.checkSelectedDatastoreSync(
242
+ localization.value,
243
+ form.value.storage,
244
+ wizard,
245
+ value
246
+ )
247
+
248
+ value = nameValidation.newValue
249
+
250
+ stepHasError = nameValidation.stepHasError
251
+ }
252
+
253
+ return {
254
+ newValue: value,
255
+ stepHasError,
256
+ }
257
+ }
258
+ const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> =>
259
+ wizard.changeSteps(value, validationFunc)
260
+
261
+ // Choosing Scheme
262
+ watch(
263
+ () => form.value.migrate_type,
264
+ (newValue: UI_T_VmMigrateType) => {
265
+ const schemes: UI_I_ChangeStepsSchemes = {
266
+ procurator: {
267
+ storage: props.isScheduledTasks ? 1 : 0,
268
+ },
269
+ sphere: {
270
+ storage: props.isScheduledTasks ? 1 : 0,
271
+ resource: props.isScheduledTasks ? 3 : 2,
272
+ 'resource-storage': 4,
273
+ server: 5,
274
+ },
275
+ }
276
+
277
+ const projectSchemes = schemes[props.project]
278
+
279
+ if (projectSchemes && projectSchemes[newValue] !== undefined) {
280
+ wizard.changeScheme(projectSchemes[newValue] as number)
281
+ }
282
+ },
283
+ { deep: true, immediate: true }
284
+ )
285
+ // Get networks
286
+ watch(
287
+ () => form.value.resource.host,
288
+ (newValue) => {
289
+ emits('get-networks', newValue.id)
290
+ }
291
+ )
292
+
293
+ watch(
294
+ modelSchedulerTask,
295
+ (newValue: UI_I_ScheduleNewTasksForm) => {
296
+ if (props.isScheduledTasks) wizard.setDisabledNextButton(newValue.isValid)
297
+ },
298
+ { immediate: true, deep: true }
299
+ )
300
+
301
+ const loading = ref<boolean>(false)
302
+
303
+ const connectedStorageIdOnVm = computed<string>(
304
+ () => props.vmSettings?.storage.id || ''
305
+ )
306
+
307
+ const dataReadyView = computed<UI_I_TableInfoItem>(() =>
308
+ constructDataReadyViewFunc(props.vmName, form.value)
309
+ )
310
+ const onFinish = (): void => {
311
+ loading.value = true
312
+ emits('finish', form.value)
313
+ loading.value = false
314
+ }
315
+
316
+ const onHideModal = (): void => {
317
+ emits('hide')
318
+ }
319
+
320
+ const onHideAlert = (stepId: number): void => {
321
+ wizard.hideAlertMessagesByStepId(stepId)
322
+ }
323
+ </script>
324
+
325
+ <style scoped lang="scss">
326
+ @import 'assets/scss/common/mixins.scss';
327
+ .migrate-vm {
328
+ .custom-sub-title {
329
+ font-weight: 400;
330
+ font-size: 13px;
331
+ line-height: inherit;
332
+ color: var(--add-vm-context-sub-title);
333
+ }
334
+
335
+ :deep(.modal-body) {
336
+ height: inherit;
337
+ @include flex($dir: column);
338
+
339
+ .content-heading > div {
340
+ width: 100%;
341
+ }
342
+ }
343
+ }
344
+ </style>