bfg-common 1.2.178 → 1.2.180
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 +3 -1
- package/assets/localization/local_en.json +3 -1
- package/assets/localization/local_hy.json +3 -1
- package/assets/localization/local_kk.json +3 -1
- package/assets/localization/local_ru.json +3 -1
- package/assets/localization/local_zh.json +3 -1
- package/components/common/tools/Actions.vue +167 -164
- package/components/common/wizards/vm/migrate/Migrate.vue +13 -2
- package/components/common/wizards/vm/migrate/config/constructDataReady.ts +1 -2
- package/components/common/wizards/vm/migrate/models/interfaces.ts +4 -0
- package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +45 -8
- package/components/common/wizards/vm/migrate/select/computeResource/models/enums.ts +6 -0
- package/components/common/wizards/vm/migrate/select/computeResource/models/interfaces.ts +30 -0
- package/components/common/wizards/vm/migrate/select/computeResource/models/types.ts +12 -0
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/TableView.vue +78 -26
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/hostTable.ts +16 -33
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/models/interfaces.ts +29 -0
- package/components/common/wizards/vm/migrate/select/priority/config/typeOptions.ts +2 -2
- package/components/common/wizards/vm/migrate/select/priority/models/types.ts +1 -1
- package/components/common/wizards/vm/migrate/select/storage/Storage.vue +27 -17
- package/composables/useLocalStorage.ts +1 -1
- package/package.json +1 -1
|
@@ -2130,5 +2130,7 @@
|
|
|
2130
2130
|
"required": "Неабходны",
|
|
2131
2131
|
"notRunnable": "Не паддаецца запуску",
|
|
2132
2132
|
"failCount": "Колькасць збояў",
|
|
2133
|
-
"updatesNewerVersionSupported": "падтрымліваюцца абнаўлення толькі да больш новай версіі"
|
|
2133
|
+
"updatesNewerVersionSupported": "падтрымліваюцца абнаўлення толькі да больш новай версіі",
|
|
2134
|
+
"vMotionPriority": "Прыярытэт vMotion",
|
|
2135
|
+
"noNetworkReassignments": "Няма перапрызначэння сеткі"
|
|
2134
2136
|
}
|
|
@@ -2133,5 +2133,7 @@
|
|
|
2133
2133
|
"required": "Required",
|
|
2134
2134
|
"notRunnable": "Not Runnable",
|
|
2135
2135
|
"failCount": "Fail Count",
|
|
2136
|
-
"updatesNewerVersionSupported": "updates only to newer version supported"
|
|
2136
|
+
"updatesNewerVersionSupported": "updates only to newer version supported",
|
|
2137
|
+
"vMotionPriority": "vMotion Priority",
|
|
2138
|
+
"noNetworkReassignments": "No network reassignments"
|
|
2137
2139
|
}
|
|
@@ -2133,5 +2133,7 @@
|
|
|
2133
2133
|
"required": "Պահանջվող",
|
|
2134
2134
|
"notRunnable": "Չի գործարկվում",
|
|
2135
2135
|
"failCount": "Խափանումների քանակը",
|
|
2136
|
-
"updatesNewerVersionSupported": "աջակցվում են միայն նոր տարբերակի թարմացումները"
|
|
2136
|
+
"updatesNewerVersionSupported": "աջակցվում են միայն նոր տարբերակի թարմացումները",
|
|
2137
|
+
"vMotionPriority": "vMotion Priority",
|
|
2138
|
+
"noNetworkReassignments": "Ցանցի վերաբաշխումներ չկան"
|
|
2137
2139
|
}
|
|
@@ -2133,5 +2133,7 @@
|
|
|
2133
2133
|
"required": "Міндетті",
|
|
2134
2134
|
"notRunnable": "Іске Қосу Мүмкін Емес",
|
|
2135
2135
|
"failCount": "Сәтсіз Санау",
|
|
2136
|
-
"updatesNewerVersionSupported": "тек қолдау көрсетілетін жаңа нұсқаға жаңартулар"
|
|
2136
|
+
"updatesNewerVersionSupported": "тек қолдау көрсетілетін жаңа нұсқаға жаңартулар",
|
|
2137
|
+
"vMotionPriority": "vMotion басымдылығы",
|
|
2138
|
+
"noNetworkReassignments": "Желіні қайта тағайындау жоқ"
|
|
2137
2139
|
}
|
|
@@ -2133,5 +2133,7 @@
|
|
|
2133
2133
|
"required": "Требуемый",
|
|
2134
2134
|
"notRunnable": "Не поддается запуску",
|
|
2135
2135
|
"failCount": "Количество сбоев",
|
|
2136
|
-
"updatesNewerVersionSupported": "поддерживаются обновления только до более новой версии"
|
|
2136
|
+
"updatesNewerVersionSupported": "поддерживаются обновления только до более новой версии",
|
|
2137
|
+
"vMotionPriority": "Приоритет vMotion",
|
|
2138
|
+
"noNetworkReassignments": "Никаких переназначений сети"
|
|
2137
2139
|
}
|
|
@@ -2133,5 +2133,7 @@
|
|
|
2133
2133
|
"required": "必需的",
|
|
2134
2134
|
"notRunnable": "不可运行",
|
|
2135
2135
|
"failCount": "失败计数",
|
|
2136
|
-
"updatesNewerVersionSupported": "仅更新到支持的较新版本"
|
|
2136
|
+
"updatesNewerVersionSupported": "仅更新到支持的较新版本",
|
|
2137
|
+
"vMotionPriority": "vMotion 优先级",
|
|
2138
|
+
"noNetworkReassignments": "无需重新分配网络"
|
|
2137
2139
|
}
|
|
@@ -1,164 +1,167 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:id="id"
|
|
4
|
-
class="btn-group"
|
|
5
|
-
:style="{ 'padding-right': rightSpace + 'px' }"
|
|
6
|
-
>
|
|
7
|
-
<div v-for="(button, key) in props.actions" :key="button.type">
|
|
8
|
-
<label v-if="button.uploaded">
|
|
9
|
-
<span :class="[`btn btn-link ${props.size}`]">
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
72
|
-
|
|
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
|
-
const
|
|
110
|
-
const
|
|
111
|
-
const
|
|
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
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="id"
|
|
4
|
+
class="btn-group"
|
|
5
|
+
:style="{ 'padding-right': rightSpace + 'px' }"
|
|
6
|
+
>
|
|
7
|
+
<div v-for="(button, key) in props.actions" :key="button.type">
|
|
8
|
+
<label v-if="button.uploaded">
|
|
9
|
+
<span :class="[`btn btn-link ${props.size}`]">
|
|
10
|
+
<slot name="icon" :data="button" />
|
|
11
|
+
{{ button.text }}
|
|
12
|
+
</span>
|
|
13
|
+
<input
|
|
14
|
+
:id="`select-file-button-${key}`"
|
|
15
|
+
type="file"
|
|
16
|
+
:disabled="button.disabled"
|
|
17
|
+
:multiple="false"
|
|
18
|
+
class="btn-group__file"
|
|
19
|
+
@change="(event) => onSelectFiles(event, button.type)"
|
|
20
|
+
/>
|
|
21
|
+
</label>
|
|
22
|
+
|
|
23
|
+
<button
|
|
24
|
+
v-else
|
|
25
|
+
:id="`actions-button-${key}`"
|
|
26
|
+
:class="[`btn btn-link ${props.size}`]"
|
|
27
|
+
:disabled="button.disabled"
|
|
28
|
+
@click="onClickButton(button.type)"
|
|
29
|
+
>
|
|
30
|
+
<slot name="icon" :data="button" />
|
|
31
|
+
{{ button.text }}
|
|
32
|
+
</button>
|
|
33
|
+
</div>
|
|
34
|
+
<atoms-collapse-nav
|
|
35
|
+
v-show="collapsedItems.length"
|
|
36
|
+
:test-id="`${props.testId}-item`"
|
|
37
|
+
:items="collapsedItems"
|
|
38
|
+
close-after-click
|
|
39
|
+
@change="onClickButton"
|
|
40
|
+
@select-file="onSelectFiles"
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts" setup>
|
|
46
|
+
import type { UI_I_Button } from '~/components/common/tools/models/interfaces'
|
|
47
|
+
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/models/interfaces'
|
|
48
|
+
|
|
49
|
+
const props = withDefaults(
|
|
50
|
+
defineProps<{
|
|
51
|
+
actions: UI_I_Button[]
|
|
52
|
+
testId: string
|
|
53
|
+
size?: 'btn-sm' | ''
|
|
54
|
+
}>(),
|
|
55
|
+
{
|
|
56
|
+
size: 'btn-sm',
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
const emits = defineEmits<{
|
|
60
|
+
(event: 'click', value1: string, value2?: Event | null): void
|
|
61
|
+
}>()
|
|
62
|
+
|
|
63
|
+
const onClickButton = (type: string): void => {
|
|
64
|
+
emits('click', type)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const onSelectFiles = (event: Event, type: string): void => {
|
|
68
|
+
emits('click', type, event)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const visibleCount = ref<number>(props.actions.length)
|
|
72
|
+
const collapsedItems = computed<UI_I_CollapseNavItem[]>(() => {
|
|
73
|
+
return props.actions
|
|
74
|
+
.filter((_, index) => {
|
|
75
|
+
return index >= visibleCount.value
|
|
76
|
+
})
|
|
77
|
+
.map((item) => {
|
|
78
|
+
return {
|
|
79
|
+
text: item.text,
|
|
80
|
+
value: item.type,
|
|
81
|
+
disabled: item.disabled,
|
|
82
|
+
uploaded: item.uploaded,
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
const rightSpace = ref<number>(0)
|
|
88
|
+
watch(
|
|
89
|
+
collapsedItems,
|
|
90
|
+
(newValue) => {
|
|
91
|
+
let space = 0
|
|
92
|
+
const element: any = document.getElementById(id.value)
|
|
93
|
+
if (!element || !newValue.length) space = 0
|
|
94
|
+
else if (element.lastChild?.className?.includes('tabs-overflow')) {
|
|
95
|
+
space =
|
|
96
|
+
element.getBoundingClientRect().right -
|
|
97
|
+
element.lastChild.getBoundingClientRect().left
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
rightSpace.value = space
|
|
101
|
+
},
|
|
102
|
+
{ deep: true }
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
const outputSize = (): void => {
|
|
106
|
+
const el = document.getElementById(id.value)
|
|
107
|
+
if (!el) return
|
|
108
|
+
|
|
109
|
+
const elWidth = el.clientWidth
|
|
110
|
+
const elItems = el.children
|
|
111
|
+
const elItemsMarginLeft = parseInt(getComputedStyle(elItems[0]).marginLeft)
|
|
112
|
+
const elItemsMarginRight = parseInt(getComputedStyle(elItems[0]).marginRight)
|
|
113
|
+
const childrenMarginY = elItemsMarginLeft + elItemsMarginRight
|
|
114
|
+
|
|
115
|
+
let childrenWidth = 0
|
|
116
|
+
let count = 0
|
|
117
|
+
for (let i = 0; i < elItems.length; i++) {
|
|
118
|
+
childrenWidth += elItems[i].clientWidth + childrenMarginY
|
|
119
|
+
const isWrap = elWidth - rightSpace.value < childrenWidth
|
|
120
|
+
|
|
121
|
+
if (isWrap) break
|
|
122
|
+
count++
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
visibleCount.value = count
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const setResizeObserve = (): void => {
|
|
129
|
+
const el = document.getElementById(id.value)
|
|
130
|
+
|
|
131
|
+
if (!el) {
|
|
132
|
+
setTimeout(setResizeObserve, 0)
|
|
133
|
+
return
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
new ResizeObserver(outputSize).observe(el)
|
|
137
|
+
}
|
|
138
|
+
const id = ref<string>('')
|
|
139
|
+
onMounted(() => {
|
|
140
|
+
id.value = `tool-actions-${useUniqueId()}`
|
|
141
|
+
setResizeObserve()
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
</script>
|
|
145
|
+
|
|
146
|
+
<style lang="scss" scoped>
|
|
147
|
+
.btn {
|
|
148
|
+
&:disabled {
|
|
149
|
+
color: var(--btn-link-disabled);
|
|
150
|
+
}
|
|
151
|
+
&-group {
|
|
152
|
+
margin-top: 10px;
|
|
153
|
+
box-shadow: none;
|
|
154
|
+
position: relative;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
display: flex;
|
|
157
|
+
flex-wrap: wrap;
|
|
158
|
+
min-height: 25px;
|
|
159
|
+
height: 25px;
|
|
160
|
+
box-sizing: content-box;
|
|
161
|
+
|
|
162
|
+
&__file {
|
|
163
|
+
display: none;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
</style>
|
|
@@ -35,7 +35,9 @@
|
|
|
35
35
|
<common-wizards-vm-migrate-select-compute-resource
|
|
36
36
|
v-show="currentBlockId === 'select-compute-resource'"
|
|
37
37
|
:submit="selectComputeResourceSubmit"
|
|
38
|
+
:get-compute-resource-data="props.getComputeResourceData"
|
|
38
39
|
:migrate-type="vmMigrateType"
|
|
40
|
+
:compute-resource-data="props.computeResourceTableData"
|
|
39
41
|
:compute-resource-tree="props.computeResourceTree"
|
|
40
42
|
@next-step="onSelectComputeResourceAndNext"
|
|
41
43
|
/>
|
|
@@ -82,6 +84,7 @@ import type { UI_I_SelectStorageReadyData } from '~/components/common/wizards/vm
|
|
|
82
84
|
import type { UI_I_MigrateVerticalStepItem } from '~/components/common/wizards/vm/migrate/models/interfaces'
|
|
83
85
|
import type { UI_T_SelectVMotionPriority } from '~/components/common/wizards/vm/migrate/select/priority/models/types'
|
|
84
86
|
import type { UI_I_CollectedDataFormLocal } from '~/components/common/wizards/vm/migrate/models/interfaces'
|
|
87
|
+
import type { UI_I_ComputeResourceDataLocal } from '~/components/common/wizards/vm/migrate/select/computeResource/models/interfaces'
|
|
85
88
|
import { stepItemsFunc } from '~/components/common/wizards/vm/migrate/utils'
|
|
86
89
|
import { constructDataReadyViewFunc } from '~/components/common/wizards/vm/migrate/config/constructDataReady'
|
|
87
90
|
|
|
@@ -90,8 +93,10 @@ const props = defineProps<{
|
|
|
90
93
|
vmSettings: UI_I_VmSettings | null
|
|
91
94
|
vmName: string
|
|
92
95
|
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
96
|
+
getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
|
|
93
97
|
datastore: UI_I_DatastoreTableItem[]
|
|
94
98
|
configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
|
|
99
|
+
computeResourceTableData?: any
|
|
95
100
|
computeResourceTree?: UI_I_TreeNode
|
|
96
101
|
readyCompleteTableInfo?: any // пока так потом если будет нужен изменит или удалить
|
|
97
102
|
finishFunc: any
|
|
@@ -109,7 +114,7 @@ const loading = ref<boolean>(false)
|
|
|
109
114
|
const selectStorageSubmit = ref<number>(0)
|
|
110
115
|
const selectComputeResourceSubmit = ref<number>(0)
|
|
111
116
|
|
|
112
|
-
const selectedVMotionPriority = ref<UI_T_SelectVMotionPriority>('high
|
|
117
|
+
const selectedVMotionPriority = ref<UI_T_SelectVMotionPriority>('high')
|
|
113
118
|
|
|
114
119
|
const vmMigrateType = ref<UI_T_VmMigrateType>(
|
|
115
120
|
props.project === 'procurator' ? 'storage' : 'resource'
|
|
@@ -128,10 +133,16 @@ const connectedStorageIdOnVm = computed<string>(
|
|
|
128
133
|
)
|
|
129
134
|
|
|
130
135
|
const dataFormLocal = ref<UI_I_CollectedDataFormLocal>({
|
|
136
|
+
selectedComputeResource: null,
|
|
131
137
|
selectStorage: null,
|
|
138
|
+
selectedVMotionPriority: 'high',
|
|
132
139
|
})
|
|
133
140
|
|
|
134
|
-
const onSelectComputeResourceAndNext = (
|
|
141
|
+
const onSelectComputeResourceAndNext = (
|
|
142
|
+
event: UI_I_ComputeResourceDataLocal
|
|
143
|
+
): void => {
|
|
144
|
+
dataFormLocal.value.selectedComputeResource = event
|
|
145
|
+
|
|
135
146
|
onNextStep(true)
|
|
136
147
|
}
|
|
137
148
|
const onSelectStorageAndNext = (event: UI_I_SelectStorageReadyData): void => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { UI_I_Localization } from '~/models/interfaces'
|
|
2
|
-
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
|
|
3
2
|
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
4
3
|
import { UI_E_VmMigrationType } from '~/components/common/wizards/vm/migrate/models/enums'
|
|
5
4
|
import {
|
|
@@ -80,7 +79,7 @@ export const constructDataReadyViewFunc = (
|
|
|
80
79
|
type: UI_T_VmMigrateType,
|
|
81
80
|
name: string,
|
|
82
81
|
data: UI_I_CollectedDataFormLocal
|
|
83
|
-
):
|
|
82
|
+
): UI_I_MigrateReadyBlockData[] => {
|
|
84
83
|
const localization: UI_I_Localization = useLocal()
|
|
85
84
|
|
|
86
85
|
// const details = {
|
|
@@ -3,7 +3,9 @@ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/in
|
|
|
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
5
|
import type { UI_I_SelectStorageReadyData } from '~/components/common/wizards/vm/migrate/select/storage/models/interfaces'
|
|
6
|
+
import type { UI_T_SelectVMotionPriority } from '~/components/common/wizards/vm/migrate/select/priority/models/types'
|
|
6
7
|
import type { UI_T_Project } from '~/models/types'
|
|
8
|
+
import type { UI_I_ComputeResourceDataLocal } from '~/components/common/wizards/vm/migrate/select/computeResource/models/interfaces'
|
|
7
9
|
export interface UI_I_MigrateVerticalStepItem extends UI_I_VerticalStepItem {
|
|
8
10
|
id: string
|
|
9
11
|
project: UI_T_Project[]
|
|
@@ -16,5 +18,7 @@ export interface UI_I_MigrateReadyBlockData extends UI_I_TableInfoItem {
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export interface UI_I_CollectedDataFormLocal {
|
|
21
|
+
selectedComputeResource: UI_I_ComputeResourceDataLocal
|
|
19
22
|
selectStorage: UI_I_SelectStorageReadyData
|
|
23
|
+
selectedVMotionPriority: UI_T_SelectVMotionPriority
|
|
20
24
|
}
|
|
@@ -30,8 +30,11 @@
|
|
|
30
30
|
/>
|
|
31
31
|
|
|
32
32
|
<common-wizards-vm-migrate-select-compute-resource-table-view
|
|
33
|
-
v-model:selected-data="
|
|
34
|
-
:data
|
|
33
|
+
v-model:selected-data="selectedTableDataKeys[activeTab]"
|
|
34
|
+
:get-compute-resource-data="props.getComputeResourceData"
|
|
35
|
+
:data-table="props.computeResourceData?.items || []"
|
|
36
|
+
:total-items="props.computeResourceData?.total_items || 0"
|
|
37
|
+
:total-pages="props.computeResourceData?.total_pages || 1"
|
|
35
38
|
:type="activeTab"
|
|
36
39
|
/>
|
|
37
40
|
</template>
|
|
@@ -48,13 +51,18 @@
|
|
|
48
51
|
import type { UI_I_Localization } from '~/models/interfaces'
|
|
49
52
|
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/models/interfaces'
|
|
50
53
|
import type { UI_I_TreeNode } from '~/components/common/recursionTree/models/interfaces'
|
|
54
|
+
import type { UI_I_TablePayload } from '~/models/store/interfaces'
|
|
51
55
|
import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
56
|
+
import type { UI_E_ComputeResourceTabKamelKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/models/enums'
|
|
52
57
|
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
58
|
+
import type { UI_I_SelectedTableDataKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/models/interfaces'
|
|
53
59
|
import { vmMigrateComputeResourceTabsFunc } from '~/components/common/wizards/vm/migrate/select/computeResource/config/tabsPannel'
|
|
54
60
|
|
|
55
61
|
const props = defineProps<{
|
|
56
62
|
submit: number
|
|
63
|
+
getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
|
|
57
64
|
migrateType: UI_T_VmMigrateType
|
|
65
|
+
computeResourceData: any
|
|
58
66
|
computeResourceTree: UI_I_TreeNode
|
|
59
67
|
}>()
|
|
60
68
|
const emits = defineEmits<{
|
|
@@ -71,10 +79,35 @@ const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
|
|
|
71
79
|
|
|
72
80
|
const computeResourceDataLocal = ref<any>({
|
|
73
81
|
selectedNode: null,
|
|
82
|
+
host: null,
|
|
83
|
+
cluster: null,
|
|
84
|
+
resourcePool: null,
|
|
85
|
+
vApps: null,
|
|
74
86
|
})
|
|
75
87
|
|
|
76
|
-
const
|
|
88
|
+
const selectedTableDataKeys = ref<UI_I_SelectedTableDataKeys>({
|
|
89
|
+
host: null,
|
|
90
|
+
cluster: null,
|
|
91
|
+
'resource-pool': null,
|
|
92
|
+
'v-apps': null,
|
|
93
|
+
})
|
|
94
|
+
watch(
|
|
95
|
+
selectedTableDataKeys,
|
|
96
|
+
(newValue) => {
|
|
97
|
+
if (!props.computeResourceData?.items.length) return
|
|
98
|
+
|
|
99
|
+
const data = props.computeResourceData.items.find(
|
|
100
|
+
(_: never, key: number) => newValue[activeTab.value] === key
|
|
101
|
+
)
|
|
102
|
+
if (data) {
|
|
103
|
+
const dataKeys = UI_E_ComputeResourceTabKamelKeys[activeTab.value]
|
|
104
|
+
computeResourceDataLocal.value[dataKeys] = data
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{ immediate: true, deep: true }
|
|
108
|
+
)
|
|
77
109
|
|
|
110
|
+
const nodes = ref<UI_I_TreeNode[]>([])
|
|
78
111
|
watch(
|
|
79
112
|
props.computeResourceTree,
|
|
80
113
|
(newValue) => {
|
|
@@ -140,16 +173,20 @@ const onHideErrorMessageAlert = (): void => {
|
|
|
140
173
|
errorMessages.value = []
|
|
141
174
|
}
|
|
142
175
|
|
|
143
|
-
const selectedData = ref([])
|
|
144
|
-
|
|
145
176
|
const checkValidityBlock = (): boolean => {
|
|
146
|
-
|
|
177
|
+
const hasSelectedData = Object.values(computeResourceDataLocal.value).some(
|
|
178
|
+
(value) => value !== null
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
if (!hasSelectedData) {
|
|
147
182
|
const errorText = localization.value.selectValidDestinationComputeResource
|
|
148
|
-
|
|
183
|
+
|
|
149
184
|
errorMessages.value = [errorText]
|
|
150
185
|
return false
|
|
151
186
|
}
|
|
152
|
-
emits('next-step', {
|
|
187
|
+
emits('next-step', {
|
|
188
|
+
...computeResourceDataLocal.value,
|
|
189
|
+
})
|
|
153
190
|
return true
|
|
154
191
|
}
|
|
155
192
|
watch(
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UI_T_ComputeResourceTableItem } from '~/components/common/wizards/vm/migrate/select/computeResource/models/types'
|
|
2
|
+
import type {
|
|
3
|
+
UI_I_HostTableItem,
|
|
4
|
+
UI_I_ClusterTableItem,
|
|
5
|
+
UI_I_ResourcePoolsTableItem,
|
|
6
|
+
UI_I_VAppsTableItem,
|
|
7
|
+
} from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/models/interfaces'
|
|
8
|
+
import type { UI_I_TreeNode } from '~/components/common/recursionTree/models/interfaces'
|
|
9
|
+
import type { API_UI_I_DataTable } from '~/models/interfaces'
|
|
10
|
+
|
|
11
|
+
export interface UI_I_SelectedTableDataKeys {
|
|
12
|
+
host: UI_I_HostTableItem | null
|
|
13
|
+
cluster: UI_I_ClusterTableItem | null
|
|
14
|
+
'resource-pool': UI_I_ResourcePoolsTableItem | null
|
|
15
|
+
'v-apps': UI_I_VAppsTableItem | null
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface UI_I_ComputeResourceDataLocal {
|
|
19
|
+
selectedNode: UI_I_TreeNode | null
|
|
20
|
+
host: UI_I_HostTableItem | null
|
|
21
|
+
cluster: UI_I_ClusterTableItem | null
|
|
22
|
+
resourcePool: UI_I_ResourcePoolsTableItem | null
|
|
23
|
+
vApps: UI_I_VAppsTableItem | null
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface API_UI_I_ComputeResourceTableData
|
|
27
|
+
extends API_UI_I_DataTable<UI_T_ComputeResourceTableItem[]> {}
|
|
28
|
+
|
|
29
|
+
export interface UI_I_ComputeResourceTableData
|
|
30
|
+
extends API_UI_I_ComputeResourceTableData {}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_HostTableItem,
|
|
3
|
+
UI_I_ClusterTableItem,
|
|
4
|
+
UI_I_ResourcePoolsTableItem,
|
|
5
|
+
UI_I_VAppsTableItem,
|
|
6
|
+
} from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/models/interfaces'
|
|
7
|
+
|
|
8
|
+
export type UI_T_ComputeResourceTableItem =
|
|
9
|
+
| UI_I_HostTableItem
|
|
10
|
+
| UI_I_ClusterTableItem
|
|
11
|
+
| UI_I_ResourcePoolsTableItem
|
|
12
|
+
| UI_I_VAppsTableItem
|
|
@@ -1,20 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="table-
|
|
2
|
+
<div class="data-table-view">
|
|
3
3
|
<atoms-table-data-grid
|
|
4
4
|
v-model:selected-row="selectedRow"
|
|
5
5
|
v-model:column-keys="columnKeys"
|
|
6
6
|
v-model:page-size="pagination.pageSize"
|
|
7
7
|
v-model:page="pagination.page"
|
|
8
|
-
type="checkbox"
|
|
9
8
|
:head-items="headItems"
|
|
10
9
|
:body-items="bodyItems"
|
|
11
|
-
:total-items="
|
|
12
|
-
:total-pages="
|
|
10
|
+
:total-items="props.totalItems"
|
|
11
|
+
:total-pages="props.totalPages"
|
|
12
|
+
:loading="loading"
|
|
13
|
+
class="data-table"
|
|
13
14
|
server-off
|
|
14
|
-
hide-footer
|
|
15
15
|
hide-page-size
|
|
16
|
-
|
|
16
|
+
hide-pagination
|
|
17
17
|
>
|
|
18
|
+
<template #icon="{ item }">
|
|
19
|
+
<span :class="['datagrid-cell-icon', item.data.iconClassName]" />
|
|
20
|
+
|
|
21
|
+
<span class="text-ellipsis">
|
|
22
|
+
{{ item.text }}
|
|
23
|
+
</span>
|
|
24
|
+
</template>
|
|
25
|
+
<template #progress="{ item }">
|
|
26
|
+
<div class="flex-align-center w-100">
|
|
27
|
+
<div class="progress flex-1">
|
|
28
|
+
<progress class="progress-block" :max="100" :value="item.data" />
|
|
29
|
+
</div>
|
|
30
|
+
<span class="text-ellipsis ml-1" :title="item.text">{{
|
|
31
|
+
item.text
|
|
32
|
+
}}</span>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
18
35
|
</atoms-table-data-grid>
|
|
19
36
|
</div>
|
|
20
37
|
</template>
|
|
@@ -26,24 +43,34 @@ import type {
|
|
|
26
43
|
UI_I_HeadItem,
|
|
27
44
|
UI_I_BodyItem,
|
|
28
45
|
} from '~/components/atoms/table/dataGrid/models/interfaces'
|
|
29
|
-
import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces'
|
|
30
46
|
import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
47
|
+
import type { UI_I_TablePayload } from '~/models/store/interfaces'
|
|
48
|
+
import type { UI_T_ComputeResourceTableItem } from '~/components/common/wizards/vm/migrate/select/computeResource/models/types'
|
|
31
49
|
import * as hostTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/hostTable'
|
|
32
50
|
import * as clusterTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/clusterTable'
|
|
33
51
|
import * as resourcePoolTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/resourcePoolTable'
|
|
34
52
|
import * as vAppsTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/vappsTable'
|
|
35
53
|
|
|
36
54
|
const props = defineProps<{
|
|
37
|
-
|
|
38
|
-
|
|
55
|
+
getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
|
|
56
|
+
selectedData: number
|
|
57
|
+
dataTable: UI_T_ComputeResourceTableItem[]
|
|
58
|
+
totalItems: number
|
|
59
|
+
totalPages: number
|
|
39
60
|
type: UI_T_SelectComputeResourceTabType
|
|
40
61
|
}>()
|
|
41
62
|
const emits = defineEmits<{
|
|
42
|
-
(event: 'update:selected-data', value: number
|
|
63
|
+
(event: 'update:selected-data', value: number): void
|
|
43
64
|
}>()
|
|
44
65
|
|
|
45
66
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
46
67
|
|
|
68
|
+
const loading = ref<boolean>(false)
|
|
69
|
+
const pagination = ref<UI_I_Pagination>({
|
|
70
|
+
page: 1,
|
|
71
|
+
pageSize: 100,
|
|
72
|
+
})
|
|
73
|
+
|
|
47
74
|
const table: any = {
|
|
48
75
|
host: hostTable,
|
|
49
76
|
cluster: clusterTable,
|
|
@@ -51,6 +78,26 @@ const table: any = {
|
|
|
51
78
|
'v-apps': vAppsTable,
|
|
52
79
|
}
|
|
53
80
|
|
|
81
|
+
const getData = async (
|
|
82
|
+
type: UI_T_SelectComputeResourceTabType
|
|
83
|
+
): Promise<void> => {
|
|
84
|
+
const payload: UI_I_TablePayload = {
|
|
85
|
+
pagination: pagination.value,
|
|
86
|
+
sortBy: null,
|
|
87
|
+
schema: 'full',
|
|
88
|
+
type,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
props.getComputeResourceData(payload).then(() => {})
|
|
92
|
+
}
|
|
93
|
+
watch(
|
|
94
|
+
() => props.type,
|
|
95
|
+
(newValue: UI_T_SelectComputeResourceTabType) => {
|
|
96
|
+
getData(newValue)
|
|
97
|
+
},
|
|
98
|
+
{ deep: true, immediate: true }
|
|
99
|
+
)
|
|
100
|
+
|
|
54
101
|
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
55
102
|
table[props.type].headItems(localization.value)
|
|
56
103
|
)
|
|
@@ -62,29 +109,34 @@ watch(localization, () => {
|
|
|
62
109
|
})
|
|
63
110
|
|
|
64
111
|
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
65
|
-
return table[props.type].bodyItems(props.dataTable)
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
const sort = ref<string | null>(null)
|
|
69
|
-
const pagination = ref<UI_I_Pagination>({
|
|
70
|
-
page: 1,
|
|
71
|
-
pageSize: 100,
|
|
112
|
+
return table[props.type].bodyItems(props.dataTable, localization.value)
|
|
72
113
|
})
|
|
73
114
|
|
|
74
|
-
const
|
|
75
|
-
const [column, status] = data
|
|
76
|
-
const direction = status ? 'asc' : 'desc'
|
|
77
|
-
sort.value = `${column}.${direction}`
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const selectedRow = computed<number[]>({
|
|
115
|
+
const selectedRow = computed<number>({
|
|
81
116
|
get() {
|
|
82
117
|
return props.selectedData
|
|
83
118
|
},
|
|
84
|
-
set(newValue: number
|
|
119
|
+
set(newValue: number) {
|
|
85
120
|
emits('update:selected-data', newValue)
|
|
86
121
|
},
|
|
87
122
|
})
|
|
88
123
|
</script>
|
|
89
124
|
|
|
90
|
-
<style lang="scss" scoped
|
|
125
|
+
<style lang="scss" scoped>
|
|
126
|
+
@import 'assets/scss/common/mixins.scss';
|
|
127
|
+
.data-table-view {
|
|
128
|
+
@include flex($dir: column);
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
height: inherit;
|
|
131
|
+
max-height: 250px;
|
|
132
|
+
.data-table {
|
|
133
|
+
@include flex($dir: column);
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
height: inherit;
|
|
137
|
+
:deep(.datagrid-outer-wrapper) {
|
|
138
|
+
height: inherit;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
</style>
|
package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/hostTable.ts
CHANGED
|
@@ -12,9 +12,8 @@ import {
|
|
|
12
12
|
hostIconByState,
|
|
13
13
|
hostLocalizationByState,
|
|
14
14
|
} from '~/components/common/config/states'
|
|
15
|
+
import type { UI_I_HostTableItem } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/models/interfaces'
|
|
15
16
|
// import type { I_TableIconColumnData } from '~/components/templates/inventory/mainBlock/tablesView/models/interfaces'
|
|
16
|
-
// import type { API_I_HostTableItem } from '~/models/store/inventory/host/interfaces'
|
|
17
|
-
import { E_StatusEnum } from '~/components/templates/inventory/treeView/models/enums'
|
|
18
17
|
import { hostTableItemKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/tableKeys'
|
|
19
18
|
|
|
20
19
|
const getItems = (
|
|
@@ -24,7 +23,7 @@ const getItems = (
|
|
|
24
23
|
[localization.name, true, '180px', hostTableItemKeys[0]],
|
|
25
24
|
[localization.state, true, '96px', hostTableItemKeys[1]],
|
|
26
25
|
[localization.cluster, true, '180px', hostTableItemKeys[2]],
|
|
27
|
-
[localization.faultDomain,
|
|
26
|
+
[localization.faultDomain, false, '180px', hostTableItemKeys[3]],
|
|
28
27
|
[`${localization.consumedCpu} %`, true, '180px', hostTableItemKeys[4]],
|
|
29
28
|
[`${localization.consumedMemory} %`, true, '180px', hostTableItemKeys[5]],
|
|
30
29
|
[localization.haState, true, '180px', hostTableItemKeys[6]],
|
|
@@ -48,8 +47,7 @@ export const columnKeys = (
|
|
|
48
47
|
): UI_I_ColumnKey[] => {
|
|
49
48
|
const result: UI_I_ColumnKey[] = []
|
|
50
49
|
getItems(localization).forEach((item, i) => {
|
|
51
|
-
const col =
|
|
52
|
-
i === 0 ? 'icon' : i === 5 || i === 6 ? 'progress' : `col${i + 1}`
|
|
50
|
+
const col = i === 0 ? 'icon' : i === 4 || i === 5 ? 'progress' : `col${i}`
|
|
53
51
|
result.push(constructColumnKey(col, item[0], item[1]))
|
|
54
52
|
})
|
|
55
53
|
return result
|
|
@@ -58,38 +56,24 @@ export const columnKeys = (
|
|
|
58
56
|
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
59
57
|
const result: UI_I_HeadItem[] = []
|
|
60
58
|
getItems(localization).forEach((item, i) => {
|
|
61
|
-
const col =
|
|
62
|
-
i === 0 ? 'icon' : i === 5 || i === 6 ? 'progress' : `col${i + 1}`
|
|
59
|
+
const col = i === 0 ? 'icon' : i === 4 || i === 5 ? 'progress' : `col${i}`
|
|
63
60
|
result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
|
|
64
61
|
})
|
|
65
62
|
return result
|
|
66
63
|
}
|
|
67
64
|
|
|
68
65
|
export const bodyItems = (
|
|
69
|
-
data:
|
|
66
|
+
data: UI_I_HostTableItem[],
|
|
70
67
|
localization: UI_I_Localization
|
|
71
68
|
): UI_I_BodyItem[][] => {
|
|
72
69
|
const { $number } = useNuxtApp()
|
|
73
70
|
|
|
74
71
|
const bodyItems: UI_I_BodyItem[][] = []
|
|
75
72
|
data.forEach((host, key) => {
|
|
76
|
-
const hostData
|
|
73
|
+
const hostData = {
|
|
77
74
|
iconClassName: `vsphere-icon-${hostIconByState[host.state]}`,
|
|
78
|
-
name: host.name,
|
|
79
|
-
// @ts-ignore TODO id надо для перехода, пока что так оставить чтобы нигде не ломалось потом поправить для всех
|
|
80
|
-
id: host.name,
|
|
81
|
-
nav: 'h',
|
|
82
|
-
type: 'host',
|
|
83
|
-
isLink: true,
|
|
84
75
|
}
|
|
85
76
|
|
|
86
|
-
const clusterData: any = {
|
|
87
|
-
iconClassName: E_StatusEnum.cluster_Normal,
|
|
88
|
-
name: host.cluster,
|
|
89
|
-
nav: 'h',
|
|
90
|
-
type: 'cluster',
|
|
91
|
-
isLink: true,
|
|
92
|
-
}
|
|
93
77
|
bodyItems.push([
|
|
94
78
|
{
|
|
95
79
|
key: 'icon',
|
|
@@ -98,17 +82,16 @@ export const bodyItems = (
|
|
|
98
82
|
id: key,
|
|
99
83
|
},
|
|
100
84
|
{
|
|
101
|
-
key: '
|
|
85
|
+
key: 'col1',
|
|
102
86
|
text: localization[hostLocalizationByState[host[hostTableItemKeys[1]]]],
|
|
103
87
|
id: key,
|
|
104
88
|
},
|
|
105
89
|
{
|
|
106
|
-
key: '
|
|
90
|
+
key: 'col2',
|
|
107
91
|
text: host[hostTableItemKeys[2]],
|
|
108
|
-
data: clusterData,
|
|
109
92
|
id: key,
|
|
110
93
|
},
|
|
111
|
-
{ key: '
|
|
94
|
+
{ key: 'col3', text: host[hostTableItemKeys[3]], id: key },
|
|
112
95
|
{
|
|
113
96
|
key: 'progress',
|
|
114
97
|
text: `${host[hostTableItemKeys[4]].toFixed(2)}%`,
|
|
@@ -121,19 +104,19 @@ export const bodyItems = (
|
|
|
121
104
|
data: host[hostTableItemKeys[5]],
|
|
122
105
|
id: key,
|
|
123
106
|
},
|
|
124
|
-
{ key: '
|
|
125
|
-
{ key: '
|
|
126
|
-
{ key: '
|
|
107
|
+
{ key: 'col6', text: host[hostTableItemKeys[6]], id: key },
|
|
108
|
+
{ key: 'col7', text: host[hostTableItemKeys[7]], id: key },
|
|
109
|
+
{ key: 'col8', text: host[hostTableItemKeys[8]], id: key },
|
|
127
110
|
{
|
|
128
|
-
key: '
|
|
111
|
+
key: 'col9',
|
|
129
112
|
text: `${$number.format(host[hostTableItemKeys[9]], 'en')} ${
|
|
130
113
|
localization.mb
|
|
131
114
|
}`,
|
|
132
115
|
id: key,
|
|
133
116
|
},
|
|
134
|
-
{ key: '
|
|
135
|
-
{ key: '
|
|
136
|
-
{ key: '
|
|
117
|
+
{ key: 'col10', text: host[hostTableItemKeys[10]], id: key },
|
|
118
|
+
{ key: 'col11', text: host[hostTableItemKeys[11]], id: key },
|
|
119
|
+
{ key: 'col12', text: host[hostTableItemKeys[12]], id: key },
|
|
137
120
|
{ key: 'col14', text: host[hostTableItemKeys[13]], id: key },
|
|
138
121
|
])
|
|
139
122
|
})
|
package/components/common/wizards/vm/migrate/select/computeResource/tableView/models/interfaces.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface API_UI_I_HostTableItem {
|
|
2
|
+
alarm_action: string
|
|
3
|
+
auto_deploy_machine_identity: string
|
|
4
|
+
cert_valid_to: string
|
|
5
|
+
cluster: string
|
|
6
|
+
consumed_cpu: number
|
|
7
|
+
consumed_mem: number
|
|
8
|
+
cpus: number
|
|
9
|
+
fault_domain: string
|
|
10
|
+
ha_state: string
|
|
11
|
+
instant_clone_maintenance: string
|
|
12
|
+
mem_size: number
|
|
13
|
+
name: string
|
|
14
|
+
nics: number
|
|
15
|
+
state: number
|
|
16
|
+
uptime: number
|
|
17
|
+
version: string
|
|
18
|
+
}
|
|
19
|
+
export interface UI_I_HostTableItem extends API_UI_I_HostTableItem {}
|
|
20
|
+
|
|
21
|
+
export interface API_UI_I_ClusterTableItem {}
|
|
22
|
+
export interface UI_I_ClusterTableItem extends API_UI_I_ClusterTableItem {}
|
|
23
|
+
|
|
24
|
+
export interface API_UI_I_ResourcePoolsTableItem {}
|
|
25
|
+
export interface UI_I_ResourcePoolsTableItem
|
|
26
|
+
extends API_UI_I_ResourcePoolsTableItem {}
|
|
27
|
+
|
|
28
|
+
export interface API_UI_I_VAppsTableItem {}
|
|
29
|
+
export interface UI_I_VAppsTableItem extends API_UI_I_VAppsTableItem {}
|
|
@@ -7,13 +7,13 @@ export const vmMigrateSelectPriorityTypesFunc = (
|
|
|
7
7
|
return [
|
|
8
8
|
{
|
|
9
9
|
label: localization.scheduleVMotionWithHighPriority,
|
|
10
|
-
value: 'high
|
|
10
|
+
value: 'high',
|
|
11
11
|
disabled: false,
|
|
12
12
|
description: localization.scheduleVMotionWithHighPriorityDesc,
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
label: localization.scheduleNormalVMotion,
|
|
16
|
-
value: '
|
|
16
|
+
value: 'normal',
|
|
17
17
|
disabled: false,
|
|
18
18
|
description: localization.scheduleNormalVMotionDesc,
|
|
19
19
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type UI_T_SelectVMotionPriority = 'high
|
|
1
|
+
export type UI_T_SelectVMotionPriority = 'high' | 'normal'
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="select-storage">
|
|
3
|
+
<atoms-alert
|
|
4
|
+
v-if="errorMessages.length"
|
|
5
|
+
test-id="select-storage-alert"
|
|
6
|
+
status="alert-danger"
|
|
7
|
+
:items="errorMessages"
|
|
8
|
+
@remove="onHideErrorMessageAlert"
|
|
9
|
+
/>
|
|
10
|
+
|
|
3
11
|
<common-wizards-vm-migrate-select-storage-selected-per-disk
|
|
4
12
|
v-if="isShowSelectedPerDisks"
|
|
5
13
|
v-model="isShowSelectedPerDisks"
|
|
@@ -20,12 +28,12 @@
|
|
|
20
28
|
|
|
21
29
|
<common-wizards-vm-migrate-select-storage-configure-batch
|
|
22
30
|
v-show="activeTab === 'batch-configure'"
|
|
23
|
-
v-model:vm-disk-format="
|
|
31
|
+
v-model:vm-disk-format="selectStorageDataLocal.vmDiskFormat"
|
|
24
32
|
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
25
33
|
:datastore="props.datastore"
|
|
26
34
|
:connected-storage-id="connectedStorageId"
|
|
27
35
|
:is-hide-select-disk-format="isHideSelectDiskFormat"
|
|
28
|
-
@update-selected-datastore="
|
|
36
|
+
@update-selected-datastore="selectStorageDataLocal.storage = $event"
|
|
29
37
|
>
|
|
30
38
|
<template v-if="isShowSelectedPerDisks" #buttonConfirm>
|
|
31
39
|
<button class="btn btn-sm btn-primary" @click="onApplyChanges">
|
|
@@ -44,7 +52,7 @@
|
|
|
44
52
|
/>
|
|
45
53
|
|
|
46
54
|
<common-wizards-vm-common-validation-compatibility
|
|
47
|
-
:loading="!
|
|
55
|
+
:loading="!selectStorageDataLocal.storage"
|
|
48
56
|
:status="'Success'"
|
|
49
57
|
text="compatibilityChecksSucceeded"
|
|
50
58
|
/>
|
|
@@ -82,7 +90,11 @@ const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
|
|
|
82
90
|
vmMigrateSelectStorageTabsFunc(localization.value)
|
|
83
91
|
)
|
|
84
92
|
|
|
85
|
-
|
|
93
|
+
const errorMessages = ref<string[]>([])
|
|
94
|
+
const selectStorageDataLocal = ref<UI_I_SelectStorageDataLocal>({
|
|
95
|
+
vmDiskFormat: 0,
|
|
96
|
+
storage: null,
|
|
97
|
+
})
|
|
86
98
|
const isShowSelectedPerDisks = ref<boolean>(false)
|
|
87
99
|
|
|
88
100
|
const selectedPerDiskKeys = ref<number[]>([])
|
|
@@ -106,7 +118,7 @@ const onChangePerDiskStorage = (
|
|
|
106
118
|
event: UI_I_StorageConfigurePerDiskItem[]
|
|
107
119
|
): void => {
|
|
108
120
|
connectedStorageIdLocal.value = event[0].extra.datastore_id
|
|
109
|
-
|
|
121
|
+
selectStorageDataLocal.value.vmDiskFormat = event[0].disk_format
|
|
110
122
|
|
|
111
123
|
selectedPerDisks.value = event
|
|
112
124
|
}
|
|
@@ -122,7 +134,7 @@ const onApplyChanges = (): void => {
|
|
|
122
134
|
)!
|
|
123
135
|
|
|
124
136
|
if (selectedDisk) {
|
|
125
|
-
const { storage, vmDiskFormat } =
|
|
137
|
+
const { storage, vmDiskFormat } = selectStorageDataLocal.value
|
|
126
138
|
|
|
127
139
|
// ;({ name: disk.storage, id: disk.extra.datastore_id } = storage)
|
|
128
140
|
disk.storage = storage.name
|
|
@@ -144,23 +156,21 @@ const isHideSelectDiskFormat = computed<boolean>(() => {
|
|
|
144
156
|
selectedPerDisks.value[0].file === 'Configuration file'
|
|
145
157
|
)
|
|
146
158
|
})
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
storage: null,
|
|
151
|
-
})
|
|
159
|
+
const onHideErrorMessageAlert = (): void => {
|
|
160
|
+
errorMessages.value = []
|
|
161
|
+
}
|
|
152
162
|
|
|
153
163
|
const checkValidityBlock = (): boolean => {
|
|
154
|
-
if (!
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
164
|
+
if (!selectStorageDataLocal.value.storage) {
|
|
165
|
+
const errorText = localization.value.selectValidDestinationStorage
|
|
166
|
+
|
|
167
|
+
errorMessages.value = [errorText]
|
|
158
168
|
return false
|
|
159
169
|
}
|
|
170
|
+
onHideErrorMessageAlert()
|
|
160
171
|
const isActivePerDiskTab = activeTab.value === 'configure-disk'
|
|
161
|
-
|
|
162
172
|
emits('next-step', {
|
|
163
|
-
...
|
|
173
|
+
...selectStorageDataLocal.value,
|
|
164
174
|
tab: activeTab.value,
|
|
165
175
|
// ...(isActivePerDiskTab && { configureDisks: props.configurePerDisks }),
|
|
166
176
|
configureDisks: isActivePerDiskTab
|