bfg-common 1.4.131 → 1.4.132
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/wizards/vmNew/migrate/Migrate.vue +6 -8
- package/components/common/wizards/vmNew/migrate/lib/config/constructDataReady.ts +41 -22
- package/components/common/wizards/vmNew/migrate/lib/models/interfaces.ts +3 -2
- package/components/common/wizards/vmNew/migrate/select/priority/Priority.vue +3 -17
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
show
|
|
5
5
|
:wizard="wizard"
|
|
6
6
|
:selected-scheme="selectedScheme"
|
|
7
|
-
:title="localization.migrate"
|
|
7
|
+
:title="localization.common.migrate"
|
|
8
8
|
:localization="localization"
|
|
9
9
|
class="migrate-vm-wizard"
|
|
10
10
|
test-id="migrate-vm-wizard"
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
v-model:network-data="dataFormLocal.selectNetwork.data"
|
|
52
52
|
/>
|
|
53
53
|
|
|
54
|
-
<common-wizards-vm-migrate-select-priority
|
|
55
|
-
v-if="
|
|
56
|
-
v-model="
|
|
54
|
+
<common-wizards-vm-new-migrate-select-priority
|
|
55
|
+
v-if="selectedStep.id === 5"
|
|
56
|
+
v-model="form.vMotion_priority"
|
|
57
57
|
/>
|
|
58
58
|
|
|
59
59
|
<common-ready-to-complete
|
|
@@ -88,7 +88,6 @@ import type { UI_I_VmSettings } from '~/lib/models/store/vm/interfaces'
|
|
|
88
88
|
import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
|
|
89
89
|
import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vmNew/migrate/select/storage/configure/disk/table/lib/models/interfaces'
|
|
90
90
|
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
|
|
91
|
-
import type { UI_T_SelectVMotionPriority } from '~/components/common/wizards/vm/migrate/select/priority/lib/models/types'
|
|
92
91
|
import type { UI_I_CollectedDataFormLocal } from '~/components/common/wizards/vm/migrate/lib/models/interfaces'
|
|
93
92
|
import { constructDataReadyViewFunc } from '~/components/common/wizards/vmNew/migrate/lib/config/constructDataReady'
|
|
94
93
|
import * as validation from '~/components/common/wizards/vmNew/migrate/lib/validations'
|
|
@@ -119,7 +118,6 @@ const wizard: Wizard = new Wizard(
|
|
|
119
118
|
const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
|
|
120
119
|
const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
|
|
121
120
|
|
|
122
|
-
const selectedVMotionPriority = ref<UI_T_SelectVMotionPriority>('high')
|
|
123
121
|
const form = ref<UI_I_MigrateFormLocal>({
|
|
124
122
|
migrate_type: props.project === 'procurator' ? 'storage' : 'resource',
|
|
125
123
|
disk_format: 0,
|
|
@@ -128,6 +126,7 @@ const form = ref<UI_I_MigrateFormLocal>({
|
|
|
128
126
|
type: 'batch-configure',
|
|
129
127
|
disks: [],
|
|
130
128
|
},
|
|
129
|
+
vMotion_priority: 'high',
|
|
131
130
|
})
|
|
132
131
|
|
|
133
132
|
const validationFunc = async (
|
|
@@ -202,8 +201,7 @@ const dataFormLocal = ref<UI_I_CollectedDataFormLocal>({
|
|
|
202
201
|
selectNetwork: {
|
|
203
202
|
isShowNetworkBasic: true,
|
|
204
203
|
data: null,
|
|
205
|
-
}
|
|
206
|
-
selectedVMotionPriority: 'high',
|
|
204
|
+
}
|
|
207
205
|
})
|
|
208
206
|
const onFinish = (): void => {
|
|
209
207
|
loading.value = true
|
|
@@ -5,11 +5,10 @@ import { UI_E_VmMigrationType } from '~/components/common/wizards/vm/migrate/lib
|
|
|
5
5
|
import { UI_E_SelectStorageDiskFormat } from '~/components/common/wizards/vm/migrate/select/storage/lib/models/enums'
|
|
6
6
|
import { vmDiskFormatOptions } from '~/components/common/wizards/vm/migrate/select/storage/diskFormat/lib/config/formatOptions'
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const migrateOnlyStorageDataView = (
|
|
9
9
|
localization: UI_I_Localization,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
form: UI_I_MigrateFormLocal
|
|
10
|
+
form: UI_I_MigrateFormLocal,
|
|
11
|
+
vmName: string
|
|
13
12
|
): UI_I_MigrateReadyBlockData[] => {
|
|
14
13
|
const { disk_format, configure, storage } = form
|
|
15
14
|
|
|
@@ -19,17 +18,7 @@ const storageDetailsFunc = (
|
|
|
19
18
|
(file) => file.value === disk_format
|
|
20
19
|
)!
|
|
21
20
|
|
|
22
|
-
let
|
|
23
|
-
{
|
|
24
|
-
label: localization.common.migrationType,
|
|
25
|
-
value: migrationType,
|
|
26
|
-
permissions: ['batch-configure', 'configure-disk'],
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: localization.common.virtualMachine,
|
|
30
|
-
value: name,
|
|
31
|
-
permissions: ['batch-configure', 'configure-disk'],
|
|
32
|
-
},
|
|
21
|
+
let storageResult: UI_I_MigrateReadyBlockData[] = [
|
|
33
22
|
{
|
|
34
23
|
label: localization.common.storage,
|
|
35
24
|
value: storage?.name,
|
|
@@ -41,7 +30,7 @@ const storageDetailsFunc = (
|
|
|
41
30
|
permissions: ['batch-configure'],
|
|
42
31
|
},
|
|
43
32
|
{
|
|
44
|
-
label:
|
|
33
|
+
label: vmName,
|
|
45
34
|
value: '',
|
|
46
35
|
permissions: ['configure-disk'],
|
|
47
36
|
},
|
|
@@ -65,10 +54,43 @@ const storageDetailsFunc = (
|
|
|
65
54
|
}
|
|
66
55
|
}
|
|
67
56
|
)
|
|
68
|
-
|
|
57
|
+
storageResult = [...storageResult, ...perDiskItems]
|
|
69
58
|
}
|
|
70
59
|
|
|
71
|
-
return
|
|
60
|
+
return storageResult.filter(
|
|
61
|
+
(option) =>
|
|
62
|
+
!option.permissions.length || option.permissions.includes(configure.type)
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const storageDetailsFunc = (
|
|
67
|
+
localization: UI_I_Localization,
|
|
68
|
+
name: string,
|
|
69
|
+
form: UI_I_MigrateFormLocal
|
|
70
|
+
): UI_I_MigrateReadyBlockData[] => {
|
|
71
|
+
const { migrate_type } = form
|
|
72
|
+
|
|
73
|
+
const migrationType = localization.common[UI_E_VmMigrationType[migrate_type]]
|
|
74
|
+
|
|
75
|
+
let result: UI_I_MigrateReadyBlockData[] = [
|
|
76
|
+
{
|
|
77
|
+
label: localization.common.migrationType,
|
|
78
|
+
value: migrationType,
|
|
79
|
+
permissions: ['batch-configure', 'configure-disk'],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: localization.common.virtualMachine,
|
|
83
|
+
value: name,
|
|
84
|
+
permissions: ['batch-configure', 'configure-disk'],
|
|
85
|
+
},
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
if (migrate_type === 'storage') {
|
|
89
|
+
const storageData = migrateOnlyStorageDataView(localization, form, name)
|
|
90
|
+
result = [...result, ...storageData]
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return result
|
|
72
94
|
}
|
|
73
95
|
export const constructDataReadyViewFunc = (
|
|
74
96
|
name: string,
|
|
@@ -76,8 +98,5 @@ export const constructDataReadyViewFunc = (
|
|
|
76
98
|
): UI_I_MigrateReadyBlockData[] => {
|
|
77
99
|
const localization: UI_I_Localization = useLocal()
|
|
78
100
|
|
|
79
|
-
|
|
80
|
-
localization.common[UI_E_VmMigrationType[data.migrate_type]]
|
|
81
|
-
|
|
82
|
-
return storageDetailsFunc(localization, migrationType, name, data)
|
|
101
|
+
return storageDetailsFunc(localization, name, data)
|
|
83
102
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
|
|
2
2
|
import type { UI_T_VmMigrateSelectStorageTab } from '~/components/common/wizards/vm/migrate/select/storage/lib/models/types'
|
|
3
3
|
import type { UI_I_SelectStorageReadyData } from '~/components/common/wizards/vm/migrate/select/storage/lib/models/interfaces'
|
|
4
|
-
import type { UI_T_SelectVMotionPriority } from '~/components/common/wizards/vm/migrate/select/priority/lib/models/types'
|
|
5
4
|
import type { UI_I_ComputeResourceDataLocal } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/interfaces'
|
|
6
5
|
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vmNew/migrate/select/type/lib/models/types'
|
|
7
6
|
import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/lib/models/interfaces'
|
|
7
|
+
import type { UI_T_SelectVMotionPriority } from '~/components/common/wizards/vmNew/migrate/select/priority/lib/models/types'
|
|
8
8
|
|
|
9
9
|
export interface UI_I_MigrateFormLocal {
|
|
10
10
|
migrate_type: UI_T_VmMigrateType
|
|
@@ -15,6 +15,8 @@ export interface UI_I_MigrateFormLocal {
|
|
|
15
15
|
type: UI_T_VmMigrateSelectStorageTab
|
|
16
16
|
disks: UI_I_StorageConfigurePerDiskItem[]
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
vMotion_priority: UI_T_SelectVMotionPriority
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
export interface UI_I_ChangeStepsSchemes {
|
|
@@ -34,5 +36,4 @@ export interface UI_I_CollectedDataFormLocal {
|
|
|
34
36
|
isShowNetworkBasic: boolean
|
|
35
37
|
data: any // добавить интерфае потом
|
|
36
38
|
}
|
|
37
|
-
selectedVMotionPriority: UI_T_SelectVMotionPriority
|
|
38
39
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="select-priority">
|
|
3
3
|
<common-select-radio-group
|
|
4
|
-
v-model="
|
|
4
|
+
v-model="selectedPriorityTypeLocal"
|
|
5
5
|
:options="vmMigrationPriorityTypes"
|
|
6
6
|
/>
|
|
7
7
|
</div>
|
|
@@ -11,29 +11,15 @@
|
|
|
11
11
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
12
12
|
import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
|
|
13
13
|
import type { UI_T_SelectVMotionPriority } from '~/components/common/wizards/vm/migrate/select/priority/lib/models/types'
|
|
14
|
-
import { vmMigrateSelectPriorityTypesFunc } from '~/components/common/wizards/
|
|
14
|
+
import { vmMigrateSelectPriorityTypesFunc } from '~/components/common/wizards/vmNew/migrate/select/priority/lib/config/typeOptions'
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
modelValue: UI_T_SelectVMotionPriority
|
|
18
|
-
}>()
|
|
19
|
-
const emits = defineEmits<{
|
|
20
|
-
(event: 'update:model-value', value: UI_T_SelectVMotionPriority): void
|
|
21
|
-
}>()
|
|
16
|
+
const selectedPriorityTypeLocal = defineModel<UI_T_SelectVMotionPriority>()
|
|
22
17
|
|
|
23
18
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
24
19
|
|
|
25
20
|
const vmMigrationPriorityTypes = computed<UI_I_RadioOption[]>(() =>
|
|
26
21
|
vmMigrateSelectPriorityTypesFunc(localization.value)
|
|
27
22
|
)
|
|
28
|
-
|
|
29
|
-
const selectedPriorityType = computed<UI_T_SelectVMotionPriority>({
|
|
30
|
-
get() {
|
|
31
|
-
return props.modelValue
|
|
32
|
-
},
|
|
33
|
-
set(newValue: UI_T_SelectVMotionPriority) {
|
|
34
|
-
emits('update:model-value', newValue)
|
|
35
|
-
},
|
|
36
|
-
})
|
|
37
23
|
</script>
|
|
38
24
|
|
|
39
25
|
<style lang="scss" scoped></style>
|