bfg-common 1.2.147 → 1.2.148
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/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
|
@@ -1,9 +1,51 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="select-network">
|
|
3
|
-
<common-wizards-vm-
|
|
3
|
+
<common-wizards-vm-migrate-select-network-table-disk
|
|
4
|
+
v-model="selected"
|
|
5
|
+
:type="tableType"
|
|
6
|
+
:data-table="[]"
|
|
7
|
+
/>
|
|
8
|
+
|
|
9
|
+
<div class="vm-migrate-advanced-view-button">
|
|
10
|
+
<button
|
|
11
|
+
class="btn btn-sm migrate-network-advanced-btn"
|
|
12
|
+
@click="isShowNetworkBasic = !isShowNetworkBasic"
|
|
13
|
+
>
|
|
14
|
+
<span v-if="isShowNetworkBasic"> ≪ </span>
|
|
15
|
+
{{ buttonText }}
|
|
16
|
+
<span v-if="!isShowNetworkBasic"> ≫ </span>
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<common-wizards-vm-common-validation-compatibility
|
|
21
|
+
:loading="false"
|
|
22
|
+
status="Success"
|
|
23
|
+
text="compatibilityChecksSucceeded"
|
|
24
|
+
/>
|
|
4
25
|
</div>
|
|
5
26
|
</template>
|
|
6
27
|
|
|
7
|
-
<script lang="ts" setup
|
|
28
|
+
<script lang="ts" setup>
|
|
29
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
30
|
+
|
|
31
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
32
|
+
|
|
33
|
+
const selected = ref<number[]>([])
|
|
34
|
+
const isShowNetworkBasic = ref<boolean>(false)
|
|
35
|
+
|
|
36
|
+
const buttonText = computed(
|
|
37
|
+
() => localization.value[isShowNetworkBasic.value ? 'basic' : 'advanced']
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
const tableType = computed<string>(() =>
|
|
41
|
+
isShowNetworkBasic.value ? 'basic' : 'advanced'
|
|
42
|
+
)
|
|
43
|
+
</script>
|
|
8
44
|
|
|
9
|
-
<style lang="scss" scoped
|
|
45
|
+
<style lang="scss" scoped>
|
|
46
|
+
.select-network {
|
|
47
|
+
.vm-migrate-advanced-view-button {
|
|
48
|
+
text-align: end;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-wrap">
|
|
3
|
+
<atoms-table-data-grid
|
|
4
|
+
v-model:selected-row="selectedRow"
|
|
5
|
+
v-model:column-keys="columnKeys"
|
|
6
|
+
v-model:page-size="pagination.pageSize"
|
|
7
|
+
v-model:page="pagination.page"
|
|
8
|
+
type="checkbox"
|
|
9
|
+
:head-items="headItems"
|
|
10
|
+
:body-items="bodyItems"
|
|
11
|
+
:total-items="bodyItems.length"
|
|
12
|
+
:total-pages="1"
|
|
13
|
+
server-off
|
|
14
|
+
hide-footer
|
|
15
|
+
hide-page-size
|
|
16
|
+
@sorting="sorting"
|
|
17
|
+
>
|
|
18
|
+
</atoms-table-data-grid>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script lang="ts" setup>
|
|
23
|
+
import type { UI_I_Pagination, UI_I_Localization } from '~/models/interfaces'
|
|
24
|
+
import type {
|
|
25
|
+
UI_I_ColumnKey,
|
|
26
|
+
UI_I_HeadItem,
|
|
27
|
+
UI_I_BodyItem,
|
|
28
|
+
} from '~/components/atoms/table/dataGrid/models/interfaces'
|
|
29
|
+
import * as basicTable from '~/components/common/wizards/vm/migrate/select/network/table/disk/config/basicTable'
|
|
30
|
+
import * as advancedTable from '~/components/common/wizards/vm/migrate/select/network/table/disk/config/advancedTable'
|
|
31
|
+
|
|
32
|
+
const props = defineProps<{
|
|
33
|
+
modelValue: number[]
|
|
34
|
+
dataTable: any[]
|
|
35
|
+
type: 'basic' | 'advanced'
|
|
36
|
+
}>()
|
|
37
|
+
const emits = defineEmits<{
|
|
38
|
+
(event: 'update:model-value', value: number[] | null): void
|
|
39
|
+
}>()
|
|
40
|
+
|
|
41
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
42
|
+
|
|
43
|
+
const table: any = {
|
|
44
|
+
basic: basicTable,
|
|
45
|
+
advanced: advancedTable,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
49
|
+
table[props.type].headItems(localization.value)
|
|
50
|
+
)
|
|
51
|
+
const columnKeys = computed<UI_I_ColumnKey[]>(() =>
|
|
52
|
+
table[props.type].columnKeys(localization.value)
|
|
53
|
+
)
|
|
54
|
+
watch(localization, () => {
|
|
55
|
+
columnKeys.value = table[props.type].columnKeys(localization.value)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
59
|
+
return table[props.type].bodyItems(props.dataTable)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const sort = ref<string | null>(null)
|
|
63
|
+
const pagination = ref<UI_I_Pagination>({
|
|
64
|
+
page: 1,
|
|
65
|
+
pageSize: 100,
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const sorting = (data: [string, boolean]): void => {
|
|
69
|
+
const [column, status] = data
|
|
70
|
+
const direction = status ? 'asc' : 'desc'
|
|
71
|
+
sort.value = `${column}.${direction}`
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const selectedRow = computed<number[]>({
|
|
75
|
+
get() {
|
|
76
|
+
return props.modelValue
|
|
77
|
+
},
|
|
78
|
+
set(newValue: number[]) {
|
|
79
|
+
emits('update:model-value', newValue)
|
|
80
|
+
},
|
|
81
|
+
})
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<style lang="scss" scoped></style>
|
package/components/common/wizards/vm/migrate/select/network/table/disk/config/advancedTable.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_ColumnKey,
|
|
3
|
+
UI_I_HeadItem,
|
|
4
|
+
UI_I_BodyItem,
|
|
5
|
+
} from '~/components/atoms/table/dataGrid/models/interfaces'
|
|
6
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
7
|
+
import {
|
|
8
|
+
constructColumnKey,
|
|
9
|
+
constructHeadItem,
|
|
10
|
+
} from '~/components/atoms/table/dataGrid/utils/constructDataTable'
|
|
11
|
+
import { networkAdvancedTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/disk/config/tableKeys'
|
|
12
|
+
|
|
13
|
+
const getItems = (
|
|
14
|
+
localization: UI_I_Localization
|
|
15
|
+
): [string, boolean, string, string][] => {
|
|
16
|
+
return [
|
|
17
|
+
[localization.vm, true, '25%', networkAdvancedTableItemKeys[0]],
|
|
18
|
+
[localization.networkAdapter, true, '25%', networkAdvancedTableItemKeys[1]],
|
|
19
|
+
[localization.sourceNetwork, true, '25%', networkAdvancedTableItemKeys[2]],
|
|
20
|
+
[
|
|
21
|
+
localization.destinationNetwork,
|
|
22
|
+
true,
|
|
23
|
+
'25%',
|
|
24
|
+
networkAdvancedTableItemKeys[3],
|
|
25
|
+
],
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const columnKeys = (
|
|
30
|
+
localization: UI_I_Localization
|
|
31
|
+
): UI_I_ColumnKey[] => {
|
|
32
|
+
const result: UI_I_ColumnKey[] = []
|
|
33
|
+
getItems(localization).forEach((item, i) => {
|
|
34
|
+
const col = `col${i}`
|
|
35
|
+
result.push(constructColumnKey(col, item[0], item[1]))
|
|
36
|
+
})
|
|
37
|
+
return result
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
41
|
+
const result: UI_I_HeadItem[] = []
|
|
42
|
+
getItems(localization).forEach((item, i) => {
|
|
43
|
+
const col = `col${i}`
|
|
44
|
+
result.push(constructHeadItem(col, item[0], item[3], true, item[2]))
|
|
45
|
+
})
|
|
46
|
+
return result
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const bodyItems = (data: any[]): UI_I_BodyItem[][] => {
|
|
50
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
51
|
+
|
|
52
|
+
data.forEach((storage: any, key: number) => {
|
|
53
|
+
bodyItems.push([
|
|
54
|
+
{
|
|
55
|
+
key: 'col0',
|
|
56
|
+
text: storage[networkAdvancedTableItemKeys[0]],
|
|
57
|
+
id: key,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: 'col1',
|
|
61
|
+
text: storage[networkAdvancedTableItemKeys[1]],
|
|
62
|
+
id: key,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: 'col2',
|
|
66
|
+
text: storage[networkAdvancedTableItemKeys[2]],
|
|
67
|
+
id: key,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: 'col3',
|
|
71
|
+
text: storage[networkAdvancedTableItemKeys[3]],
|
|
72
|
+
id: key,
|
|
73
|
+
},
|
|
74
|
+
])
|
|
75
|
+
})
|
|
76
|
+
return bodyItems
|
|
77
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_ColumnKey,
|
|
3
|
+
UI_I_HeadItem,
|
|
4
|
+
UI_I_BodyItem,
|
|
5
|
+
} from '~/components/atoms/table/dataGrid/models/interfaces'
|
|
6
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
7
|
+
import {
|
|
8
|
+
constructColumnKey,
|
|
9
|
+
constructHeadItem,
|
|
10
|
+
} from '~/components/atoms/table/dataGrid/utils/constructDataTable'
|
|
11
|
+
import { networkBasicsTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/disk/config/tableKeys'
|
|
12
|
+
|
|
13
|
+
const getItems = (
|
|
14
|
+
localization: UI_I_Localization
|
|
15
|
+
): [string, boolean, string, string][] => {
|
|
16
|
+
return [
|
|
17
|
+
[localization.sourceNetwork, true, '33.3%', networkBasicsTableItemKeys[0]],
|
|
18
|
+
[localization.usedBy, true, '33.3%', networkBasicsTableItemKeys[1]],
|
|
19
|
+
[
|
|
20
|
+
localization.destinationNetwork,
|
|
21
|
+
true,
|
|
22
|
+
'33.3%',
|
|
23
|
+
networkBasicsTableItemKeys[2],
|
|
24
|
+
],
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const columnKeys = (
|
|
29
|
+
localization: UI_I_Localization
|
|
30
|
+
): UI_I_ColumnKey[] => {
|
|
31
|
+
const result: UI_I_ColumnKey[] = []
|
|
32
|
+
getItems(localization).forEach((item, i) => {
|
|
33
|
+
const col = `col${i}`
|
|
34
|
+
result.push(constructColumnKey(col, item[0], item[1]))
|
|
35
|
+
})
|
|
36
|
+
return result
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
40
|
+
const result: UI_I_HeadItem[] = []
|
|
41
|
+
getItems(localization).forEach((item, i) => {
|
|
42
|
+
const col = `col${i}`
|
|
43
|
+
result.push(constructHeadItem(col, item[0], item[3], true, item[2]))
|
|
44
|
+
})
|
|
45
|
+
return result
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const bodyItems = (data: any[]): UI_I_BodyItem[][] => {
|
|
49
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
50
|
+
|
|
51
|
+
data.forEach((storage: any, key: number) => {
|
|
52
|
+
bodyItems.push([
|
|
53
|
+
{
|
|
54
|
+
key: 'col0',
|
|
55
|
+
text: storage[networkBasicsTableItemKeys[0]],
|
|
56
|
+
id: key,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: 'col1',
|
|
60
|
+
text: storage[networkBasicsTableItemKeys[1]],
|
|
61
|
+
id: key,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
key: 'col2',
|
|
65
|
+
text: storage[networkBasicsTableItemKeys[2]],
|
|
66
|
+
id: key,
|
|
67
|
+
},
|
|
68
|
+
])
|
|
69
|
+
})
|
|
70
|
+
return bodyItems
|
|
71
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_T_NetworkBasicsTableTableKeysTuple,
|
|
3
|
+
UI_T_NetworkAdvancedTableKeysTuple,
|
|
4
|
+
} from '~/components/common/wizards/vm/migrate/select/network/table/disk/models/types'
|
|
5
|
+
|
|
6
|
+
export const networkBasicsTableItemKeys: UI_T_NetworkBasicsTableTableKeysTuple =
|
|
7
|
+
['source_network', 'used_by', 'destination_network']
|
|
8
|
+
|
|
9
|
+
export const networkAdvancedTableItemKeys: UI_T_NetworkAdvancedTableKeysTuple =
|
|
10
|
+
['vm_name', 'network_adapter', 'source_network', 'destination_network']
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
<script lang="ts" setup>
|
|
11
11
|
import type { UI_I_Localization } from '~/models/interfaces'
|
|
12
12
|
import type { UI_I_RadioOption } from '~/components/common/select/radio/models/interfaces'
|
|
13
|
+
import type { UI_T_SelectVMotionPriority } from '~/components/common/wizards/vm/migrate/select/priority/models/types'
|
|
13
14
|
import { vmMigrateSelectPriorityTypesFunc } from '~/components/common/wizards/vm/migrate/select/priority/config/typeOptions'
|
|
14
15
|
|
|
15
16
|
const props = defineProps<{
|
|
16
|
-
modelValue:
|
|
17
|
+
modelValue: UI_T_SelectVMotionPriority
|
|
17
18
|
}>()
|
|
18
19
|
const emits = defineEmits<{
|
|
19
|
-
(event: 'update:model-value', value:
|
|
20
|
+
(event: 'update:model-value', value: UI_T_SelectVMotionPriority): void
|
|
20
21
|
}>()
|
|
21
22
|
|
|
22
23
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
@@ -25,11 +26,11 @@ const vmMigrationPriorityTypes = computed<UI_I_RadioOption[]>(() =>
|
|
|
25
26
|
vmMigrateSelectPriorityTypesFunc(localization.value)
|
|
26
27
|
)
|
|
27
28
|
|
|
28
|
-
const selectedPriorityType = computed<
|
|
29
|
+
const selectedPriorityType = computed<UI_T_SelectVMotionPriority>({
|
|
29
30
|
get() {
|
|
30
31
|
return props.modelValue
|
|
31
32
|
},
|
|
32
|
-
set(newValue:
|
|
33
|
+
set(newValue: UI_T_SelectVMotionPriority) {
|
|
33
34
|
emits('update:model-value', newValue)
|
|
34
35
|
},
|
|
35
36
|
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type UI_T_SelectVMotionPriority = 'high-priority' | 'schedule-normal'
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
v-if="isShowSelectedPerDisks"
|
|
5
5
|
v-model="isShowSelectedPerDisks"
|
|
6
6
|
v-model:active-tab="activeTab"
|
|
7
|
+
v-model:connected-storage-id-local="connectedStorageIdLocal"
|
|
7
8
|
:data="selectedPerDisks"
|
|
8
9
|
/>
|
|
9
10
|
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
:items="selectStorageTabs"
|
|
15
16
|
size="small"
|
|
16
17
|
class="select-storage__tabs"
|
|
18
|
+
@change="onChangeMigrateMode"
|
|
17
19
|
/>
|
|
18
20
|
|
|
19
21
|
<common-wizards-vm-migrate-select-storage-configure-batch
|
|
@@ -21,20 +23,29 @@
|
|
|
21
23
|
v-model:vm-disk-format="dataLocal.vmDiskFormat"
|
|
22
24
|
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
23
25
|
:datastore="props.datastore"
|
|
24
|
-
:connected-storage-id="
|
|
26
|
+
:connected-storage-id="connectedStorageId"
|
|
25
27
|
@update-selected-datastore="dataLocal.storage = $event"
|
|
26
|
-
|
|
28
|
+
>
|
|
29
|
+
<template v-if="isShowSelectedPerDisks" #buttonConfirm>
|
|
30
|
+
<button class="btn btn-sm btn-primary" @click="onApplyChanges">
|
|
31
|
+
{{ localization.confirm }}
|
|
32
|
+
</button>
|
|
33
|
+
</template>
|
|
34
|
+
</common-wizards-vm-migrate-select-storage-configure-batch>
|
|
27
35
|
|
|
28
36
|
<common-wizards-vm-migrate-select-storage-configure-disk
|
|
29
37
|
v-show="activeTab === 'configure-disk'"
|
|
30
38
|
v-model="isShowSelectedPerDisks"
|
|
39
|
+
v-model:selected-per-disk-keys="selectedPerDiskKeys"
|
|
31
40
|
v-model:active-tab="activeTab"
|
|
32
|
-
:configure-per-disks="
|
|
33
|
-
@update-selected-per-disks="
|
|
41
|
+
:configure-per-disks="configurePerDisksLocal"
|
|
42
|
+
@update-selected-per-disks="onChangePerDiskStorage"
|
|
34
43
|
/>
|
|
35
44
|
|
|
36
45
|
<common-wizards-vm-common-validation-compatibility
|
|
37
46
|
:loading="!dataLocal.storage"
|
|
47
|
+
:status="'Success'"
|
|
48
|
+
text="compatibilityChecksSucceeded"
|
|
38
49
|
/>
|
|
39
50
|
</div>
|
|
40
51
|
</template>
|
|
@@ -56,7 +67,7 @@ const props = defineProps<{
|
|
|
56
67
|
submit: number
|
|
57
68
|
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
58
69
|
datastore: UI_I_DatastoreTableItem[]
|
|
59
|
-
|
|
70
|
+
connectedStorageIdDefault: string | null
|
|
60
71
|
configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
|
|
61
72
|
}>()
|
|
62
73
|
const emits = defineEmits<{
|
|
@@ -72,8 +83,54 @@ const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
|
|
|
72
83
|
|
|
73
84
|
// const selectedStorage = ref<UI_I_DatastoreTableItem | null>(null)
|
|
74
85
|
const isShowSelectedPerDisks = ref<boolean>(false)
|
|
86
|
+
|
|
87
|
+
const selectedPerDiskKeys = ref<number[]>([])
|
|
75
88
|
const selectedPerDisks = ref<UI_I_StorageConfigurePerDiskItem[]>([])
|
|
76
89
|
|
|
90
|
+
const configurePerDisksLocal = ref<UI_I_StorageConfigurePerDiskItem[]>(
|
|
91
|
+
props.configurePerDisks
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
const connectedStorageIdLocal = ref<string>('')
|
|
95
|
+
const connectedStorageId = computed<string | null>(
|
|
96
|
+
() => connectedStorageIdLocal.value || props.connectedStorageIdDefault
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
const onChangeMigrateMode = (event: string): void => {
|
|
100
|
+
if (event === 'batch-configure') {
|
|
101
|
+
connectedStorageIdLocal.value = ''
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const onChangePerDiskStorage = (
|
|
105
|
+
event: UI_I_StorageConfigurePerDiskItem[]
|
|
106
|
+
): void => {
|
|
107
|
+
connectedStorageIdLocal.value = event[0].extra.datastore_id
|
|
108
|
+
|
|
109
|
+
selectedPerDisks.value = event
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const onApplyChanges = (): void => {
|
|
113
|
+
/* TODO сделать рефакторинг потом */
|
|
114
|
+
configurePerDisksLocal.value.forEach((disk) => {
|
|
115
|
+
const selectedDisk = selectedPerDisks.value.find(
|
|
116
|
+
(selected) =>
|
|
117
|
+
selected.virtual_machine === disk.virtual_machine &&
|
|
118
|
+
selected.file === disk.file &&
|
|
119
|
+
selected.extra.datastore_id === disk.extra.datastore_id
|
|
120
|
+
)!
|
|
121
|
+
|
|
122
|
+
if (selectedDisk) {
|
|
123
|
+
;({ name: disk.storage, id: disk.extra.datastore_id } =
|
|
124
|
+
dataLocal.value.storage)
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
isShowSelectedPerDisks.value = false
|
|
129
|
+
activeTab.value = 'configure-disk'
|
|
130
|
+
selectedPerDisks.value = []
|
|
131
|
+
selectedPerDiskKeys.value = []
|
|
132
|
+
}
|
|
133
|
+
|
|
77
134
|
const dataLocal = ref<UI_I_SelectStorageDataLocal>({
|
|
78
135
|
vmDiskFormat: 'same-format-source',
|
|
79
136
|
storage: null,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
2
|
+
<div class="configure-batch-mode">
|
|
3
3
|
<common-wizards-vm-migrate-select-storage-disk-format
|
|
4
4
|
v-model:vm-disk-format="selectedVmDiskFormat"
|
|
5
5
|
/>
|
|
6
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
|
|
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
20
|
|
|
21
21
|
<common-wizards-vm-migrate-select-storage-table-datastore
|
|
22
22
|
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
@@ -24,6 +24,13 @@
|
|
|
24
24
|
:connected-storage-id="props.connectedStorageId"
|
|
25
25
|
@update-selected-datastore="emits('update-selected-datastore', $event)"
|
|
26
26
|
/>
|
|
27
|
+
|
|
28
|
+
<div
|
|
29
|
+
v-if="$slots.buttonConfirm"
|
|
30
|
+
class="clr-justify-content-end configure-batch-mode__button"
|
|
31
|
+
>
|
|
32
|
+
<slot name="buttonConfirm"></slot>
|
|
33
|
+
</div>
|
|
27
34
|
</div>
|
|
28
35
|
</template>
|
|
29
36
|
|
|
@@ -41,7 +48,7 @@ const props = defineProps<{
|
|
|
41
48
|
|
|
42
49
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
43
50
|
|
|
44
|
-
const isDisableStorageDrs = ref<boolean>(false)
|
|
51
|
+
// const isDisableStorageDrs = ref<boolean>(false)
|
|
45
52
|
|
|
46
53
|
const emits = defineEmits<{
|
|
47
54
|
(event: 'update-selected-datastore', value: UI_I_TablePayload): void
|
|
@@ -58,4 +65,10 @@ const selectedVmDiskFormat = computed<string>({
|
|
|
58
65
|
})
|
|
59
66
|
</script>
|
|
60
67
|
|
|
61
|
-
<style lang="scss" scoped
|
|
68
|
+
<style lang="scss" scoped>
|
|
69
|
+
.configure-batch-mode {
|
|
70
|
+
&__button {
|
|
71
|
+
display: flex;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
14
|
<common-wizards-vm-migrate-select-storage-table-disk
|
|
15
|
-
v-model:selected-per-disk="
|
|
15
|
+
v-model:selected-per-disk="selectedPerDiskKeysLocal"
|
|
16
16
|
:configure-per-disks="props.configurePerDisks"
|
|
17
17
|
/>
|
|
18
18
|
</div>
|
|
@@ -25,11 +25,13 @@ import type { UI_T_VmMigrateSelectStorageTab } from '~/components/common/wizards
|
|
|
25
25
|
|
|
26
26
|
const props = defineProps<{
|
|
27
27
|
modelValue: boolean
|
|
28
|
+
selectedPerDiskKeys: number[]
|
|
28
29
|
configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
|
|
29
30
|
activeTab: UI_T_VmMigrateSelectStorageTab
|
|
30
31
|
}>()
|
|
31
32
|
const emits = defineEmits<{
|
|
32
33
|
(event: 'update:model-value', value: boolean): void
|
|
34
|
+
(event: 'update:selected-per-disk-keys', value: number[]): void
|
|
33
35
|
(
|
|
34
36
|
event: 'update-selected-per-disks',
|
|
35
37
|
value: UI_I_StorageConfigurePerDiskItem[]
|
|
@@ -39,13 +41,12 @@ const emits = defineEmits<{
|
|
|
39
41
|
|
|
40
42
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
41
43
|
|
|
42
|
-
const selectedPerDiskKeys = ref<number[]>([])
|
|
43
44
|
const selectedDisksFromTable = computed<UI_I_StorageConfigurePerDiskItem[]>(
|
|
44
45
|
() => {
|
|
45
46
|
if (!props.configurePerDisks) return []
|
|
46
47
|
|
|
47
48
|
return props.configurePerDisks.filter((_: never, key: number) =>
|
|
48
|
-
|
|
49
|
+
selectedPerDiskKeysLocal.value.includes(key)
|
|
49
50
|
)
|
|
50
51
|
}
|
|
51
52
|
)
|
|
@@ -56,6 +57,15 @@ const onConfigure = (): void => {
|
|
|
56
57
|
activeTabValue.value = 'batch-configure'
|
|
57
58
|
}
|
|
58
59
|
|
|
60
|
+
const selectedPerDiskKeysLocal = computed<number[]>({
|
|
61
|
+
get(): number[] {
|
|
62
|
+
return props.selectedPerDiskKeys
|
|
63
|
+
},
|
|
64
|
+
set(newValue: number[]) {
|
|
65
|
+
emits('update:selected-per-disk-keys', newValue)
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
|
|
59
69
|
const activeTabValue = computed<UI_T_VmMigrateSelectStorageTab>({
|
|
60
70
|
get() {
|
|
61
71
|
return props.activeTab
|
package/components/common/wizards/vm/migrate/select/storage/selectedPerDisk/SelectedPerDisk.vue
CHANGED
|
@@ -34,21 +34,24 @@ import type { UI_T_VmMigrateSelectStorageTab } from '~/components/common/wizards
|
|
|
34
34
|
const props = defineProps<{
|
|
35
35
|
modelValue: boolean
|
|
36
36
|
activeTab: UI_T_VmMigrateSelectStorageTab
|
|
37
|
+
connectedStorageIdLocal: string
|
|
37
38
|
data: any[]
|
|
38
39
|
}>()
|
|
39
40
|
const emits = defineEmits<{
|
|
40
41
|
(event: 'update:model-value', value: boolean): void
|
|
41
42
|
(event: 'update:active-tab', value: UI_T_VmMigrateSelectStorageTab): void
|
|
43
|
+
(event: 'update:connected-storage-id-local', value: string): void
|
|
42
44
|
}>()
|
|
43
45
|
|
|
44
46
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
45
47
|
|
|
46
48
|
const normalizedData = computed<string[]>(() =>
|
|
47
|
-
props.data.map((item) => `${item.
|
|
49
|
+
props.data.map((item) => `${item.virtual_machine} | ${item.file}`)
|
|
48
50
|
)
|
|
49
51
|
|
|
50
52
|
const onGoBack = (): void => {
|
|
51
53
|
emits('update:model-value', false)
|
|
54
|
+
emits('update:connected-storage-id-local', '')
|
|
52
55
|
activeTabValue.value = 'configure-disk'
|
|
53
56
|
}
|
|
54
57
|
|
|
@@ -56,7 +59,7 @@ const activeTabValue = computed<UI_T_VmMigrateSelectStorageTab>({
|
|
|
56
59
|
get() {
|
|
57
60
|
return props.activeTab
|
|
58
61
|
},
|
|
59
|
-
set(newValue:
|
|
62
|
+
set(newValue: UI_T_VmMigrateSelectStorageTab) {
|
|
60
63
|
emits('update:active-tab', newValue)
|
|
61
64
|
},
|
|
62
65
|
})
|
|
@@ -81,8 +81,8 @@ const getStorage = async (): Promise<void> => {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
props.getDatastoreTableFunc(payload).then(() => {
|
|
84
|
-
selectedStorageKey.value = null
|
|
85
|
-
setStorageFromProps()
|
|
84
|
+
// selectedStorageKey.value = null
|
|
85
|
+
// setStorageFromProps()
|
|
86
86
|
})
|
|
87
87
|
}
|
|
88
88
|
getStorage()
|
|
@@ -100,6 +100,14 @@ const setStorageFromProps = (): void => {
|
|
|
100
100
|
if (item.id === props.connectedStorageId) changeStorage(index)
|
|
101
101
|
})
|
|
102
102
|
}
|
|
103
|
+
|
|
104
|
+
watch(
|
|
105
|
+
() => props.connectedStorageId,
|
|
106
|
+
(newValue) => {
|
|
107
|
+
if (!props.datastore.length || !newValue) return
|
|
108
|
+
setStorageFromProps()
|
|
109
|
+
}
|
|
110
|
+
)
|
|
103
111
|
</script>
|
|
104
112
|
|
|
105
113
|
<style lang="scss" scoped></style>
|