bfg-common 1.4.114 → 1.4.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/common/select/input/lib/models/interfaces.ts +1 -0
- package/components/common/wizards/vmNew/common/computeResource/TreeView.vue +61 -0
- package/components/common/wizards/vmNew/common/tooltip/Tooltip.vue +84 -0
- package/components/common/wizards/vmNew/common/validation/compatibility/Compatibility.vue +62 -0
- package/components/common/wizards/vmNew/common/validation/lib/models/enums.ts +5 -0
- package/components/common/wizards/vmNew/migrate/Migrate.vue +231 -0
- package/components/common/wizards/vmNew/migrate/lib/config/constructDataReady.ts +83 -0
- package/components/common/wizards/vmNew/migrate/lib/config/steps.ts +82 -0
- package/components/common/wizards/vmNew/migrate/lib/models/enums.ts +6 -0
- package/components/common/wizards/vmNew/migrate/lib/models/interfaces.ts +38 -0
- package/components/common/wizards/vmNew/migrate/lib/utils.ts +0 -0
- package/components/common/wizards/vmNew/migrate/lib/validations.ts +29 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/ComputeResource.vue +219 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/lib/config/tabsPannel.ts +28 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/lib/models/enums.ts +6 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/lib/models/interfaces.ts +30 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/lib/models/types.ts +12 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/TableView.vue +143 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/config/clusterTable.ts +113 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/config/hostTable.ts +124 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/config/resourcePoolTable.ts +115 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/config/tableKeys.ts +65 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/config/vappsTable.ts +66 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/models/interfaces.ts +50 -0
- package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/models/types.ts +60 -0
- package/components/common/wizards/vmNew/migrate/select/network/Network.vue +125 -0
- package/components/common/wizards/vmNew/migrate/select/network/table/network/Network.vue +114 -0
- package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/config/advancedTable.ts +78 -0
- package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/config/basicTable.ts +70 -0
- package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/config/tableKeys.ts +13 -0
- package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/models/interfaces.ts +12 -0
- package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/models/types.ts +21 -0
- package/components/common/wizards/vmNew/migrate/select/network/table/useAt/UseAt.vue +54 -0
- package/components/common/wizards/vmNew/migrate/select/network/table/useAt/lib/config/tableKeys.ts +7 -0
- package/components/common/wizards/vmNew/migrate/select/network/table/useAt/lib/config/useAtTable.ts +47 -0
- package/components/common/wizards/vmNew/migrate/select/network/table/useAt/lib/models/interfaces.ts +1 -0
- package/components/common/wizards/vmNew/migrate/select/network/table/useAt/lib/models/types.ts +5 -0
- package/components/common/wizards/vmNew/migrate/select/priority/Priority.vue +39 -0
- package/components/common/wizards/vmNew/migrate/select/priority/lib/config/typeOptions.ts +21 -0
- package/components/common/wizards/vmNew/migrate/select/priority/lib/models/types.ts +1 -0
- package/components/common/wizards/vmNew/migrate/select/storage/Storage.vue +201 -0
- package/components/common/wizards/vmNew/migrate/select/storage/configure/batch/Batch.vue +58 -0
- package/components/common/wizards/vmNew/migrate/select/storage/configure/batch/config/virtualDiskFormat.ts +30 -0
- package/components/common/wizards/vmNew/migrate/select/storage/configure/batch/table/Table.vue +118 -0
- package/components/common/wizards/vmNew/migrate/select/storage/configure/batch/table/lib/config/datastoreTable.ts +177 -0
- package/components/common/wizards/vmNew/migrate/select/storage/configure/batch/table/lib/models/types.ts +15 -0
- package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/Disk.vue +68 -0
- package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/table/Table.vue +74 -0
- package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/table/lib/config/diskTable.ts +135 -0
- package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/table/lib/config/tableKeys.ts +15 -0
- package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/table/lib/models/interfaces.ts +24 -0
- package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/table/lib/models/types.ts +13 -0
- package/components/common/wizards/vmNew/migrate/select/storage/lib/config/tabsPannel.ts +20 -0
- package/components/common/wizards/vmNew/migrate/select/storage/lib/models/enums.ts +6 -0
- package/components/common/wizards/vmNew/migrate/select/storage/lib/models/interfaces.ts +14 -0
- package/components/common/wizards/vmNew/migrate/select/storage/lib/models/types.ts +9 -0
- package/components/common/wizards/vmNew/migrate/select/storage/policy/Policy.vue +84 -0
- package/components/common/wizards/vmNew/migrate/select/storage/selectedPerDisk/SelectedPerDisk.vue +80 -0
- package/components/common/wizards/vmNew/migrate/select/targetServer/lib/config/tabsPannel.ts +18 -0
- package/components/common/wizards/vmNew/migrate/select/targetServer/lib/models/types.ts +1 -0
- package/components/common/wizards/vmNew/migrate/select/targetServer/new/New.vue +294 -0
- package/components/common/wizards/vmNew/migrate/select/targetServer/new/lib/config/defaultForm.ts +36 -0
- package/components/common/wizards/vmNew/migrate/select/targetServer/new/lib/models/interfaces.ts +13 -0
- package/components/common/wizards/vmNew/migrate/select/targetServer/saved/Saved.vue +27 -0
- package/components/common/wizards/vmNew/migrate/select/targetServer/targetServer.vue +41 -0
- package/components/common/wizards/vmNew/migrate/select/type/Type.vue +27 -0
- package/components/common/wizards/vmNew/migrate/select/type/lib/config/typeOptions.ts +41 -0
- package/components/common/wizards/vmNew/migrate/select/type/lib/models/interfaces.ts +5 -0
- package/components/common/wizards/vmNew/migrate/select/type/lib/models/types.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-wrap">
|
|
3
|
+
<atoms-table-data-grid
|
|
4
|
+
v-model:selected-row="selectedNetworkLocal"
|
|
5
|
+
v-model:column-keys="columnKeys"
|
|
6
|
+
v-model:page-size="pagination.pageSize"
|
|
7
|
+
v-model:page="pagination.page"
|
|
8
|
+
:head-items="headItems"
|
|
9
|
+
:body-items="bodyItems"
|
|
10
|
+
:total-items="bodyItems.length"
|
|
11
|
+
:total-pages="1"
|
|
12
|
+
class="select-network"
|
|
13
|
+
test-id="network-table"
|
|
14
|
+
:off-select-by-row="props.type === 'advanced'"
|
|
15
|
+
server-off
|
|
16
|
+
hide-footer
|
|
17
|
+
hide-page-size
|
|
18
|
+
>
|
|
19
|
+
<template #select="{ item }">
|
|
20
|
+
<span class="select select-network__select">
|
|
21
|
+
<select
|
|
22
|
+
:id="item.data.id"
|
|
23
|
+
v-model="item.data.value"
|
|
24
|
+
data-id="network-select"
|
|
25
|
+
:disabled="item.data.disabled"
|
|
26
|
+
@change="onSelect(item.data)"
|
|
27
|
+
>
|
|
28
|
+
<option
|
|
29
|
+
v-for="option in item.data.option"
|
|
30
|
+
:key="option"
|
|
31
|
+
:value="option"
|
|
32
|
+
:label="option"
|
|
33
|
+
/>
|
|
34
|
+
</select>
|
|
35
|
+
</span>
|
|
36
|
+
</template>
|
|
37
|
+
</atoms-table-data-grid>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script lang="ts" setup>
|
|
42
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
43
|
+
import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
44
|
+
import type {
|
|
45
|
+
UI_I_ColumnKey,
|
|
46
|
+
UI_I_HeadItem,
|
|
47
|
+
UI_I_BodyItem,
|
|
48
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
49
|
+
import type { UI_T_MigrateSelectNetwork } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/types'
|
|
50
|
+
import * as basicTable from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/config/basicTable'
|
|
51
|
+
import * as advancedTable from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/config/advancedTable'
|
|
52
|
+
|
|
53
|
+
const props = defineProps<{
|
|
54
|
+
networks: UI_T_MigrateSelectNetwork[]
|
|
55
|
+
type: 'basic' | 'advanced'
|
|
56
|
+
}>()
|
|
57
|
+
const emits = defineEmits<{
|
|
58
|
+
(event: 'select-network', value: any): void
|
|
59
|
+
}>()
|
|
60
|
+
const selectedNetworkLocal = defineModel<string | null>()
|
|
61
|
+
|
|
62
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
63
|
+
|
|
64
|
+
const pagination = ref<UI_I_Pagination>({
|
|
65
|
+
page: 1,
|
|
66
|
+
pageSize: 100,
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const table: any = {
|
|
70
|
+
basic: basicTable,
|
|
71
|
+
advanced: advancedTable,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
75
|
+
table[props.type].headItems(localization.value)
|
|
76
|
+
)
|
|
77
|
+
const columnKeys = computed<UI_I_ColumnKey[]>(() =>
|
|
78
|
+
table[props.type].columnKeys(localization.value)
|
|
79
|
+
)
|
|
80
|
+
watch(localization, () => {
|
|
81
|
+
columnKeys.value = table[props.type].columnKeys(localization.value)
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
85
|
+
return table[props.type].bodyItems(props.networks)
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
const onSelect = (data: any): void => {
|
|
89
|
+
emits('select-network', data)
|
|
90
|
+
}
|
|
91
|
+
watch(
|
|
92
|
+
() => props.type,
|
|
93
|
+
(newValue: 'basic' | 'advanced') => {
|
|
94
|
+
const tableData = bodyItems.value[0]
|
|
95
|
+
const itemKey = newValue === 'basic' ? 2 : 3
|
|
96
|
+
const data = tableData[itemKey].data
|
|
97
|
+
onSelect(data)
|
|
98
|
+
},
|
|
99
|
+
{ deep: true, immediate: true }
|
|
100
|
+
)
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
<style lang="scss" scoped>
|
|
104
|
+
.select-network {
|
|
105
|
+
&__select {
|
|
106
|
+
width: 100%;
|
|
107
|
+
height: 24px;
|
|
108
|
+
min-width: 107px;
|
|
109
|
+
& > select {
|
|
110
|
+
height: 100%;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_HeadItem,
|
|
3
|
+
UI_I_BodyItem,
|
|
4
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
5
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
6
|
+
import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
|
|
7
|
+
import type { UI_I_MigrateSelectNetworkAdvancedItem } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/interfaces'
|
|
8
|
+
import { networkAdvancedTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/config/tableKeys'
|
|
9
|
+
|
|
10
|
+
const getItems = (
|
|
11
|
+
localization: UI_I_Localization
|
|
12
|
+
): [string, boolean, string, string][] => {
|
|
13
|
+
return [
|
|
14
|
+
[localization.common.vm, true, '25%', networkAdvancedTableItemKeys[0]],
|
|
15
|
+
[localization.common.networkAdapter, true, '25%', networkAdvancedTableItemKeys[1]],
|
|
16
|
+
[localization.common.sourceNetwork, true, '25%', networkAdvancedTableItemKeys[2]],
|
|
17
|
+
[
|
|
18
|
+
localization.common.destinationNetwork,
|
|
19
|
+
true,
|
|
20
|
+
'25%',
|
|
21
|
+
networkAdvancedTableItemKeys[3],
|
|
22
|
+
],
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
27
|
+
const result: UI_I_HeadItem[] = []
|
|
28
|
+
getItems(localization).forEach((item, i) => {
|
|
29
|
+
const col = i === 3 ? 'select' : `col${i}`
|
|
30
|
+
result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
|
|
31
|
+
})
|
|
32
|
+
return result
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const bodyItems = (
|
|
36
|
+
data: UI_I_MigrateSelectNetworkAdvancedItem[]
|
|
37
|
+
): UI_I_BodyItem[][] => {
|
|
38
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
39
|
+
|
|
40
|
+
data.forEach(
|
|
41
|
+
(network: UI_I_MigrateSelectNetworkAdvancedItem, key: number) => {
|
|
42
|
+
const data = {
|
|
43
|
+
id: `${network.vm_name}-select`,
|
|
44
|
+
sourceNetwork: network.source_network,
|
|
45
|
+
disabled: false,
|
|
46
|
+
value: network.destination_network.find(
|
|
47
|
+
(item: string) => item === network.source_network
|
|
48
|
+
),
|
|
49
|
+
option: network.destination_network,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
bodyItems.push([
|
|
53
|
+
{
|
|
54
|
+
key: 'col0',
|
|
55
|
+
text: network[networkAdvancedTableItemKeys[0]],
|
|
56
|
+
id: key,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: 'col1',
|
|
60
|
+
text: network[networkAdvancedTableItemKeys[1]],
|
|
61
|
+
id: key,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
key: 'col2',
|
|
65
|
+
text: network[networkAdvancedTableItemKeys[2]],
|
|
66
|
+
id: key,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
key: 'select',
|
|
70
|
+
text: network[networkAdvancedTableItemKeys[3]],
|
|
71
|
+
data,
|
|
72
|
+
id: key,
|
|
73
|
+
},
|
|
74
|
+
])
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
return bodyItems
|
|
78
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_HeadItem,
|
|
3
|
+
UI_I_BodyItem,
|
|
4
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
5
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
6
|
+
import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
|
|
7
|
+
import type { UI_I_MigrateSelectNetworkBasicItem } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/interfaces'
|
|
8
|
+
import { networkBasicsTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/config/tableKeys'
|
|
9
|
+
|
|
10
|
+
const getItems = (
|
|
11
|
+
localization: UI_I_Localization
|
|
12
|
+
): [string, boolean, string, string][] => {
|
|
13
|
+
return [
|
|
14
|
+
[localization.common.sourceNetwork, true, '33.3%', networkBasicsTableItemKeys[0]],
|
|
15
|
+
[localization.common.usedBy, true, '33.3%', networkBasicsTableItemKeys[1]],
|
|
16
|
+
[
|
|
17
|
+
localization.common.destinationNetwork,
|
|
18
|
+
true,
|
|
19
|
+
'33.3%',
|
|
20
|
+
networkBasicsTableItemKeys[2],
|
|
21
|
+
],
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
26
|
+
const result: UI_I_HeadItem[] = []
|
|
27
|
+
getItems(localization).forEach((item, i) => {
|
|
28
|
+
const col = i === 2 ? 'select' : `col${i}`
|
|
29
|
+
result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
|
|
30
|
+
})
|
|
31
|
+
return result
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const bodyItems = (
|
|
35
|
+
data: UI_I_MigrateSelectNetworkBasicItem[]
|
|
36
|
+
): UI_I_BodyItem[][] => {
|
|
37
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
38
|
+
|
|
39
|
+
data.forEach((network: UI_I_MigrateSelectNetworkBasicItem) => {
|
|
40
|
+
const data = {
|
|
41
|
+
id: `${network.source_network}-select`,
|
|
42
|
+
sourceNetwork: network.source_network,
|
|
43
|
+
disabled: false,
|
|
44
|
+
value: network.destination_network.find(
|
|
45
|
+
(item) => item === network.source_network
|
|
46
|
+
),
|
|
47
|
+
option: network.destination_network,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
bodyItems.push([
|
|
51
|
+
{
|
|
52
|
+
key: 'col0',
|
|
53
|
+
text: network[networkBasicsTableItemKeys[0]],
|
|
54
|
+
id: network.source_network,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: 'col1',
|
|
58
|
+
text: network[networkBasicsTableItemKeys[1]],
|
|
59
|
+
id: network.source_network,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: 'select',
|
|
63
|
+
text: network[networkBasicsTableItemKeys[2]],
|
|
64
|
+
data,
|
|
65
|
+
id: network.source_network,
|
|
66
|
+
},
|
|
67
|
+
])
|
|
68
|
+
})
|
|
69
|
+
return bodyItems
|
|
70
|
+
}
|
package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/config/tableKeys.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_T_NetworkBasicsTableKeysTuple,
|
|
3
|
+
UI_T_NetworkAdvancedTableKeysTuple,
|
|
4
|
+
} from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/types'
|
|
5
|
+
|
|
6
|
+
export const networkBasicsTableItemKeys: UI_T_NetworkBasicsTableKeysTuple = [
|
|
7
|
+
'source_network',
|
|
8
|
+
'used_by',
|
|
9
|
+
'destination_network',
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
export const networkAdvancedTableItemKeys: UI_T_NetworkAdvancedTableKeysTuple =
|
|
13
|
+
['vm_name', 'network_adapter', 'source_network', 'destination_network']
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface UI_I_MigrateSelectNetworkBasicItem {
|
|
2
|
+
source_network: string
|
|
3
|
+
used_by: string
|
|
4
|
+
destination_network: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface UI_I_MigrateSelectNetworkAdvancedItem {
|
|
8
|
+
vm_name: string
|
|
9
|
+
network_adapter: string
|
|
10
|
+
source_network: string
|
|
11
|
+
destination_network: string
|
|
12
|
+
}
|
package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/models/types.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_MigrateSelectNetworkBasicItem,
|
|
3
|
+
UI_I_MigrateSelectNetworkAdvancedItem,
|
|
4
|
+
} from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/interfaces'
|
|
5
|
+
|
|
6
|
+
export type UI_T_NetworkAdvancedTableKeysTuple = [
|
|
7
|
+
'vm_name',
|
|
8
|
+
'network_adapter',
|
|
9
|
+
'source_network',
|
|
10
|
+
'destination_network'
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
export type UI_T_NetworkBasicsTableKeysTuple = [
|
|
14
|
+
'source_network',
|
|
15
|
+
'used_by',
|
|
16
|
+
'destination_network'
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
export type UI_T_MigrateSelectNetwork =
|
|
20
|
+
| UI_I_MigrateSelectNetworkBasicItem
|
|
21
|
+
| UI_I_MigrateSelectNetworkAdvancedItem
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-wrap">
|
|
3
|
+
<atoms-table-data-grid
|
|
4
|
+
:head-items="headItems"
|
|
5
|
+
:body-items="bodyItems"
|
|
6
|
+
:total-items="bodyItems.length"
|
|
7
|
+
:page-size="100"
|
|
8
|
+
:page="1"
|
|
9
|
+
:total-pages="1"
|
|
10
|
+
class="select-network"
|
|
11
|
+
test-id="use-at-table"
|
|
12
|
+
server-off
|
|
13
|
+
off-select-by-row
|
|
14
|
+
hide-footer
|
|
15
|
+
hide-page-size
|
|
16
|
+
>
|
|
17
|
+
</atoms-table-data-grid>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts" setup>
|
|
22
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
23
|
+
import type {
|
|
24
|
+
UI_I_HeadItem,
|
|
25
|
+
UI_I_BodyItem,
|
|
26
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
27
|
+
import * as table from '~/components/common/wizards/vm/migrate/select/network/table/useAt/lib/config/useAtTable'
|
|
28
|
+
|
|
29
|
+
const props = defineProps<{
|
|
30
|
+
networks: any[]
|
|
31
|
+
}>()
|
|
32
|
+
|
|
33
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
34
|
+
|
|
35
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
36
|
+
table.headItems(localization.value)
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
40
|
+
return table.bodyItems(props.networks)
|
|
41
|
+
})
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style lang="scss" scoped>
|
|
45
|
+
.select-network {
|
|
46
|
+
:deep(.datagrid) {
|
|
47
|
+
margin-top: 0;
|
|
48
|
+
}
|
|
49
|
+
:deep(.datagrid-outer-wrapper) {
|
|
50
|
+
padding-top: 0;
|
|
51
|
+
//height: inherit;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</style>
|
package/components/common/wizards/vmNew/migrate/select/network/table/useAt/lib/config/useAtTable.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_HeadItem,
|
|
3
|
+
UI_I_BodyItem,
|
|
4
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
5
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
6
|
+
import * as defaultSettings from '~/components/atoms/table/dataGrid/lib/config/settingsTable'
|
|
7
|
+
import { useAtTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/useAt/lib/config/tableKeys'
|
|
8
|
+
|
|
9
|
+
const getItems = (
|
|
10
|
+
localization: UI_I_Localization
|
|
11
|
+
): [string, boolean, string, string][] => {
|
|
12
|
+
return [
|
|
13
|
+
[localization.common.vm, true, '33.3%', useAtTableItemKeys[0]],
|
|
14
|
+
[localization.common.networkAdapter, true, '33.3%', useAtTableItemKeys[1]],
|
|
15
|
+
[localization.common.network, true, '33.3%', useAtTableItemKeys[2]],
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
20
|
+
return defaultSettings.defaultHeadItems(getItems(localization))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const bodyItems = (data: any[]): UI_I_BodyItem[][] => {
|
|
24
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
25
|
+
|
|
26
|
+
data.forEach((network: any, key: number) => {
|
|
27
|
+
bodyItems.push([
|
|
28
|
+
{
|
|
29
|
+
key: 'col0',
|
|
30
|
+
text: network[useAtTableItemKeys[0]],
|
|
31
|
+
id: key,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: 'col1',
|
|
35
|
+
text: network[useAtTableItemKeys[1]],
|
|
36
|
+
id: key,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: 'col2',
|
|
40
|
+
text: network[useAtTableItemKeys[2]],
|
|
41
|
+
data,
|
|
42
|
+
id: key,
|
|
43
|
+
},
|
|
44
|
+
])
|
|
45
|
+
})
|
|
46
|
+
return bodyItems
|
|
47
|
+
}
|
package/components/common/wizards/vmNew/migrate/select/network/table/useAt/lib/models/interfaces.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="select-priority">
|
|
3
|
+
<common-select-radio-group
|
|
4
|
+
v-model="selectedPriorityType"
|
|
5
|
+
:options="vmMigrationPriorityTypes"
|
|
6
|
+
/>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts" setup>
|
|
11
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
12
|
+
import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
|
|
13
|
+
import type { UI_T_SelectVMotionPriority } from '~/components/common/wizards/vm/migrate/select/priority/lib/models/types'
|
|
14
|
+
import { vmMigrateSelectPriorityTypesFunc } from '~/components/common/wizards/vm/migrate/select/priority/lib/config/typeOptions'
|
|
15
|
+
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
modelValue: UI_T_SelectVMotionPriority
|
|
18
|
+
}>()
|
|
19
|
+
const emits = defineEmits<{
|
|
20
|
+
(event: 'update:model-value', value: UI_T_SelectVMotionPriority): void
|
|
21
|
+
}>()
|
|
22
|
+
|
|
23
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
24
|
+
|
|
25
|
+
const vmMigrationPriorityTypes = computed<UI_I_RadioOption[]>(() =>
|
|
26
|
+
vmMigrateSelectPriorityTypesFunc(localization.value)
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
const selectedPriorityType = computed<UI_T_SelectVMotionPriority>({
|
|
30
|
+
get() {
|
|
31
|
+
return props.modelValue
|
|
32
|
+
},
|
|
33
|
+
set(newValue: UI_T_SelectVMotionPriority) {
|
|
34
|
+
emits('update:model-value', newValue)
|
|
35
|
+
},
|
|
36
|
+
})
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
|
|
3
|
+
|
|
4
|
+
export const vmMigrateSelectPriorityTypesFunc = (
|
|
5
|
+
localization: UI_I_Localization
|
|
6
|
+
): UI_I_RadioOption[] => {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
label: localization.common.scheduleVMotionWithHighPriority,
|
|
10
|
+
value: 'high',
|
|
11
|
+
disabled: false,
|
|
12
|
+
description: localization.common.scheduleVMotionWithHighPriorityDesc,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: localization.common.scheduleNormalVMotion,
|
|
16
|
+
value: 'normal',
|
|
17
|
+
disabled: false,
|
|
18
|
+
description: localization.common.scheduleNormalVMotionDesc,
|
|
19
|
+
},
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type UI_T_SelectVMotionPriority = 'high' | 'normal'
|