bfg-common 1.2.147 → 1.2.149
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/assets/localization/local_be.json +8 -1
- package/assets/localization/local_en.json +8 -1
- package/assets/localization/local_hy.json +8 -1
- package/assets/localization/local_kk.json +8 -1
- package/assets/localization/local_ru.json +8 -1
- package/assets/localization/local_zh.json +8 -1
- package/components/common/wizards/datastore/add/utils.ts +2 -4
- package/components/common/wizards/vm/common/computeResource/TreeView.vue +61 -0
- package/components/common/wizards/vm/common/validation/compatibility/Compatibility.vue +11 -2
- package/components/common/wizards/vm/common/validation/models/enums.ts +5 -0
- package/components/common/wizards/vm/migrate/Migrate.vue +39 -7
- package/components/common/wizards/vm/migrate/config/constructDataReady.ts +47 -28
- package/components/common/wizards/vm/migrate/models/interfaces.ts +5 -1
- package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +116 -8
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/TableView.vue +90 -0
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/clusterTable.ts +114 -0
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/hostTable.ts +141 -0
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/resourcePoolTable.ts +115 -0
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/tableKeys.ts +65 -0
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/vappsTable.ts +66 -0
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/models/types.ts +60 -0
- package/components/common/wizards/vm/migrate/select/network/Network.vue +45 -3
- package/components/common/wizards/vm/migrate/select/network/table/disk/Disk.vue +84 -0
- package/components/common/wizards/vm/migrate/select/network/table/disk/config/advancedTable.ts +77 -0
- package/components/common/wizards/vm/migrate/select/network/table/disk/config/basicTable.ts +71 -0
- package/components/common/wizards/vm/migrate/select/network/table/disk/config/tableKeys.ts +10 -0
- package/components/common/wizards/vm/migrate/select/network/table/disk/models/interfaces.ts +1 -0
- package/components/common/wizards/vm/migrate/select/network/table/disk/models/types.ts +12 -0
- package/components/common/wizards/vm/migrate/select/priority/Priority.vue +5 -4
- package/components/common/wizards/vm/migrate/select/priority/models/types.ts +1 -0
- package/components/common/wizards/vm/migrate/select/storage/Storage.vue +62 -5
- package/components/common/wizards/vm/migrate/select/storage/configure/batch/Batch.vue +29 -16
- package/components/common/wizards/vm/migrate/select/storage/configure/disk/Disk.vue +13 -3
- package/components/common/wizards/vm/migrate/select/storage/models/enums.ts +6 -0
- package/components/common/wizards/vm/migrate/select/storage/selectedPerDisk/SelectedPerDisk.vue +5 -2
- package/components/common/wizards/vm/migrate/select/storage/table/datastore/Datastore.vue +10 -2
- package/components/common/wizards/vm/migrate/select/storage/table/disk/config/config.ts +46 -25
- package/components/common/wizards/vm/migrate/select/storage/table/disk/config/tableKeys.ts +15 -0
- package/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces.ts +20 -5
- package/components/common/wizards/vm/migrate/select/storage/table/disk/models/types.ts +8 -4
- package/components/common/wizards/vm/migrate/select/targetServer/config/tabsPannel.ts +18 -0
- package/components/common/wizards/vm/migrate/select/targetServer/models/types.ts +1 -0
- package/components/common/wizards/vm/migrate/select/targetServer/new/New.vue +287 -0
- package/components/common/wizards/vm/migrate/select/targetServer/new/config/defaultForm.ts +33 -0
- package/components/common/wizards/vm/migrate/select/targetServer/saved/Saved.vue +27 -0
- package/components/common/wizards/vm/migrate/select/targetServer/targetServer.vue +41 -0
- package/package.json +1 -1
|
@@ -2114,5 +2114,12 @@
|
|
|
2114
2114
|
"sourceNetwork": "Крынічная сетка",
|
|
2115
2115
|
"usedBy": "Выкарыстоўваецца",
|
|
2116
2116
|
"destinationNetwork": "Сетка прызначэння",
|
|
2117
|
-
"vm": "ВМ"
|
|
2117
|
+
"vm": "ВМ",
|
|
2118
|
+
"savedVCenterServers": "Захаваныя серверы vCenter",
|
|
2119
|
+
"newVCenterServer": "Новы сервер vCenter",
|
|
2120
|
+
"noSavedVCenterServerAddressesFound": "Захаваных адрасоў сервера vCenter не знойдзена.",
|
|
2121
|
+
"vCenterServerAddress": "Адрас сервера vCenter",
|
|
2122
|
+
"saveVCenterServerAddress": "Захаваць адрас сервера vCenter",
|
|
2123
|
+
"discard": "Адкідаць",
|
|
2124
|
+
"ioControl": "Io Control"
|
|
2118
2125
|
}
|
|
@@ -2117,5 +2117,12 @@
|
|
|
2117
2117
|
"sourceNetwork": "Source Network",
|
|
2118
2118
|
"usedBy": "Used By",
|
|
2119
2119
|
"destinationNetwork": "Destination Network",
|
|
2120
|
-
"vm": "VM"
|
|
2120
|
+
"vm": "VM",
|
|
2121
|
+
"savedVCenterServers": "Saved vCenter servers",
|
|
2122
|
+
"newVCenterServer": "New vCenter server",
|
|
2123
|
+
"noSavedVCenterServerAddressesFound": "No saved vCenter Server addresses found.",
|
|
2124
|
+
"vCenterServerAddress": "vCenter Server address",
|
|
2125
|
+
"saveVCenterServerAddress": "Save vCenter Server address",
|
|
2126
|
+
"discard": "Discard",
|
|
2127
|
+
"ioControl": "Io Control"
|
|
2121
2128
|
}
|
|
@@ -2117,5 +2117,12 @@
|
|
|
2117
2117
|
"sourceNetwork": "Աղբյուր ցանց",
|
|
2118
2118
|
"usedBy": "Օգտագործված է",
|
|
2119
2119
|
"destinationNetwork": "Նպատակային ցանց",
|
|
2120
|
-
"vm": "VM"
|
|
2120
|
+
"vm": "VM",
|
|
2121
|
+
"savedVCenterServers": "Պահված vCenter սերվերներ",
|
|
2122
|
+
"newVCenterServer": "Նոր vCenter սերվեր",
|
|
2123
|
+
"noSavedVCenterServerAddressesFound": "Պահված vCenter Server հասցեներ չեն գտնվել:",
|
|
2124
|
+
"vCenterServerAddress": "vCenter սերվերի հասցեն",
|
|
2125
|
+
"saveVCenterServerAddress": "Պահպանեք vCenter սերվերի հասցեն",
|
|
2126
|
+
"discard": "Հրաժարվել",
|
|
2127
|
+
"ioControl": "Io Control"
|
|
2121
2128
|
}
|
|
@@ -2117,5 +2117,12 @@
|
|
|
2117
2117
|
"sourceNetwork": "Бастапқы желі",
|
|
2118
2118
|
"usedBy": "Қолданған",
|
|
2119
2119
|
"destinationNetwork": "Мақсатты желі",
|
|
2120
|
-
"vm": "ВМ"
|
|
2120
|
+
"vm": "ВМ",
|
|
2121
|
+
"savedVCenterServers": "Сақталған vCenter серверлері",
|
|
2122
|
+
"newVCenterServer": "Жаңа vCenter сервері",
|
|
2123
|
+
"noSavedVCenterServerAddressesFound": "Сақталған vCenter сервер мекенжайлары табылмады.",
|
|
2124
|
+
"vCenterServerAddress": "vCenter серверінің мекенжайы",
|
|
2125
|
+
"saveVCenterServerAddress": "vCenter серверінің мекенжайын сақтаңыз",
|
|
2126
|
+
"discard": "Жою",
|
|
2127
|
+
"ioControl": "Io басқару"
|
|
2121
2128
|
}
|
|
@@ -2117,5 +2117,12 @@
|
|
|
2117
2117
|
"sourceNetwork": "Исходная сеть",
|
|
2118
2118
|
"usedBy": "Использован",
|
|
2119
2119
|
"destinationNetwork": "Сеть назначения",
|
|
2120
|
-
"vm": "ВМ"
|
|
2120
|
+
"vm": "ВМ",
|
|
2121
|
+
"savedVCenterServers": "Сохраненные серверы vCenter",
|
|
2122
|
+
"newVCenterServer": "Новый сервер vCenter",
|
|
2123
|
+
"noSavedVCenterServerAddressesFound": "Сохраненных адресов серверов vCenter не найдено.",
|
|
2124
|
+
"vCenterServerAddress": "Адрес сервера vCenter",
|
|
2125
|
+
"saveVCenterServerAddress": "Сохранить адрес сервера vCenter",
|
|
2126
|
+
"discard": "Отказаться",
|
|
2127
|
+
"ioControl": "Ио-контроль"
|
|
2121
2128
|
}
|
|
@@ -2117,5 +2117,12 @@
|
|
|
2117
2117
|
"sourceNetwork": "来源网络",
|
|
2118
2118
|
"usedBy": "使用者",
|
|
2119
2119
|
"destinationNetwork": "目的地网络",
|
|
2120
|
-
"vm": "虚拟机"
|
|
2120
|
+
"vm": "虚拟机",
|
|
2121
|
+
"savedVCenterServers": "已保存的 vCenter 服务器",
|
|
2122
|
+
"newVCenterServer": "新的 vCenter 服务器",
|
|
2123
|
+
"noSavedVCenterServerAddressesFound": "找不到已保存的 vCenter Server 地址。",
|
|
2124
|
+
"vCenterServerAddress": "vCenter 服务器地址",
|
|
2125
|
+
"saveVCenterServerAddress": "保存 vCenter Server 地址",
|
|
2126
|
+
"discard": "丢弃",
|
|
2127
|
+
"ioControl": "IO控制"
|
|
2121
2128
|
}
|
|
@@ -19,14 +19,12 @@ import {
|
|
|
19
19
|
|
|
20
20
|
export const checkValidityName = async (
|
|
21
21
|
name: string,
|
|
22
|
-
|
|
22
|
+
_mode: UI_T_WizardDatastoreMode = 'procurator'
|
|
23
23
|
): Promise<UI_I_DatastoreValidityName> => {
|
|
24
|
-
let api = '/api/v1'
|
|
25
|
-
mode === 'procurator' && (api = '/ui')
|
|
26
24
|
|
|
27
25
|
// @ts-ignore
|
|
28
26
|
const { error } = await useMyFetch<null, API_UI_I_Error>(
|
|
29
|
-
|
|
27
|
+
`/ui/ds/validate?name=${name}`,
|
|
30
28
|
{
|
|
31
29
|
method: 'GET',
|
|
32
30
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tree-view">
|
|
3
|
+
<atoms-loader-pre-loader
|
|
4
|
+
v-show="loading"
|
|
5
|
+
id="loader"
|
|
6
|
+
class="absolute-center tree-view__loading"
|
|
7
|
+
:show="true"
|
|
8
|
+
/>
|
|
9
|
+
<common-recursion-tree
|
|
10
|
+
:nodes="props.computeResourceTree"
|
|
11
|
+
class="recursion-tree"
|
|
12
|
+
@get-nodes="onShowNodes"
|
|
13
|
+
@select-node="onSelectNode"
|
|
14
|
+
@contextmenu.prevent
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import type { UI_I_TreeNode } from '~/node_modules/bfg-common/components/common/recursionTree/models/interfaces'
|
|
21
|
+
|
|
22
|
+
const props = defineProps<{
|
|
23
|
+
modelValue: UI_I_TreeNode | null
|
|
24
|
+
computeResourceTree: UI_I_TreeNode[]
|
|
25
|
+
}>()
|
|
26
|
+
|
|
27
|
+
const emits = defineEmits<{
|
|
28
|
+
(event: 'update:modelValue', value: UI_I_TreeNode): void
|
|
29
|
+
(
|
|
30
|
+
event: 'get-compute-resource-tree',
|
|
31
|
+
value: { id: string | number; cb: () => void }
|
|
32
|
+
): void
|
|
33
|
+
(event: 'show-compute-resource-tree', value: UI_I_TreeNode): void
|
|
34
|
+
(event: 'select-compute-resource-tree', value: UI_I_TreeNode): void
|
|
35
|
+
(event: 'clear-compute-resource-tree'): void
|
|
36
|
+
}>()
|
|
37
|
+
|
|
38
|
+
const loading = ref<boolean>(false)
|
|
39
|
+
const onShowNodes = (event: any): void => {
|
|
40
|
+
emits('show-compute-resource-tree', event)
|
|
41
|
+
}
|
|
42
|
+
const onSelectNode = (node: UI_I_TreeNode): void => {
|
|
43
|
+
emits('select-compute-resource-tree', node)
|
|
44
|
+
|
|
45
|
+
emits('update:modelValue', node)
|
|
46
|
+
}
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style scoped lang="scss">
|
|
50
|
+
.tree-view {
|
|
51
|
+
&__loading {
|
|
52
|
+
:deep(.spinner.spinner-inverse) {
|
|
53
|
+
position: static;
|
|
54
|
+
width: 45px;
|
|
55
|
+
height: 45px;
|
|
56
|
+
min-width: 45px;
|
|
57
|
+
min-height: 45px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<div class="flex-align-center compatibility__content">
|
|
5
5
|
<template v-if="!props.loading">
|
|
6
6
|
<div class="compatibility__message">
|
|
7
|
-
<div class="icon
|
|
8
|
-
<span>{{
|
|
7
|
+
<div :class="['icon', iconStatus]" />
|
|
8
|
+
<span>{{ validationText }}</span>
|
|
9
9
|
</div>
|
|
10
10
|
</template>
|
|
11
11
|
</div>
|
|
@@ -14,10 +14,13 @@
|
|
|
14
14
|
|
|
15
15
|
<script lang="ts" setup>
|
|
16
16
|
import type { UI_I_Localization } from '~/models/interfaces'
|
|
17
|
+
import { UI_E_ValidationCompatibilityStatusIcon } from '~/components/common/wizards/vm/common/validation/models/enums'
|
|
17
18
|
|
|
18
19
|
const props = withDefaults(
|
|
19
20
|
defineProps<{
|
|
20
21
|
loading?: boolean
|
|
22
|
+
text: string
|
|
23
|
+
status: 'Error' | 'Success' | 'Warning'
|
|
21
24
|
}>(),
|
|
22
25
|
{
|
|
23
26
|
loading: true,
|
|
@@ -25,6 +28,12 @@ const props = withDefaults(
|
|
|
25
28
|
)
|
|
26
29
|
|
|
27
30
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
31
|
+
|
|
32
|
+
const iconStatus = computed<string>(
|
|
33
|
+
() => UI_E_ValidationCompatibilityStatusIcon[props.status]
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
const validationText = computed<string>(() => localization.value[props.text])
|
|
28
37
|
</script>
|
|
29
38
|
|
|
30
39
|
<style lang="scss" scoped>
|
|
@@ -28,8 +28,14 @@
|
|
|
28
28
|
:project="props.project"
|
|
29
29
|
/>
|
|
30
30
|
|
|
31
|
+
<common-wizards-vm-migrate-select-target-server
|
|
32
|
+
v-show="currentBlockId === 'select-target-center'"
|
|
33
|
+
/>
|
|
34
|
+
|
|
31
35
|
<common-wizards-vm-migrate-select-compute-resource
|
|
32
36
|
v-show="currentBlockId === 'select-compute-resource'"
|
|
37
|
+
:migrate-type="vmMigrateType"
|
|
38
|
+
:compute-resource-tree="props.computeResourceTree"
|
|
33
39
|
/>
|
|
34
40
|
|
|
35
41
|
<common-wizards-vm-migrate-select-storage
|
|
@@ -37,7 +43,7 @@
|
|
|
37
43
|
:submit="selectStorageSubmit"
|
|
38
44
|
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
39
45
|
:datastore="props.datastore"
|
|
40
|
-
:connected-storage-id="connectedStorageIdOnVm"
|
|
46
|
+
:connected-storage-id-default="connectedStorageIdOnVm"
|
|
41
47
|
:configure-per-disks="props.configurePerDisks"
|
|
42
48
|
@next-step="onSelectStorageAndNext"
|
|
43
49
|
/>
|
|
@@ -48,6 +54,7 @@
|
|
|
48
54
|
|
|
49
55
|
<common-wizards-vm-migrate-select-priority
|
|
50
56
|
v-show="currentBlockId === 'select-motion-priority'"
|
|
57
|
+
v-model="selectedVMotionPriority"
|
|
51
58
|
/>
|
|
52
59
|
</div>
|
|
53
60
|
|
|
@@ -66,10 +73,13 @@ import type { UI_I_TablePayload } from '~/models/store/interfaces'
|
|
|
66
73
|
import type { UI_I_DatastoreTableItem } from '~/models/store/storage/interfaces'
|
|
67
74
|
import type { UI_I_VmSettings } from '~/models/store/vm/interfaces'
|
|
68
75
|
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
76
|
+
import type { UI_I_TreeNode } from '~/components/common/recursionTree/models/interfaces'
|
|
69
77
|
import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces'
|
|
70
78
|
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
|
|
71
79
|
import type { UI_I_SelectStorageReadyData } from '~/components/common/wizards/vm/migrate/select/storage/models/interfaces'
|
|
72
|
-
import { UI_I_MigrateVerticalStepItem } from '~/components/common/wizards/vm/migrate/models/interfaces'
|
|
80
|
+
import type { UI_I_MigrateVerticalStepItem } from '~/components/common/wizards/vm/migrate/models/interfaces'
|
|
81
|
+
import type { UI_T_SelectVMotionPriority } from '~/components/common/wizards/vm/migrate/select/priority/models/types'
|
|
82
|
+
import type { UI_I_CollectedDataFormLocal } from '~/components/common/wizards/vm/migrate/models/interfaces'
|
|
73
83
|
import { stepItemsFunc } from '~/components/common/wizards/vm/migrate/utils'
|
|
74
84
|
import { constructDataReadyViewFunc } from '~/components/common/wizards/vm/migrate/config/constructDataReady'
|
|
75
85
|
|
|
@@ -80,6 +90,7 @@ const props = defineProps<{
|
|
|
80
90
|
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
81
91
|
datastore: UI_I_DatastoreTableItem[]
|
|
82
92
|
configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
|
|
93
|
+
computeResourceTree?: UI_I_TreeNode
|
|
83
94
|
readyCompleteTableInfo?: any // пока так потом если будет нужен изменит или удалить
|
|
84
95
|
finishFunc: any
|
|
85
96
|
}>()
|
|
@@ -95,6 +106,8 @@ const loading = ref<boolean>(false)
|
|
|
95
106
|
|
|
96
107
|
const selectStorageSubmit = ref<number>(0)
|
|
97
108
|
|
|
109
|
+
const selectedVMotionPriority = ref<UI_T_SelectVMotionPriority>('high-priority')
|
|
110
|
+
|
|
98
111
|
const vmMigrateType = ref<UI_T_VmMigrateType>(
|
|
99
112
|
props.project === 'procurator' ? 'storage' : 'resource'
|
|
100
113
|
)
|
|
@@ -111,15 +124,34 @@ const connectedStorageIdOnVm = computed<string>(
|
|
|
111
124
|
() => props.vmSettings?.storage.id || ''
|
|
112
125
|
)
|
|
113
126
|
|
|
127
|
+
const dataFormLocal = ref<UI_I_CollectedDataFormLocal>({
|
|
128
|
+
selectStorage: null,
|
|
129
|
+
})
|
|
130
|
+
|
|
114
131
|
const onSelectStorageAndNext = (event: UI_I_SelectStorageReadyData): void => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
132
|
+
dataFormLocal.value.selectStorage = event
|
|
133
|
+
// dataReadyView.value = constructDataReadyViewFunc<UI_I_SelectStorageReadyData>(
|
|
134
|
+
// vmMigrateType.value,
|
|
135
|
+
// props.vmName,
|
|
136
|
+
// event
|
|
137
|
+
// )
|
|
120
138
|
|
|
121
139
|
onNextStep(true)
|
|
122
140
|
}
|
|
141
|
+
|
|
142
|
+
watch(
|
|
143
|
+
currentBlockId,
|
|
144
|
+
(newValue: string) => {
|
|
145
|
+
if (newValue !== 'ready-complete') return
|
|
146
|
+
|
|
147
|
+
dataReadyView.value = constructDataReadyViewFunc<any>(
|
|
148
|
+
vmMigrateType.value,
|
|
149
|
+
props.vmName,
|
|
150
|
+
dataFormLocal.value
|
|
151
|
+
)
|
|
152
|
+
},
|
|
153
|
+
{ deep: true, immediate: true }
|
|
154
|
+
)
|
|
123
155
|
const onFinish = (): void => {
|
|
124
156
|
loading.value = true
|
|
125
157
|
props.finishFunc().then(() => {
|
|
@@ -2,20 +2,26 @@ import type { UI_I_Localization } from '~/models/interfaces'
|
|
|
2
2
|
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
|
|
3
3
|
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
4
4
|
import { UI_E_VmMigrationType } from '~/components/common/wizards/vm/migrate/models/enums'
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
UI_I_CollectedDataFormLocal,
|
|
7
|
+
UI_I_MigrateReadyBlockData,
|
|
8
|
+
} from '~/components/common/wizards/vm/migrate/models/interfaces'
|
|
9
|
+
import { UI_E_SelectStorageDiskFormat } from '~/components/common/wizards/vm/migrate/select/storage/models/enums'
|
|
10
|
+
// import { UI_I_SelectStorageReadyData } from '~/components/common/wizards/vm/migrate/select/storage/models/interfaces'
|
|
7
11
|
import { vmDiskFormatOptions } from '~/components/common/wizards/vm/migrate/select/storage/diskFormat/config/formatOptions'
|
|
8
12
|
|
|
9
13
|
const storageDetailsFunc = (
|
|
10
14
|
localization: UI_I_Localization,
|
|
11
15
|
migrationType: string,
|
|
12
16
|
name: string,
|
|
13
|
-
event:
|
|
17
|
+
event: UI_I_CollectedDataFormLocal
|
|
14
18
|
): UI_I_MigrateReadyBlockData[] => {
|
|
15
|
-
const
|
|
19
|
+
const { selectStorage } = event
|
|
20
|
+
|
|
21
|
+
const isActivePerDiskTab: boolean = selectStorage.tab === 'configure-disk'
|
|
16
22
|
|
|
17
23
|
const diskFormat = vmDiskFormatOptions().find(
|
|
18
|
-
(file) => file.value ===
|
|
24
|
+
(file) => file.value === selectStorage.vmDiskFormat
|
|
19
25
|
)!
|
|
20
26
|
|
|
21
27
|
let result: UI_I_MigrateReadyBlockData[] = [
|
|
@@ -31,7 +37,7 @@ const storageDetailsFunc = (
|
|
|
31
37
|
},
|
|
32
38
|
{
|
|
33
39
|
label: localization.storage,
|
|
34
|
-
value:
|
|
40
|
+
value: selectStorage.storage?.name,
|
|
35
41
|
permissions: ['batch-configure'],
|
|
36
42
|
},
|
|
37
43
|
{
|
|
@@ -40,43 +46,56 @@ const storageDetailsFunc = (
|
|
|
40
46
|
permissions: ['batch-configure'],
|
|
41
47
|
},
|
|
42
48
|
{
|
|
43
|
-
label:
|
|
44
|
-
value:
|
|
49
|
+
label: name,
|
|
50
|
+
value: '',
|
|
45
51
|
permissions: ['configure-disk'],
|
|
46
52
|
},
|
|
47
53
|
]
|
|
48
54
|
|
|
49
|
-
if (isActivePerDiskTab &&
|
|
50
|
-
const perDiskItems: UI_I_MigrateReadyBlockData[] =
|
|
51
|
-
(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
if (isActivePerDiskTab && selectStorage.configureDisks) {
|
|
56
|
+
const perDiskItems: UI_I_MigrateReadyBlockData[] =
|
|
57
|
+
selectStorage.configureDisks.map((disk) => {
|
|
58
|
+
const isConfigurationFile = disk.file === 'Configuration file'
|
|
59
|
+
const diskFormat = UI_E_SelectStorageDiskFormat[disk.disk_format]
|
|
60
|
+
|
|
61
|
+
const text = isConfigurationFile
|
|
62
|
+
? disk.storage
|
|
63
|
+
: `${disk.storage} (${diskFormat})`
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
label: disk.file,
|
|
67
|
+
value: text,
|
|
68
|
+
permissions: ['configure-disk'],
|
|
69
|
+
isProperty: true,
|
|
70
|
+
}
|
|
56
71
|
})
|
|
57
|
-
)
|
|
58
72
|
result = result.concat(perDiskItems)
|
|
59
73
|
}
|
|
60
74
|
|
|
61
|
-
return result.filter((option) =>
|
|
75
|
+
return result.filter((option) =>
|
|
76
|
+
option.permissions.includes(selectStorage.tab)
|
|
77
|
+
)
|
|
62
78
|
}
|
|
63
|
-
export const constructDataReadyViewFunc =
|
|
79
|
+
export const constructDataReadyViewFunc = (
|
|
64
80
|
type: UI_T_VmMigrateType,
|
|
65
81
|
name: string,
|
|
66
|
-
data:
|
|
82
|
+
data: UI_I_CollectedDataFormLocal
|
|
67
83
|
): UI_I_TableInfoItem[] => {
|
|
68
84
|
const localization: UI_I_Localization = useLocal()
|
|
69
85
|
|
|
70
|
-
const details = {
|
|
71
|
-
|
|
72
|
-
|
|
86
|
+
// const details = {
|
|
87
|
+
// storage: storageDetailsFunc,
|
|
88
|
+
// 'resource-storage': storageDetailsFunc, // временно чтобы не было ошибка при исползоване сфере
|
|
89
|
+
// }
|
|
73
90
|
|
|
74
91
|
const migrationType = localization[UI_E_VmMigrationType[type]]
|
|
75
92
|
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
93
|
+
return storageDetailsFunc(localization, migrationType, name, data)
|
|
94
|
+
|
|
95
|
+
// return details[type as keyof typeof details](
|
|
96
|
+
// localization,
|
|
97
|
+
// migrationType,
|
|
98
|
+
// name,
|
|
99
|
+
// data
|
|
100
|
+
// )
|
|
82
101
|
}
|
|
@@ -2,8 +2,8 @@ import type { UI_I_VerticalStepItem } from '~/components/atoms/models/interfaces
|
|
|
2
2
|
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
|
|
3
3
|
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
4
4
|
import type { UI_T_VmMigrateSelectStorageTab } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
5
|
+
import type { UI_I_SelectStorageReadyData } from '~/components/common/wizards/vm/migrate/select/storage/models/interfaces'
|
|
5
6
|
import type { UI_T_Project } from '~/models/types'
|
|
6
|
-
|
|
7
7
|
export interface UI_I_MigrateVerticalStepItem extends UI_I_VerticalStepItem {
|
|
8
8
|
id: string
|
|
9
9
|
project: UI_T_Project[]
|
|
@@ -14,3 +14,7 @@ export interface UI_I_MigrateVerticalStepItem extends UI_I_VerticalStepItem {
|
|
|
14
14
|
export interface UI_I_MigrateReadyBlockData extends UI_I_TableInfoItem {
|
|
15
15
|
permissions: UI_T_VmMigrateSelectStorageTab[]
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
export interface UI_I_CollectedDataFormLocal {
|
|
19
|
+
selectStorage: UI_I_SelectStorageReadyData
|
|
20
|
+
}
|
|
@@ -1,33 +1,141 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="compute-resource">
|
|
3
|
-
<
|
|
4
|
-
v-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
<div
|
|
4
|
+
v-if="props.migrateType === 'resource-storage'"
|
|
5
|
+
class="tree-view-wrap mt-1"
|
|
6
|
+
>
|
|
7
|
+
<common-wizards-vm-common-compute-resource-tree-view
|
|
8
|
+
v-model="computeResourceDataLocal.selectedNode"
|
|
9
|
+
:compute-resource-tree="nodes"
|
|
10
|
+
@show-compute-resource-tree="onShowComputeResourceTree"
|
|
11
|
+
@select-compute-resource-tree="onSelectComputeResourceTree"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<template v-else>
|
|
16
|
+
<atoms-tabs
|
|
17
|
+
v-model="activeTab"
|
|
18
|
+
test-id="migrate-select-storage-tabs"
|
|
19
|
+
:items="selectStorageTabs"
|
|
20
|
+
size="small"
|
|
21
|
+
class="compute-resource__tabs"
|
|
22
|
+
/>
|
|
10
23
|
|
|
11
|
-
|
|
24
|
+
<common-wizards-vm-migrate-select-compute-resource-table-view
|
|
25
|
+
v-model:selected-data="selectedData"
|
|
26
|
+
:data-table="[]"
|
|
27
|
+
:type="activeTab"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<common-wizards-vm-common-validation-compatibility
|
|
32
|
+
:loading="!computeResourceDataLocal.selectedNode"
|
|
33
|
+
:status="compatibilityText[0]"
|
|
34
|
+
:text="compatibilityText[1]"
|
|
35
|
+
/>
|
|
12
36
|
</div>
|
|
13
37
|
</template>
|
|
14
38
|
|
|
15
39
|
<script lang="ts" setup>
|
|
16
40
|
import type { UI_I_Localization } from '~/models/interfaces'
|
|
17
41
|
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/models/interfaces'
|
|
42
|
+
import type { UI_I_TreeNode } from '~/components/common/recursionTree/models/interfaces'
|
|
18
43
|
import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
44
|
+
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
19
45
|
import { vmMigrateComputeResourceTabsFunc } from '~/components/common/wizards/vm/migrate/select/computeResource/config/tabsPannel'
|
|
20
46
|
|
|
47
|
+
const props = defineProps<{
|
|
48
|
+
migrateType: UI_T_VmMigrateType
|
|
49
|
+
computeResourceTree: UI_I_TreeNode
|
|
50
|
+
}>()
|
|
51
|
+
|
|
21
52
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
53
|
+
const { $recursion } = useNuxtApp()
|
|
22
54
|
|
|
23
55
|
const activeTab = ref<UI_T_SelectComputeResourceTabType>('host')
|
|
24
56
|
const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
|
|
25
57
|
vmMigrateComputeResourceTabsFunc(localization.value)
|
|
26
58
|
)
|
|
59
|
+
|
|
60
|
+
const computeResourceDataLocal = ref<any>({
|
|
61
|
+
selectedNode: null,
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const nodes = ref<UI_I_TreeNode[]>([])
|
|
65
|
+
|
|
66
|
+
watch(
|
|
67
|
+
props.computeResourceTree,
|
|
68
|
+
(newValue) => {
|
|
69
|
+
if (nodes.value.length) return
|
|
70
|
+
|
|
71
|
+
nodes.value = useDeepCopy([newValue])
|
|
72
|
+
},
|
|
73
|
+
{ immediate: true, deep: true }
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
const onShowComputeResourceTree = ({
|
|
77
|
+
node,
|
|
78
|
+
cb,
|
|
79
|
+
}: {
|
|
80
|
+
node: UI_I_TreeNode
|
|
81
|
+
cb: () => void
|
|
82
|
+
}): void => {
|
|
83
|
+
$recursion.findAndShow(
|
|
84
|
+
nodes.value,
|
|
85
|
+
[node.id, node.type],
|
|
86
|
+
['id', 'type'],
|
|
87
|
+
'nodes'
|
|
88
|
+
)
|
|
89
|
+
cb()
|
|
90
|
+
}
|
|
91
|
+
const onSelectComputeResourceTree = (node: UI_I_TreeNode): void => {
|
|
92
|
+
$recursion.findAndActivate(
|
|
93
|
+
nodes.value,
|
|
94
|
+
[node.type, node.id],
|
|
95
|
+
['type', 'id'],
|
|
96
|
+
'nodes'
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
const compatibilityText = computed<[string, string]>(() => {
|
|
100
|
+
const { selectedNode } = computeResourceDataLocal.value
|
|
101
|
+
|
|
102
|
+
if (!selectedNode) return ['Success', '']
|
|
103
|
+
|
|
104
|
+
let res: [string, string] = ['Success', 'compatibilityChecksSucceeded']
|
|
105
|
+
|
|
106
|
+
if (selectedNode.type === 'datacenter' || selectedNode.type === 'folder') {
|
|
107
|
+
res = ['Error', 'selectValidClusterOrHostDestination']
|
|
108
|
+
}
|
|
109
|
+
if (selectedNode.type === 'cluster') {
|
|
110
|
+
const hasHost = !!selectedNode.nodes.length
|
|
111
|
+
if (!hasHost) {
|
|
112
|
+
res = ['Error', 'clusterNotContainAnyHosts']
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (selectedNode.type === 'host') {
|
|
117
|
+
if (selectedNode.state === 'Error') {
|
|
118
|
+
// TODO check Maintenance Mode
|
|
119
|
+
res = ['Error', 'selectedHostDisconnectedMaintenanceMode']
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return res
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
const selectedData = ref([])
|
|
27
127
|
</script>
|
|
28
128
|
|
|
29
129
|
<style lang="scss" scoped>
|
|
30
130
|
.compute-resource {
|
|
131
|
+
.tree-view-wrap {
|
|
132
|
+
max-height: 250px;
|
|
133
|
+
min-height: 200px;
|
|
134
|
+
position: relative;
|
|
135
|
+
border: 1px solid #000;
|
|
136
|
+
padding: 5px 0 0 5px;
|
|
137
|
+
overflow: auto;
|
|
138
|
+
}
|
|
31
139
|
&__tabs {
|
|
32
140
|
width: 100%;
|
|
33
141
|
:deep(.nav) {
|