bfg-common 1.2.108 → 1.2.109
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 +5 -1
- package/assets/localization/local_en.json +5 -1
- package/assets/localization/local_hy.json +5 -1
- package/assets/localization/local_kk.json +5 -1
- package/assets/localization/local_ru.json +5 -1
- package/assets/localization/local_zh.json +5 -1
- package/components/atoms/modal/bySteps/BySteps.vue +1 -1
- package/components/atoms/modal/byStepsSecond/ByStepsSecond.vue +2 -2
- package/components/atoms/step/VerticalStep.vue +1 -1
- package/components/common/monitor/advanced/tools/Tools.vue +428 -428
- package/components/common/wizards/datastore/add/config/stepItems.ts +3 -3
- package/components/common/wizards/vm/common/Tooltip.vue +74 -0
- package/components/common/wizards/vm/common/readyComplete/ReadyComplete.vue +15 -0
- package/components/common/wizards/vm/migrate/Migrate.vue +204 -0
- package/components/common/wizards/vm/migrate/config/constructDataReady.ts +82 -0
- package/components/common/wizards/vm/migrate/contentHeading/ContentHeading.vue +31 -0
- package/components/common/wizards/vm/migrate/models/enums.ts +6 -0
- package/components/common/wizards/vm/migrate/models/interfaces.ts +13 -0
- package/components/common/wizards/vm/migrate/models/types.ts +5 -0
- package/components/common/wizards/vm/migrate/select/storage/Storage.vue +136 -0
- package/components/common/wizards/vm/migrate/select/storage/config/tabsPannel.ts +18 -0
- package/components/common/wizards/vm/migrate/select/storage/configure/batch/Batch.vue +61 -0
- package/components/common/wizards/vm/migrate/select/storage/configure/disk/Disk.vue +73 -0
- package/components/common/wizards/vm/migrate/select/storage/diskFormat/DiskFormat.vue +68 -0
- package/components/common/wizards/vm/migrate/select/storage/diskFormat/config/formatOptions.ts +22 -0
- package/components/common/wizards/vm/migrate/select/storage/models/interfaces.ts +14 -0
- package/components/common/wizards/vm/migrate/select/storage/models/types.ts +3 -0
- package/components/common/wizards/vm/migrate/select/storage/policy/Policy.vue +83 -0
- package/components/common/wizards/vm/migrate/select/storage/selectedPerDisk/SelectedPerDisk.vue +84 -0
- package/components/common/wizards/vm/migrate/select/storage/table/datastore/Datastore.vue +105 -0
- package/components/common/wizards/vm/migrate/select/storage/table/datastore/config/config.ts +154 -0
- package/components/common/wizards/vm/migrate/select/storage/table/datastore/models/types.ts +15 -0
- package/components/common/wizards/vm/migrate/select/storage/table/disk/Disk.vue +73 -0
- package/components/common/wizards/vm/migrate/select/storage/table/disk/config/config.ts +102 -0
- package/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces.ts +9 -0
- package/components/common/wizards/vm/migrate/select/storage/table/disk/models/types.ts +9 -0
- package/components/common/wizards/vm/migrate/select/type/Type.vue +38 -0
- package/components/common/wizards/vm/migrate/select/type/config/typeOptions.ts +41 -0
- package/components/common/wizards/vm/migrate/select/type/models/interfaces.ts +5 -0
- package/components/common/wizards/vm/migrate/utils.ts +125 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UI_I_VerticalStepItem } from '~/components/atoms/models/interfaces'
|
|
2
|
-
import { UI_I_Localization } from '~/models/interfaces'
|
|
3
|
-
import {
|
|
1
|
+
import type { UI_I_VerticalStepItem } from '~/components/atoms/models/interfaces'
|
|
2
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
3
|
+
import type {
|
|
4
4
|
UI_T_WizardDatastoreMode,
|
|
5
5
|
UI_T_DatastoreType,
|
|
6
6
|
UI_T_NfsType,
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<td :id="tooltipTestId" class="sign-post">
|
|
3
|
+
<atoms-the-icon
|
|
4
|
+
id="help-tooltip-icon"
|
|
5
|
+
class="info-icon"
|
|
6
|
+
name="info-circle"
|
|
7
|
+
@click.stop="isShowFindHelp = !isShowFindHelp"
|
|
8
|
+
/>
|
|
9
|
+
|
|
10
|
+
<atoms-tooltip-signpost
|
|
11
|
+
v-if="isShowFindHelp"
|
|
12
|
+
:elem-id="tooltipTestId"
|
|
13
|
+
class="sign-post__content"
|
|
14
|
+
@hide="isShowFindHelp = false"
|
|
15
|
+
>
|
|
16
|
+
<slot name="content">
|
|
17
|
+
</slot>
|
|
18
|
+
</atoms-tooltip-signpost>
|
|
19
|
+
</td>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script lang="ts" setup>
|
|
23
|
+
// import type { UI_I_Localization } from 'bfg-common/models/interfaces'
|
|
24
|
+
|
|
25
|
+
const props = withDefaults(
|
|
26
|
+
defineProps<{
|
|
27
|
+
testId?: string
|
|
28
|
+
}>(),
|
|
29
|
+
{
|
|
30
|
+
testId: 'tooltip',
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
// const localization = computed<UI_I_Localization>(() => useLocal())
|
|
35
|
+
|
|
36
|
+
const tooltipTestId = computed<string>(
|
|
37
|
+
() => `${props.testId}-configure-navigation`
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
const isShowFindHelp = ref<boolean>(false)
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<style lang="scss" scoped>
|
|
44
|
+
@import 'bfg-common/assets/scss/common/mixins';
|
|
45
|
+
.sign-post {
|
|
46
|
+
padding-left: 6px;
|
|
47
|
+
margin-top: 5px;
|
|
48
|
+
&__content {
|
|
49
|
+
max-width: 350px;
|
|
50
|
+
}
|
|
51
|
+
&__alert {
|
|
52
|
+
:deep(.alert-items) {
|
|
53
|
+
padding: 3px 5px;
|
|
54
|
+
}
|
|
55
|
+
:deep(.alert-text) {
|
|
56
|
+
@include text($fs: 11px, $c: var(--global-font-color2));
|
|
57
|
+
margin-right: 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
&__title {
|
|
61
|
+
@include text($fs: 22px, $fw: 300, $c: var(--global-font-color));
|
|
62
|
+
}
|
|
63
|
+
&__desc {
|
|
64
|
+
@include text($fs: 14px, $fw: 400, $c: var(--global-font-color));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.info-icon {
|
|
68
|
+
width: 24px;
|
|
69
|
+
height: 24px;
|
|
70
|
+
fill: var(--dropdown-item-color);
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<atoms-table-info :items="props.readyCompleteTableInfo" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import type { UI_I_TableInfoItem } from 'bfg-common/components/atoms/table/info/models/interfaces'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
readyCompleteTableInfo: UI_I_TableInfoItem[]
|
|
12
|
+
}>()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<atoms-modal-by-steps
|
|
3
|
+
test-id="clone-vm-wizard"
|
|
4
|
+
:show="true"
|
|
5
|
+
:title="localization.migrate"
|
|
6
|
+
:step-items="stepItems"
|
|
7
|
+
:step-position="stepPosition"
|
|
8
|
+
:loading="loading"
|
|
9
|
+
class="migrate-vm"
|
|
10
|
+
@next="onNextStep"
|
|
11
|
+
@back="onBack"
|
|
12
|
+
@change-step="onChangeStep"
|
|
13
|
+
@finish="onFinish"
|
|
14
|
+
@hide="onHideModal"
|
|
15
|
+
>
|
|
16
|
+
<template #contentHeading><span /></template>
|
|
17
|
+
<template #modalBody="{ title, description }">
|
|
18
|
+
<div class="migrate-vm__wrapper">
|
|
19
|
+
<common-wizards-vm-migrate-content-heading
|
|
20
|
+
:title="title"
|
|
21
|
+
:description="description"
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<div class="migrate-vm__headline"></div>
|
|
25
|
+
<common-wizards-vm-migrate-select-type
|
|
26
|
+
v-show="currentBlockId === 'select-migration-type'"
|
|
27
|
+
v-model="vmMigrateType"
|
|
28
|
+
:project="props.project"
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
<common-wizards-vm-migrate-select-storage
|
|
32
|
+
v-show="currentBlockId === 'select-storage'"
|
|
33
|
+
:submit="selectStorageSubmit"
|
|
34
|
+
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
35
|
+
:datastore="props.datastore"
|
|
36
|
+
:connected-storage-id="connectedStorageIdOnVm"
|
|
37
|
+
:configure-per-disks="props.configurePerDisks"
|
|
38
|
+
@next-step="onSelectStorageAndNext"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<common-wizards-vm-common-ready-complete
|
|
43
|
+
v-if="currentBlockId === 'ready-complete'"
|
|
44
|
+
:ready-complete-table-info="dataReadyView"
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
</atoms-modal-by-steps>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script setup lang="ts">
|
|
51
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
52
|
+
import type { UI_T_Project } from '~/models/types'
|
|
53
|
+
import type { UI_I_TablePayload } from '~/models/store/interfaces'
|
|
54
|
+
import type { UI_I_DatastoreTableItem } from '~/models/store/storage/interfaces'
|
|
55
|
+
import type { UI_I_VmSettings } from '~/models/store/vm/interfaces'
|
|
56
|
+
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
57
|
+
import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces'
|
|
58
|
+
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
|
|
59
|
+
import type { UI_I_SelectStorageReadyData } from '~/components/common/wizards/vm/migrate/select/storage/models/interfaces'
|
|
60
|
+
import { UI_I_MigrateVerticalStepItem } from '~/components/common/wizards/vm/migrate/models/interfaces'
|
|
61
|
+
import { stepItemsFunc } from '~/components/common/wizards/vm/migrate/utils'
|
|
62
|
+
import { constructDataReadyViewFunc } from '~/components/common/wizards/vm/migrate/config/constructDataReady'
|
|
63
|
+
|
|
64
|
+
const props = defineProps<{
|
|
65
|
+
project: UI_T_Project
|
|
66
|
+
vmSettings: UI_I_VmSettings | null
|
|
67
|
+
vmName: string
|
|
68
|
+
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
69
|
+
datastore: UI_I_DatastoreTableItem[]
|
|
70
|
+
configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
|
|
71
|
+
readyCompleteTableInfo?: any // пока так потом если будет нужен изменит или удалить
|
|
72
|
+
finishFunc: any
|
|
73
|
+
}>()
|
|
74
|
+
|
|
75
|
+
const emits = defineEmits<{
|
|
76
|
+
(event: 'hide'): void
|
|
77
|
+
}>()
|
|
78
|
+
|
|
79
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
80
|
+
|
|
81
|
+
const stepPosition = ref<number>(0)
|
|
82
|
+
const loading = ref<boolean>(false)
|
|
83
|
+
|
|
84
|
+
const selectStorageSubmit = ref<number>(0)
|
|
85
|
+
|
|
86
|
+
const vmMigrateType = ref<UI_T_VmMigrateType>(
|
|
87
|
+
props.project === 'procurator' ? 'storage' : 'resource'
|
|
88
|
+
)
|
|
89
|
+
const dataReadyView = ref<UI_I_TableInfoItem[]>([])
|
|
90
|
+
|
|
91
|
+
const stepItems = computed<UI_I_MigrateVerticalStepItem[]>(() =>
|
|
92
|
+
stepItemsFunc(localization.value, vmMigrateType.value, props.project)
|
|
93
|
+
)
|
|
94
|
+
const currentBlockId = computed<string>(
|
|
95
|
+
() => stepItems.value[stepPosition.value].id
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
const connectedStorageIdOnVm = computed<string>(
|
|
99
|
+
() => props.vmSettings?.storage.id || ''
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
const onSelectStorageAndNext = (event: UI_I_SelectStorageReadyData): void => {
|
|
103
|
+
dataReadyView.value = constructDataReadyViewFunc<UI_I_SelectStorageReadyData>(
|
|
104
|
+
vmMigrateType.value,
|
|
105
|
+
props.vmName,
|
|
106
|
+
event
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
onNextStep(true)
|
|
110
|
+
}
|
|
111
|
+
const onFinish = (): void => {
|
|
112
|
+
loading.value = true
|
|
113
|
+
props.finishFunc().then(() => {
|
|
114
|
+
onHideModal()
|
|
115
|
+
loading.value = false
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
let cashStep = -1
|
|
120
|
+
const onNextStep = (force = false): void => {
|
|
121
|
+
const isValid = checkSubmit(force)
|
|
122
|
+
if (!isValid) return
|
|
123
|
+
|
|
124
|
+
const isDisabled = stepItems.value[cashStep]?.disabled
|
|
125
|
+
if (cashStep !== -1 && !isDisabled) {
|
|
126
|
+
stepPosition.value = cashStep
|
|
127
|
+
cashStep = -1
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
stepItems.value[stepPosition.value].complete = true
|
|
132
|
+
stepItems.value[stepPosition.value + 1].disabled = false
|
|
133
|
+
stepPosition.value++
|
|
134
|
+
}
|
|
135
|
+
const checkSubmit = (force = false): boolean => {
|
|
136
|
+
if (currentBlockId.value === 'select-storage' && !force) {
|
|
137
|
+
selectStorageSubmit.value++
|
|
138
|
+
return false
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return true
|
|
142
|
+
}
|
|
143
|
+
const onBack = (): void => {
|
|
144
|
+
stepPosition.value--
|
|
145
|
+
}
|
|
146
|
+
const onChangeStep = (key: number): void => {
|
|
147
|
+
if (key < stepPosition.value) {
|
|
148
|
+
stepPosition.value = key
|
|
149
|
+
return
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const isValid = checkSubmit()
|
|
153
|
+
if (!isValid) {
|
|
154
|
+
cashStep = key
|
|
155
|
+
return
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
stepPosition.value = key
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const onHideModal = (): void => {
|
|
162
|
+
emits('hide')
|
|
163
|
+
}
|
|
164
|
+
</script>
|
|
165
|
+
|
|
166
|
+
<style scoped lang="scss">
|
|
167
|
+
@import 'assets/scss/common/mixins.scss';
|
|
168
|
+
.migrate-vm {
|
|
169
|
+
&__wrapper {
|
|
170
|
+
@include flex($dir: column);
|
|
171
|
+
//height: 100%;
|
|
172
|
+
padding-left: 10px;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:deep(.has-solid.close-icon.clr-icon) {
|
|
177
|
+
width: 20px;
|
|
178
|
+
top: 0;
|
|
179
|
+
}
|
|
180
|
+
:deep(.modal .modal-dialog .modal-content .modal-footer) {
|
|
181
|
+
flex: unset;
|
|
182
|
+
height: unset;
|
|
183
|
+
min-height: unset;
|
|
184
|
+
}
|
|
185
|
+
:deep(.wizard-modal-titlebar h3) {
|
|
186
|
+
color: #000;
|
|
187
|
+
font-size: 24px;
|
|
188
|
+
font-weight: 200;
|
|
189
|
+
line-height: 27px;
|
|
190
|
+
margin: 0;
|
|
191
|
+
padding: 0;
|
|
192
|
+
}
|
|
193
|
+
:deep(.clr-wizard-stepnav-item) {
|
|
194
|
+
padding-left: 0;
|
|
195
|
+
}
|
|
196
|
+
:deep(.clr-wizard-stepnav
|
|
197
|
+
.clr-wizard-stepnav-item
|
|
198
|
+
button
|
|
199
|
+
.clr-wizard-stepnav-link-title) {
|
|
200
|
+
width: 189px;
|
|
201
|
+
font-weight: 700;
|
|
202
|
+
font-size: 13px;
|
|
203
|
+
}
|
|
204
|
+
</style>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
2
|
+
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
|
|
3
|
+
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
4
|
+
import { UI_E_VmMigrationType } from '~/components/common/wizards/vm/migrate/models/enums'
|
|
5
|
+
import { UI_I_MigrateReadyBlockData } from '~/components/common/wizards/vm/migrate/models/interfaces'
|
|
6
|
+
import { UI_I_SelectStorageReadyData } from '~/components/common/wizards/vm/migrate/select/storage/models/interfaces'
|
|
7
|
+
import { vmDiskFormatOptions } from '~/components/common/wizards/vm/migrate/select/storage/diskFormat/config/formatOptions'
|
|
8
|
+
|
|
9
|
+
const storageDetailsFunc = (
|
|
10
|
+
localization: UI_I_Localization,
|
|
11
|
+
migrationType: string,
|
|
12
|
+
name: string,
|
|
13
|
+
event: UI_I_SelectStorageReadyData
|
|
14
|
+
): UI_I_MigrateReadyBlockData[] => {
|
|
15
|
+
const isActivePerDiskTab: boolean = event.tab === 'configure-disk'
|
|
16
|
+
|
|
17
|
+
const diskFormat = vmDiskFormatOptions().find(
|
|
18
|
+
(file) => file.value === event.vmDiskFormat
|
|
19
|
+
)!
|
|
20
|
+
|
|
21
|
+
let result: UI_I_MigrateReadyBlockData[] = [
|
|
22
|
+
{
|
|
23
|
+
label: localization.migrationType,
|
|
24
|
+
value: migrationType,
|
|
25
|
+
permissions: ['batch-configure', 'configure-disk'],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: localization.virtualMachine,
|
|
29
|
+
value: name,
|
|
30
|
+
permissions: ['batch-configure', 'configure-disk'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: localization.storage,
|
|
34
|
+
value: event.storage?.name,
|
|
35
|
+
permissions: ['batch-configure'],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: localization.diskFormat,
|
|
39
|
+
value: diskFormat.text,
|
|
40
|
+
permissions: ['batch-configure'],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: localization.diskFormat,
|
|
44
|
+
value: diskFormat.text,
|
|
45
|
+
permissions: ['configure-disk'],
|
|
46
|
+
},
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
if (isActivePerDiskTab && event.configureDisks) {
|
|
50
|
+
const perDiskItems: UI_I_MigrateReadyBlockData[] = event.configureDisks.map(
|
|
51
|
+
(item) => ({
|
|
52
|
+
label: item.name,
|
|
53
|
+
value: `${item.file} ${item.disk_format}`,
|
|
54
|
+
permissions: ['configure-disk'],
|
|
55
|
+
isProperty: true,
|
|
56
|
+
})
|
|
57
|
+
)
|
|
58
|
+
result = result.concat(perDiskItems)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return result.filter((option) => option.permissions.includes(event.tab))
|
|
62
|
+
}
|
|
63
|
+
export const constructDataReadyViewFunc = <T>(
|
|
64
|
+
type: UI_T_VmMigrateType,
|
|
65
|
+
name: string,
|
|
66
|
+
data: T
|
|
67
|
+
): UI_I_TableInfoItem[] => {
|
|
68
|
+
const localization: UI_I_Localization = useLocal()
|
|
69
|
+
|
|
70
|
+
const details = {
|
|
71
|
+
storage: storageDetailsFunc,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const migrationType = localization[UI_E_VmMigrationType[type]]
|
|
75
|
+
|
|
76
|
+
return details[type as keyof typeof details](
|
|
77
|
+
localization,
|
|
78
|
+
migrationType,
|
|
79
|
+
name,
|
|
80
|
+
data
|
|
81
|
+
)
|
|
82
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="content-heading">
|
|
3
|
+
<div>
|
|
4
|
+
<h2>{{ props.title }}</h2>
|
|
5
|
+
<p>{{ props.description }}</p>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts" setup>
|
|
11
|
+
const props = defineProps<{
|
|
12
|
+
title: string
|
|
13
|
+
description: string
|
|
14
|
+
}>()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style lang="scss" scoped>
|
|
18
|
+
.content-heading {
|
|
19
|
+
padding: 0 15px 10px 0;
|
|
20
|
+
& > div {
|
|
21
|
+
padding-bottom: 3px;
|
|
22
|
+
border-bottom: 1px solid #a6a6a6;
|
|
23
|
+
h2 {
|
|
24
|
+
font-weight: 700;
|
|
25
|
+
font-size: 13px;
|
|
26
|
+
line-height: normal;
|
|
27
|
+
color: var(--add-vm-context-sub-title);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { UI_I_VerticalStepItem } from '~/components/atoms/models/interfaces'
|
|
2
|
+
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
|
|
3
|
+
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
4
|
+
import type { UI_T_VmMigrateSelectStorageTab } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
5
|
+
|
|
6
|
+
export interface UI_I_MigrateVerticalStepItem extends UI_I_VerticalStepItem {
|
|
7
|
+
id: string
|
|
8
|
+
permissions?: UI_T_VmMigrateType[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface UI_I_MigrateReadyBlockData extends UI_I_TableInfoItem {
|
|
12
|
+
permissions: UI_T_VmMigrateSelectStorageTab[]
|
|
13
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="select-storage">
|
|
3
|
+
<common-wizards-vm-migrate-select-storage-selected-per-disk
|
|
4
|
+
v-if="isShowSelectedPerDisks"
|
|
5
|
+
v-model="isShowSelectedPerDisks"
|
|
6
|
+
v-model:active-tab="activeTab"
|
|
7
|
+
:data="selectedPerDisks"
|
|
8
|
+
/>
|
|
9
|
+
|
|
10
|
+
<atoms-tabs
|
|
11
|
+
v-else
|
|
12
|
+
v-model="activeTab"
|
|
13
|
+
test-id="migrate-select-storage-tabs"
|
|
14
|
+
:items="selectStorageTabs"
|
|
15
|
+
size="small"
|
|
16
|
+
class="select-storage__tabs"
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<common-wizards-vm-migrate-select-storage-configure-batch
|
|
20
|
+
v-show="activeTab === 'batch-configure'"
|
|
21
|
+
v-model:vm-disk-format="dataLocal.vmDiskFormat"
|
|
22
|
+
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
23
|
+
:datastore="props.datastore"
|
|
24
|
+
:connected-storage-id="props.connectedStorageId"
|
|
25
|
+
@update-selected-datastore="dataLocal.storage = $event"
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
<common-wizards-vm-migrate-select-storage-configure-disk
|
|
29
|
+
v-show="activeTab === 'configure-disk'"
|
|
30
|
+
v-model="isShowSelectedPerDisks"
|
|
31
|
+
v-model:active-tab="activeTab"
|
|
32
|
+
:configure-per-disks="props.configurePerDisks"
|
|
33
|
+
@update-selected-per-disks="selectedPerDisks = $event"
|
|
34
|
+
/>
|
|
35
|
+
|
|
36
|
+
<div class="compatibility-wrap">
|
|
37
|
+
<p class="compatibility">
|
|
38
|
+
{{ localization.compatibility }}
|
|
39
|
+
</p>
|
|
40
|
+
<div class="compatibility-message flex-align-center">
|
|
41
|
+
<template v-if="dataLocal.storage">
|
|
42
|
+
<div class="icon-status-ok" />
|
|
43
|
+
<span>{{ localization.compatibilityChecksSucceeded }}</span>
|
|
44
|
+
</template>
|
|
45
|
+
<div v-else>
|
|
46
|
+
<br />
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script lang="ts" setup>
|
|
54
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
55
|
+
import type { UI_I_TablePayload } from '~/models/store/interfaces'
|
|
56
|
+
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/models/interfaces'
|
|
57
|
+
import type { UI_I_DatastoreTableItem } from '~/models/store/storage/interfaces'
|
|
58
|
+
import type { UI_T_VmMigrateSelectStorageTab } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
59
|
+
import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces'
|
|
60
|
+
import type {
|
|
61
|
+
UI_I_SelectStorageDataLocal,
|
|
62
|
+
UI_I_SelectStorageReadyData,
|
|
63
|
+
} from '~/components/common/wizards/vm/migrate/select/storage/models/interfaces'
|
|
64
|
+
import { vmMigrateSelectStorageTabsFunc } from '~/components/common/wizards/vm/migrate/select/storage/config/tabsPannel'
|
|
65
|
+
|
|
66
|
+
const props = defineProps<{
|
|
67
|
+
submit: number
|
|
68
|
+
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
69
|
+
datastore: UI_I_DatastoreTableItem[]
|
|
70
|
+
connectedStorageId: string | null
|
|
71
|
+
configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
|
|
72
|
+
}>()
|
|
73
|
+
const emits = defineEmits<{
|
|
74
|
+
(event: 'next-step', value: UI_I_SelectStorageReadyData): void
|
|
75
|
+
}>()
|
|
76
|
+
|
|
77
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
78
|
+
|
|
79
|
+
const activeTab = ref<UI_T_VmMigrateSelectStorageTab>('batch-configure')
|
|
80
|
+
const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
|
|
81
|
+
vmMigrateSelectStorageTabsFunc(localization.value)
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
// const selectedStorage = ref<UI_I_DatastoreTableItem | null>(null)
|
|
85
|
+
const isShowSelectedPerDisks = ref<boolean>(false)
|
|
86
|
+
const selectedPerDisks = ref<UI_I_StorageConfigurePerDiskItem[]>([])
|
|
87
|
+
|
|
88
|
+
const dataLocal = ref<UI_I_SelectStorageDataLocal>({
|
|
89
|
+
vmDiskFormat: 'same-format-source',
|
|
90
|
+
storage: null,
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
const checkValidityBlock = (): boolean => {
|
|
94
|
+
if (!dataLocal.value.storage) {
|
|
95
|
+
// const errorText = localization.value.nameCannotBeBlank
|
|
96
|
+
//
|
|
97
|
+
// showValidationErrors(errorText)
|
|
98
|
+
return false
|
|
99
|
+
}
|
|
100
|
+
const isActivePerDiskTab = activeTab.value === 'configure-disk'
|
|
101
|
+
emits('next-step', {
|
|
102
|
+
...dataLocal.value,
|
|
103
|
+
tab: activeTab.value,
|
|
104
|
+
...(isActivePerDiskTab && { configureDisks: props.configurePerDisks }),
|
|
105
|
+
})
|
|
106
|
+
return true
|
|
107
|
+
}
|
|
108
|
+
watch(
|
|
109
|
+
() => props.submit,
|
|
110
|
+
() => {
|
|
111
|
+
checkValidityBlock()
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<style lang="scss" scoped>
|
|
117
|
+
.select-storage {
|
|
118
|
+
&__tabs {
|
|
119
|
+
width: 100%;
|
|
120
|
+
:deep(.nav) {
|
|
121
|
+
margin-top: 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.compatibility-wrap {
|
|
127
|
+
padding-top: 10px;
|
|
128
|
+
|
|
129
|
+
.compatibility-message {
|
|
130
|
+
border: 1px solid #000;
|
|
131
|
+
padding-top: 5px;
|
|
132
|
+
padding-left: 5px;
|
|
133
|
+
overflow: auto;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
2
|
+
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/models/interfaces'
|
|
3
|
+
export const vmMigrateSelectStorageTabsFunc = (
|
|
4
|
+
localization: UI_I_Localization
|
|
5
|
+
): UI_I_CollapseNavItem[] => {
|
|
6
|
+
return [
|
|
7
|
+
{
|
|
8
|
+
text: localization.batchConfigure,
|
|
9
|
+
value: 'batch-configure',
|
|
10
|
+
disabled: false,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
text: localization.configurePerDisk,
|
|
14
|
+
value: 'configure-disk',
|
|
15
|
+
disabled: false,
|
|
16
|
+
},
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<common-wizards-vm-migrate-select-storage-disk-format
|
|
4
|
+
v-model:vm-disk-format="selectedVmDiskFormat"
|
|
5
|
+
/>
|
|
6
|
+
|
|
7
|
+
<common-wizards-vm-migrate-select-storage-policy />
|
|
8
|
+
|
|
9
|
+
<div class="clr-checkbox-wrapper flex-align-center w-100">
|
|
10
|
+
<input
|
|
11
|
+
id="suspend-on-revert"
|
|
12
|
+
v-model="isDisableStorageDrs"
|
|
13
|
+
type="checkbox"
|
|
14
|
+
class="checkbox-btn"
|
|
15
|
+
/>
|
|
16
|
+
<label for="suspend-on-revert" class="clr-control-label">
|
|
17
|
+
{{ localization.disableStorageDRSVirtualMachine }}
|
|
18
|
+
</label>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<common-wizards-vm-migrate-select-storage-table-datastore
|
|
22
|
+
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
23
|
+
:datastore="props.datastore"
|
|
24
|
+
:connected-storage-id="props.connectedStorageId"
|
|
25
|
+
@update-selected-datastore="emits('update-selected-datastore', $event)"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script lang="ts" setup>
|
|
31
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
32
|
+
import type { UI_I_TablePayload } from '~/models/store/interfaces'
|
|
33
|
+
import type { UI_I_DatastoreTableItem } from '~/models/store/storage/interfaces'
|
|
34
|
+
|
|
35
|
+
const props = defineProps<{
|
|
36
|
+
vmDiskFormat: string
|
|
37
|
+
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
38
|
+
datastore: UI_I_DatastoreTableItem[]
|
|
39
|
+
connectedStorageId: string | null
|
|
40
|
+
}>()
|
|
41
|
+
|
|
42
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
43
|
+
|
|
44
|
+
const isDisableStorageDrs = ref<boolean>(false)
|
|
45
|
+
|
|
46
|
+
const emits = defineEmits<{
|
|
47
|
+
(event: 'update-selected-datastore', value: UI_I_TablePayload): void
|
|
48
|
+
(event: 'update:vm-disk-format', value: string): void
|
|
49
|
+
}>()
|
|
50
|
+
|
|
51
|
+
const selectedVmDiskFormat = computed<string>({
|
|
52
|
+
get() {
|
|
53
|
+
return props.vmDiskFormat
|
|
54
|
+
},
|
|
55
|
+
set(newValue: string) {
|
|
56
|
+
emits('update:vm-disk-format', newValue)
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style lang="scss" scoped></style>
|