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,124 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_ColumnKey,
|
|
3
|
+
UI_I_HeadItem,
|
|
4
|
+
UI_I_BodyItem,
|
|
5
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
6
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
7
|
+
import {
|
|
8
|
+
constructColumnKey,
|
|
9
|
+
constructHeadItem,
|
|
10
|
+
} from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
|
|
11
|
+
import {
|
|
12
|
+
hostIconByState,
|
|
13
|
+
hostLocalizationByState,
|
|
14
|
+
} from '~/components/common/lib/config/states'
|
|
15
|
+
import type { UI_I_HostTableItem } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/models/interfaces'
|
|
16
|
+
// import type { I_TableIconColumnData } from '~/components/templates/inventory/mainBlock/tablesView/lib/models/interfaces'
|
|
17
|
+
import { hostTableItemKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/config/tableKeys'
|
|
18
|
+
|
|
19
|
+
const getItems = (
|
|
20
|
+
localization: UI_I_Localization
|
|
21
|
+
): [string, boolean, string, string][] => {
|
|
22
|
+
return [
|
|
23
|
+
[localization.common.name, true, '180px', hostTableItemKeys[0]],
|
|
24
|
+
[localization.inventorySummary.state, true, '96px', hostTableItemKeys[1]],
|
|
25
|
+
[localization.common.cluster, true, '180px', hostTableItemKeys[2]],
|
|
26
|
+
[localization.common.faultDomain, false, '180px', hostTableItemKeys[3]],
|
|
27
|
+
[`${localization.common.consumedCpu} %`, true, '180px', hostTableItemKeys[4]],
|
|
28
|
+
[`${localization.common.consumedMemory} %`, true, '180px', hostTableItemKeys[5]],
|
|
29
|
+
[localization.common.haState, true, '180px', hostTableItemKeys[6]],
|
|
30
|
+
[localization.inventorySummary.uptime, true, '180px', hostTableItemKeys[7]],
|
|
31
|
+
[localization.common.certificateValidTo, false, '180px', hostTableItemKeys[8]],
|
|
32
|
+
[
|
|
33
|
+
`${localization.common.memorySize} (${localization.common.mb})`,
|
|
34
|
+
false,
|
|
35
|
+
'180px',
|
|
36
|
+
hostTableItemKeys[9],
|
|
37
|
+
],
|
|
38
|
+
[localization.common.cpus, false, '180px', hostTableItemKeys[10]],
|
|
39
|
+
[localization.inventorySummary.nics, false, '180px', hostTableItemKeys[11]],
|
|
40
|
+
[localization.common.version, false, '180px', hostTableItemKeys[12]],
|
|
41
|
+
[localization.common.alarmActions, false, '180px', hostTableItemKeys[13]],
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const columnKeys = (
|
|
46
|
+
localization: UI_I_Localization
|
|
47
|
+
): UI_I_ColumnKey[] => {
|
|
48
|
+
const result: UI_I_ColumnKey[] = []
|
|
49
|
+
getItems(localization).forEach((item, i) => {
|
|
50
|
+
const col = i === 0 ? 'icon' : i === 4 || i === 5 ? 'progress' : `col${i}`
|
|
51
|
+
result.push(constructColumnKey(col, item[0], item[1]))
|
|
52
|
+
})
|
|
53
|
+
return result
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
57
|
+
const result: UI_I_HeadItem[] = []
|
|
58
|
+
getItems(localization).forEach((item, i) => {
|
|
59
|
+
const col = i === 0 ? 'icon' : i === 4 || i === 5 ? 'progress' : `col${i}`
|
|
60
|
+
result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
|
|
61
|
+
})
|
|
62
|
+
return result
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const bodyItems = (
|
|
66
|
+
data: UI_I_HostTableItem[],
|
|
67
|
+
localization: UI_I_Localization
|
|
68
|
+
): UI_I_BodyItem[][] => {
|
|
69
|
+
const { $number } = useNuxtApp() as any
|
|
70
|
+
|
|
71
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
72
|
+
data.forEach((host, key) => {
|
|
73
|
+
const hostData = {
|
|
74
|
+
iconClassName: `vsphere-icon-${hostIconByState[host.state]}`,
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
bodyItems.push([
|
|
78
|
+
{
|
|
79
|
+
key: 'icon',
|
|
80
|
+
text: host[hostTableItemKeys[0]],
|
|
81
|
+
data: hostData,
|
|
82
|
+
id: key,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: 'col1',
|
|
86
|
+
text: localization.common[hostLocalizationByState[host[hostTableItemKeys[1]]]],
|
|
87
|
+
id: key,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
key: 'col2',
|
|
91
|
+
text: host[hostTableItemKeys[2]],
|
|
92
|
+
id: key,
|
|
93
|
+
},
|
|
94
|
+
{ key: 'col3', text: host[hostTableItemKeys[3]], id: key },
|
|
95
|
+
{
|
|
96
|
+
key: 'progress',
|
|
97
|
+
text: `${host[hostTableItemKeys[4]].toFixed(2)}%`,
|
|
98
|
+
data: host[hostTableItemKeys[4]],
|
|
99
|
+
id: key,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
key: 'progress',
|
|
103
|
+
text: `${host[hostTableItemKeys[5]].toFixed(2)}%`,
|
|
104
|
+
data: host[hostTableItemKeys[5]],
|
|
105
|
+
id: key,
|
|
106
|
+
},
|
|
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 },
|
|
110
|
+
{
|
|
111
|
+
key: 'col9',
|
|
112
|
+
text: `${$number.format(host[hostTableItemKeys[9]], 'en')} ${
|
|
113
|
+
localization.common.mb
|
|
114
|
+
}`,
|
|
115
|
+
id: key,
|
|
116
|
+
},
|
|
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 },
|
|
120
|
+
{ key: 'col14', text: host[hostTableItemKeys[13]], id: key },
|
|
121
|
+
])
|
|
122
|
+
})
|
|
123
|
+
return bodyItems
|
|
124
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_ColumnKey,
|
|
3
|
+
UI_I_HeadItem,
|
|
4
|
+
UI_I_BodyItem,
|
|
5
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
6
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
7
|
+
import {
|
|
8
|
+
constructColumnKey,
|
|
9
|
+
constructHeadItem,
|
|
10
|
+
} from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
|
|
11
|
+
import { resourcePoolsTableItemKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/config/tableKeys'
|
|
12
|
+
|
|
13
|
+
const getItems = (
|
|
14
|
+
localization: UI_I_Localization
|
|
15
|
+
): [string, boolean, string, string][] => {
|
|
16
|
+
return [
|
|
17
|
+
[localization.common.name, true, '90px', resourcePoolsTableItemKeys[0]],
|
|
18
|
+
[
|
|
19
|
+
localization.common.cpuReservationMhz,
|
|
20
|
+
true,
|
|
21
|
+
'180px',
|
|
22
|
+
resourcePoolsTableItemKeys[0],
|
|
23
|
+
],
|
|
24
|
+
[localization.common.cpuLimitMhz, true, '180px', resourcePoolsTableItemKeys[0]],
|
|
25
|
+
[
|
|
26
|
+
localization.common.cpuAllocationType,
|
|
27
|
+
true,
|
|
28
|
+
'180px',
|
|
29
|
+
resourcePoolsTableItemKeys[0],
|
|
30
|
+
],
|
|
31
|
+
[localization.common.cpuShares, true, '180px', resourcePoolsTableItemKeys[1]],
|
|
32
|
+
[localization.common.cpuSharesValue, true, '180px', resourcePoolsTableItemKeys[2]],
|
|
33
|
+
[
|
|
34
|
+
localization.common.memoryReservationMb,
|
|
35
|
+
true,
|
|
36
|
+
'180px',
|
|
37
|
+
resourcePoolsTableItemKeys[2],
|
|
38
|
+
],
|
|
39
|
+
[localization.common.memoryLimitMb, true, '180px', resourcePoolsTableItemKeys[2]],
|
|
40
|
+
[
|
|
41
|
+
localization.common.memoryAllocationType,
|
|
42
|
+
true,
|
|
43
|
+
'180px',
|
|
44
|
+
resourcePoolsTableItemKeys[2],
|
|
45
|
+
],
|
|
46
|
+
[localization.common.memoryShares, true, '180px', resourcePoolsTableItemKeys[3]],
|
|
47
|
+
[
|
|
48
|
+
localization.common.memorySharesValue,
|
|
49
|
+
true,
|
|
50
|
+
'180px',
|
|
51
|
+
resourcePoolsTableItemKeys[4],
|
|
52
|
+
],
|
|
53
|
+
[localization.common.vc, true, '90px', resourcePoolsTableItemKeys[5]],
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const columnKeys = (
|
|
58
|
+
localization: UI_I_Localization
|
|
59
|
+
): UI_I_ColumnKey[] => {
|
|
60
|
+
const result: UI_I_ColumnKey[] = []
|
|
61
|
+
getItems(localization).forEach((item, i) => {
|
|
62
|
+
result.push(constructColumnKey(`col${i}`, item[0], item[1]))
|
|
63
|
+
})
|
|
64
|
+
return result
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
68
|
+
const result: UI_I_HeadItem[] = []
|
|
69
|
+
getItems(localization).forEach((item, i) => {
|
|
70
|
+
result.push(constructHeadItem(`col${i}`, item[0], item[3], false, item[2]))
|
|
71
|
+
})
|
|
72
|
+
return result
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const bodyItems = (data: any[]): UI_I_BodyItem[][] => {
|
|
76
|
+
const { $binary } = useNuxtApp()
|
|
77
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
78
|
+
data.forEach((vapp, key) => {
|
|
79
|
+
bodyItems.push([
|
|
80
|
+
{
|
|
81
|
+
key: 'col0',
|
|
82
|
+
text: vapp[resourcePoolsTableItemKeys[0]],
|
|
83
|
+
id: key,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: 'col1',
|
|
87
|
+
text: $binary.roundHz(vapp[resourcePoolsTableItemKeys[1]]),
|
|
88
|
+
id: key,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
key: 'col2',
|
|
92
|
+
text: $binary.roundHz(vapp[resourcePoolsTableItemKeys[2]]),
|
|
93
|
+
id: key,
|
|
94
|
+
},
|
|
95
|
+
{ key: 'col3', text: vapp[resourcePoolsTableItemKeys[3]], id: key },
|
|
96
|
+
{ key: 'col4', text: vapp[resourcePoolsTableItemKeys[4]], id: key },
|
|
97
|
+
{ key: 'col5', text: vapp[resourcePoolsTableItemKeys[5]], id: key },
|
|
98
|
+
{
|
|
99
|
+
key: 'col6',
|
|
100
|
+
text: $binary.round(vapp[resourcePoolsTableItemKeys[6]]),
|
|
101
|
+
id: key,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
key: 'col7',
|
|
105
|
+
text: $binary.round(vapp[resourcePoolsTableItemKeys[7]]),
|
|
106
|
+
id: key,
|
|
107
|
+
},
|
|
108
|
+
{ key: 'col8', text: vapp[resourcePoolsTableItemKeys[8]], id: key },
|
|
109
|
+
{ key: 'col9', text: vapp[resourcePoolsTableItemKeys[9]], id: key },
|
|
110
|
+
{ key: 'col10', text: vapp[resourcePoolsTableItemKeys[10]], id: key },
|
|
111
|
+
{ key: 'col11', text: vapp[resourcePoolsTableItemKeys[11]], id: key },
|
|
112
|
+
])
|
|
113
|
+
})
|
|
114
|
+
return bodyItems
|
|
115
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
T_HostTableTuple,
|
|
3
|
+
T_ClusterTableTuple,
|
|
4
|
+
T_VAppsTableTuple,
|
|
5
|
+
T_ResourcePoolTableTuple,
|
|
6
|
+
} from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/models/types'
|
|
7
|
+
|
|
8
|
+
export const hostTableItemKeys: T_HostTableTuple = [
|
|
9
|
+
'name',
|
|
10
|
+
'state',
|
|
11
|
+
'cluster',
|
|
12
|
+
'fault_domain',
|
|
13
|
+
'consumed_cpu',
|
|
14
|
+
'consumed_mem',
|
|
15
|
+
'ha_state',
|
|
16
|
+
'uptime',
|
|
17
|
+
'cert_valid_to',
|
|
18
|
+
'mem_size',
|
|
19
|
+
'cpus',
|
|
20
|
+
'nics',
|
|
21
|
+
'version',
|
|
22
|
+
'alarm_action',
|
|
23
|
+
]
|
|
24
|
+
export const clusterTableItemKeys: T_ClusterTableTuple = [
|
|
25
|
+
'name',
|
|
26
|
+
'available_cpu',
|
|
27
|
+
'available_memory',
|
|
28
|
+
'available_storage',
|
|
29
|
+
'drs',
|
|
30
|
+
'ha',
|
|
31
|
+
'total_cpu',
|
|
32
|
+
'total_memory',
|
|
33
|
+
'total_storage',
|
|
34
|
+
'vms',
|
|
35
|
+
'hosts',
|
|
36
|
+
'cpus',
|
|
37
|
+
'datastores',
|
|
38
|
+
'vsan',
|
|
39
|
+
'vc',
|
|
40
|
+
'evc_cpu_mode',
|
|
41
|
+
'evc_graphics_mode',
|
|
42
|
+
]
|
|
43
|
+
export const vAppsTableItemKeys: T_VAppsTableTuple = [
|
|
44
|
+
'name',
|
|
45
|
+
'cpu_shares',
|
|
46
|
+
'cpu_shares_val',
|
|
47
|
+
'memory_shares',
|
|
48
|
+
'memory_shares_val',
|
|
49
|
+
'managed_by',
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
export const resourcePoolsTableItemKeys: T_ResourcePoolTableTuple = [
|
|
53
|
+
'name',
|
|
54
|
+
'cpu_reservation',
|
|
55
|
+
'cpu_limit',
|
|
56
|
+
'cpu_allocation_type',
|
|
57
|
+
'cpu_shares',
|
|
58
|
+
'cpu_shares_val',
|
|
59
|
+
'memory_reservation',
|
|
60
|
+
'memory_limit',
|
|
61
|
+
'memory_allocation_type',
|
|
62
|
+
'memory_shares',
|
|
63
|
+
'memory_shares_val',
|
|
64
|
+
'vc',
|
|
65
|
+
]
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_ColumnKey,
|
|
3
|
+
UI_I_HeadItem,
|
|
4
|
+
UI_I_BodyItem,
|
|
5
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
6
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
7
|
+
// import {
|
|
8
|
+
// I_TableIconColumnData,
|
|
9
|
+
// I_Vapps,
|
|
10
|
+
// } from '~/components/templates/inventory/mainBlock/tablesView/lib/models/interfaces'
|
|
11
|
+
import { E_StatusEnum } from '~/components/templates/inventory/treeView/lib/models/enums'
|
|
12
|
+
import { columnKeys as getColumnKeys } from '~/components/templates/inventory/mainBlock/tablesView/lib/config/columnKeys'
|
|
13
|
+
import { headItems as getHeadItems } from '~/components/templates/inventory/mainBlock/tablesView/lib/config/headItems'
|
|
14
|
+
import { vAppsTableItemKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/config/tableKeys'
|
|
15
|
+
|
|
16
|
+
const getItems = (
|
|
17
|
+
localization: UI_I_Localization
|
|
18
|
+
): [string, boolean, string, string][] => {
|
|
19
|
+
return [
|
|
20
|
+
[localization.common.name, true, '180px', vAppsTableItemKeys[0]],
|
|
21
|
+
[localization.common.cpuShares, true, '180px', vAppsTableItemKeys[1]],
|
|
22
|
+
[localization.common.cpuSharesValue, true, '180px', vAppsTableItemKeys[2]],
|
|
23
|
+
[localization.common.memoryShares, true, '180px', vAppsTableItemKeys[3]],
|
|
24
|
+
[localization.common.memorySharesValue, true, '180px', vAppsTableItemKeys[4]],
|
|
25
|
+
[localization.common.managedBy, true, '180px', vAppsTableItemKeys[5]],
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const columnKeys = (
|
|
30
|
+
localization: UI_I_Localization
|
|
31
|
+
): UI_I_ColumnKey[] => {
|
|
32
|
+
return getColumnKeys(getItems(localization))
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
36
|
+
return getHeadItems(getItems(localization))
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const bodyItems = (data: any[]): UI_I_BodyItem[][] => {
|
|
40
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
41
|
+
data.forEach((vapp, key) => {
|
|
42
|
+
const nameData: any = {
|
|
43
|
+
iconClassName: E_StatusEnum.vmtemplate_Normal,
|
|
44
|
+
name: vapp.name,
|
|
45
|
+
// @ts-ignore TODO id надо для перехода, пока что так оставить чтобы нигде не ломалось потом поправить для всех
|
|
46
|
+
id: vapp.id,
|
|
47
|
+
nav: 'v',
|
|
48
|
+
type: 'vmtemplate',
|
|
49
|
+
isLink: true,
|
|
50
|
+
}
|
|
51
|
+
bodyItems.push([
|
|
52
|
+
{
|
|
53
|
+
key: 'icon',
|
|
54
|
+
text: vapp[vAppsTableItemKeys[0]],
|
|
55
|
+
data: nameData,
|
|
56
|
+
id: key,
|
|
57
|
+
},
|
|
58
|
+
{ key: 'col2', text: vapp[vAppsTableItemKeys[1]], id: key },
|
|
59
|
+
{ key: 'col3', text: vapp[vAppsTableItemKeys[2]], id: key },
|
|
60
|
+
{ key: 'col4', text: vapp[vAppsTableItemKeys[3]], id: key },
|
|
61
|
+
{ key: 'col5', text: vapp[vAppsTableItemKeys[4]], id: key },
|
|
62
|
+
{ key: 'col6', text: vapp[vAppsTableItemKeys[5]], id: key },
|
|
63
|
+
])
|
|
64
|
+
})
|
|
65
|
+
return bodyItems
|
|
66
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
available_cpu: number
|
|
23
|
+
available_memory: number
|
|
24
|
+
available_storage: number
|
|
25
|
+
cpus: number
|
|
26
|
+
datastores: number
|
|
27
|
+
drs: string
|
|
28
|
+
evc_cpu_mode: string
|
|
29
|
+
evc_graphics_mode: string
|
|
30
|
+
ha: string
|
|
31
|
+
hosts: number
|
|
32
|
+
id: number
|
|
33
|
+
name: string
|
|
34
|
+
state: number
|
|
35
|
+
status: number
|
|
36
|
+
total_cpu: number
|
|
37
|
+
total_memory: number
|
|
38
|
+
total_storage: number
|
|
39
|
+
vc: string
|
|
40
|
+
vms: number
|
|
41
|
+
vsan: string
|
|
42
|
+
}
|
|
43
|
+
export interface UI_I_ClusterTableItem extends API_UI_I_ClusterTableItem {}
|
|
44
|
+
|
|
45
|
+
export interface API_UI_I_ResourcePoolsTableItem {}
|
|
46
|
+
export interface UI_I_ResourcePoolsTableItem
|
|
47
|
+
extends API_UI_I_ResourcePoolsTableItem {}
|
|
48
|
+
|
|
49
|
+
export interface API_UI_I_VAppsTableItem {}
|
|
50
|
+
export interface UI_I_VAppsTableItem extends API_UI_I_VAppsTableItem {}
|
package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/models/types.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type T_HostTableTuple = [
|
|
2
|
+
'name',
|
|
3
|
+
'state',
|
|
4
|
+
'cluster',
|
|
5
|
+
'fault_domain',
|
|
6
|
+
'consumed_cpu',
|
|
7
|
+
'consumed_mem',
|
|
8
|
+
'ha_state',
|
|
9
|
+
'uptime',
|
|
10
|
+
'cert_valid_to',
|
|
11
|
+
'mem_size',
|
|
12
|
+
'cpus',
|
|
13
|
+
'nics',
|
|
14
|
+
'version',
|
|
15
|
+
'alarm_action'
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
export type T_ClusterTableTuple = [
|
|
19
|
+
'name',
|
|
20
|
+
'available_cpu',
|
|
21
|
+
'available_memory',
|
|
22
|
+
'available_storage',
|
|
23
|
+
'drs',
|
|
24
|
+
'ha',
|
|
25
|
+
'total_cpu',
|
|
26
|
+
'total_memory',
|
|
27
|
+
'total_storage',
|
|
28
|
+
'vms',
|
|
29
|
+
'hosts',
|
|
30
|
+
'cpus',
|
|
31
|
+
'datastores',
|
|
32
|
+
'vsan',
|
|
33
|
+
'vc',
|
|
34
|
+
'evc_cpu_mode',
|
|
35
|
+
'evc_graphics_mode'
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
export type T_VAppsTableTuple = [
|
|
39
|
+
'name',
|
|
40
|
+
'cpu_shares',
|
|
41
|
+
'cpu_shares_val',
|
|
42
|
+
'memory_shares',
|
|
43
|
+
'memory_shares_val',
|
|
44
|
+
'managed_by'
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
export type T_ResourcePoolTableTuple = [
|
|
48
|
+
'name',
|
|
49
|
+
'cpu_reservation',
|
|
50
|
+
'cpu_limit',
|
|
51
|
+
'cpu_allocation_type',
|
|
52
|
+
'cpu_shares',
|
|
53
|
+
'cpu_shares_val',
|
|
54
|
+
'memory_reservation',
|
|
55
|
+
'memory_limit',
|
|
56
|
+
'memory_allocation_type',
|
|
57
|
+
'memory_shares',
|
|
58
|
+
'memory_shares_val',
|
|
59
|
+
'vc'
|
|
60
|
+
]
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="select-network">
|
|
3
|
+
<div class="select-network__text">
|
|
4
|
+
{{ selectNetworkHeadline }}
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<common-wizards-vm-migrate-select-network-table-network
|
|
8
|
+
v-model="selectedSourceNetwork"
|
|
9
|
+
:key="uniqueKey"
|
|
10
|
+
:networks="dataNetwork"
|
|
11
|
+
:type="tableType"
|
|
12
|
+
@select-network="onSelectNetwork"
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
<div
|
|
16
|
+
v-if="isShowNetworkBasic && selectedSourceNetwork"
|
|
17
|
+
class="select-network__matcher-details"
|
|
18
|
+
>
|
|
19
|
+
<span> {{ networkDetailsHeadline }} </span>
|
|
20
|
+
|
|
21
|
+
<common-wizards-vm-migrate-select-network-table-use-at
|
|
22
|
+
:networks="useAtTableData"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="vm-migrate-advanced-view-button">
|
|
27
|
+
<button
|
|
28
|
+
class="btn btn-sm migrate-network-advanced-btn"
|
|
29
|
+
data-id="migrate-network-advanced-button"
|
|
30
|
+
@click="onClickSelectNetworkMode"
|
|
31
|
+
>
|
|
32
|
+
<span v-if="!isShowNetworkBasic"> ≪ </span>
|
|
33
|
+
{{ buttonText }}
|
|
34
|
+
<span v-if="isShowNetworkBasic"> ≫ </span>
|
|
35
|
+
</button>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<common-wizards-vm-common-validation-compatibility
|
|
39
|
+
:loading="false"
|
|
40
|
+
status="Success"
|
|
41
|
+
text="compatibilityChecksSucceeded"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script lang="ts" setup>
|
|
47
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
48
|
+
|
|
49
|
+
const isShowNetworkBasic = defineModel<boolean>('isBasicNetworkMode')
|
|
50
|
+
const networkData = defineModel<any>('networkData')
|
|
51
|
+
|
|
52
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
53
|
+
|
|
54
|
+
const selectedSourceNetwork = ref<string | null>(null)
|
|
55
|
+
const uniqueKey = ref<number>(0)
|
|
56
|
+
|
|
57
|
+
const buttonText = computed(
|
|
58
|
+
() => localization.value.common[isShowNetworkBasic.value ? 'advanced' : 'basic']
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
const tableType = computed<string>(() =>
|
|
62
|
+
isShowNetworkBasic.value ? 'basic' : 'advanced'
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
const selectNetworkHeadline = computed<string>(() => {
|
|
66
|
+
const { migrateNetworkingForAllAdapters, migrateNetworkingForEachAdapters } =
|
|
67
|
+
localization.value.common
|
|
68
|
+
|
|
69
|
+
return isShowNetworkBasic.value
|
|
70
|
+
? migrateNetworkingForAllAdapters
|
|
71
|
+
: migrateNetworkingForEachAdapters
|
|
72
|
+
})
|
|
73
|
+
const networkDetailsHeadline = computed<string>(() =>
|
|
74
|
+
localization.value.common.networkIsInUseAt.replace(
|
|
75
|
+
'{ network }',
|
|
76
|
+
selectedSourceNetwork.value + ''
|
|
77
|
+
)
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
const dataNetwork = computed(() => {
|
|
81
|
+
return [
|
|
82
|
+
{
|
|
83
|
+
vm_name: 'vm-horizon-1',
|
|
84
|
+
network_adapter: 'Network adapter 1',
|
|
85
|
+
source_network: 'VM-VLAN105',
|
|
86
|
+
used_by: '1 VMs / 1 Network adapters',
|
|
87
|
+
destination_network: ['VM Network 1', 'VM-VLAN105', 'VM Network 2'],
|
|
88
|
+
},
|
|
89
|
+
]
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
const useAtTableData = computed(() =>
|
|
93
|
+
dataNetwork.value.map((x) => {
|
|
94
|
+
return {
|
|
95
|
+
vm_name: x.vm_name,
|
|
96
|
+
network: x.source_network,
|
|
97
|
+
network_adapter: x.network_adapter,
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
const onClickSelectNetworkMode = (): void => {
|
|
103
|
+
uniqueKey.value++
|
|
104
|
+
isShowNetworkBasic.value = !isShowNetworkBasic.value
|
|
105
|
+
selectedSourceNetwork.value = ''
|
|
106
|
+
}
|
|
107
|
+
const onSelectNetwork = (data: any): void => {
|
|
108
|
+
networkData.value = data
|
|
109
|
+
}
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<style lang="scss" scoped>
|
|
113
|
+
.select-network {
|
|
114
|
+
margin-top: 10px;
|
|
115
|
+
&__text {
|
|
116
|
+
font-size: 12px;
|
|
117
|
+
}
|
|
118
|
+
&__matcher-details {
|
|
119
|
+
margin-top: 10px;
|
|
120
|
+
}
|
|
121
|
+
.vm-migrate-advanced-view-button {
|
|
122
|
+
text-align: end;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
</style>
|