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
|
@@ -0,0 +1,90 @@
|
|
|
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 type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces'
|
|
30
|
+
import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
31
|
+
import * as hostTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/hostTable'
|
|
32
|
+
import * as clusterTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/clusterTable'
|
|
33
|
+
import * as resourcePoolTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/resourcePoolTable'
|
|
34
|
+
import * as vAppsTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/vappsTable'
|
|
35
|
+
|
|
36
|
+
const props = defineProps<{
|
|
37
|
+
selectedData: number[]
|
|
38
|
+
dataTable: UI_I_StorageConfigurePerDiskItem[]
|
|
39
|
+
type: UI_T_SelectComputeResourceTabType
|
|
40
|
+
}>()
|
|
41
|
+
const emits = defineEmits<{
|
|
42
|
+
(event: 'update:selected-data', value: number[] | null): void
|
|
43
|
+
}>()
|
|
44
|
+
|
|
45
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
46
|
+
|
|
47
|
+
const table: any = {
|
|
48
|
+
host: hostTable,
|
|
49
|
+
cluster: clusterTable,
|
|
50
|
+
'resource-pool': resourcePoolTable,
|
|
51
|
+
'v-apps': vAppsTable,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
55
|
+
table[props.type].headItems(localization.value)
|
|
56
|
+
)
|
|
57
|
+
const columnKeys = computed<UI_I_ColumnKey[]>(() =>
|
|
58
|
+
table[props.type].columnKeys(localization.value)
|
|
59
|
+
)
|
|
60
|
+
watch(localization, () => {
|
|
61
|
+
columnKeys.value = table[props.type].columnKeys(localization.value)
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
65
|
+
return table[props.type].bodyItems(props.dataTable)
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const sort = ref<string | null>(null)
|
|
69
|
+
const pagination = ref<UI_I_Pagination>({
|
|
70
|
+
page: 1,
|
|
71
|
+
pageSize: 100,
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
const sorting = (data: [string, boolean]): void => {
|
|
75
|
+
const [column, status] = data
|
|
76
|
+
const direction = status ? 'asc' : 'desc'
|
|
77
|
+
sort.value = `${column}.${direction}`
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const selectedRow = computed<number[]>({
|
|
81
|
+
get() {
|
|
82
|
+
return props.selectedData
|
|
83
|
+
},
|
|
84
|
+
set(newValue: number[]) {
|
|
85
|
+
emits('update:selected-data', newValue)
|
|
86
|
+
},
|
|
87
|
+
})
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style lang="scss" scoped></style>
|
package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/clusterTable.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
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 type {
|
|
8
|
+
I_Clusters,
|
|
9
|
+
I_TableIconColumnData,
|
|
10
|
+
} from '~/components/templates/inventory/mainBlock/tablesView/models/interfaces'
|
|
11
|
+
import { E_StatusEnum } from '~/components/templates/inventory/treeView/models/enums'
|
|
12
|
+
import { columnKeys as getColumnKeys } from '~/components/templates/inventory/mainBlock/tablesView/config/columnKeys'
|
|
13
|
+
import { headItems as getHeadItems } from '~/components/templates/inventory/mainBlock/tablesView/config/headItems'
|
|
14
|
+
import { clusterTableItemKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/tableKeys'
|
|
15
|
+
|
|
16
|
+
const getItems = (
|
|
17
|
+
localization: UI_I_Localization
|
|
18
|
+
): [string, boolean, string, string][] => {
|
|
19
|
+
return [
|
|
20
|
+
[localization.name, true, '180px', clusterTableItemKeys[0]],
|
|
21
|
+
[localization.availableCpu, true, '180px', clusterTableItemKeys[1]],
|
|
22
|
+
[localization.availableMemory, true, '180px', clusterTableItemKeys[2]],
|
|
23
|
+
[localization.availableStorage, true, '180px', clusterTableItemKeys[3]],
|
|
24
|
+
[localization.vSphere_DRS, true, '180px', clusterTableItemKeys[4]],
|
|
25
|
+
[localization.vSphere_HA, true, '180px', clusterTableItemKeys[5]],
|
|
26
|
+
[localization.totalCpu, false, '180px', clusterTableItemKeys[6]],
|
|
27
|
+
[localization.totalMemory, false, '180px', clusterTableItemKeys[7]],
|
|
28
|
+
[localization.totalStorage, false, '180px', clusterTableItemKeys[8]],
|
|
29
|
+
[localization.vms, false, '180px', clusterTableItemKeys[9]],
|
|
30
|
+
[localization.hosts, false, '180px', clusterTableItemKeys[10]],
|
|
31
|
+
[localization.cpus, false, '180px', clusterTableItemKeys[11]],
|
|
32
|
+
[localization.datastores, false, '180px', clusterTableItemKeys[12]],
|
|
33
|
+
[localization.vSAN, false, '180px', clusterTableItemKeys[13]],
|
|
34
|
+
[localization.vc, false, '180px', clusterTableItemKeys[14]],
|
|
35
|
+
[localization.evcCpuMode, true, '180px', clusterTableItemKeys[15]],
|
|
36
|
+
[localization.evcGraphicsMode, true, '240px', clusterTableItemKeys[16]],
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const columnKeys = (
|
|
41
|
+
localization: UI_I_Localization
|
|
42
|
+
): UI_I_ColumnKey[] => {
|
|
43
|
+
return getColumnKeys(getItems(localization))
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
47
|
+
return getHeadItems(getItems(localization))
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const bodyItems = (data: I_Clusters[]): UI_I_BodyItem[][] => {
|
|
51
|
+
const { $binary } = useNuxtApp()
|
|
52
|
+
|
|
53
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
54
|
+
data.forEach((cluster, key) => {
|
|
55
|
+
const clusterData: I_TableIconColumnData = {
|
|
56
|
+
iconClassName: E_StatusEnum.cluster_Normal,
|
|
57
|
+
name: cluster.name,
|
|
58
|
+
// @ts-ignore TODO id надо для перехода, пока что так оставить чтобы нигде не ломалось потом поправить для всех
|
|
59
|
+
id: cluster.id,
|
|
60
|
+
nav: 'h',
|
|
61
|
+
type: 'cluster',
|
|
62
|
+
isLink: true,
|
|
63
|
+
}
|
|
64
|
+
bodyItems.push([
|
|
65
|
+
{
|
|
66
|
+
key: 'icon',
|
|
67
|
+
text: cluster[clusterTableItemKeys[0]],
|
|
68
|
+
data: clusterData,
|
|
69
|
+
id: key,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
key: 'col2',
|
|
73
|
+
text: $binary.roundHz(cluster[clusterTableItemKeys[1]]),
|
|
74
|
+
id: key,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: 'col3',
|
|
78
|
+
text: $binary.round(cluster[clusterTableItemKeys[2]]),
|
|
79
|
+
id: key,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
key: 'col4',
|
|
83
|
+
text: $binary.round(cluster[clusterTableItemKeys[3]]),
|
|
84
|
+
id: key,
|
|
85
|
+
},
|
|
86
|
+
{ key: 'col5', text: cluster[clusterTableItemKeys[4]], id: key },
|
|
87
|
+
{ key: 'col6', text: cluster[clusterTableItemKeys[5]], id: key },
|
|
88
|
+
{
|
|
89
|
+
key: 'col7',
|
|
90
|
+
text: $binary.roundHz(cluster[clusterTableItemKeys[6]]),
|
|
91
|
+
id: key,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: 'col8',
|
|
95
|
+
text: $binary.round(cluster[clusterTableItemKeys[7]]),
|
|
96
|
+
id: key,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
key: 'col9',
|
|
100
|
+
text: $binary.round(cluster[clusterTableItemKeys[8]]),
|
|
101
|
+
id: key,
|
|
102
|
+
},
|
|
103
|
+
{ key: 'col10', text: cluster[clusterTableItemKeys[9]], id: key },
|
|
104
|
+
{ key: 'col11', text: cluster[clusterTableItemKeys[10]], id: key },
|
|
105
|
+
{ key: 'col12', text: cluster[clusterTableItemKeys[11]], id: key },
|
|
106
|
+
{ key: 'col13', text: cluster[clusterTableItemKeys[12]], id: key },
|
|
107
|
+
{ key: 'col14', text: cluster[clusterTableItemKeys[13]], id: key },
|
|
108
|
+
{ key: 'col15', text: cluster[clusterTableItemKeys[14]], id: key },
|
|
109
|
+
{ key: 'col16', text: cluster[clusterTableItemKeys[15]], id: key },
|
|
110
|
+
{ key: 'col17', text: cluster[clusterTableItemKeys[16]], id: key },
|
|
111
|
+
])
|
|
112
|
+
})
|
|
113
|
+
return bodyItems
|
|
114
|
+
}
|
package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/hostTable.ts
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
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 {
|
|
12
|
+
hostIconByState,
|
|
13
|
+
hostLocalizationByState,
|
|
14
|
+
} from '~/components/common/config/states'
|
|
15
|
+
// import type { I_TableIconColumnData } from '~/components/templates/inventory/mainBlock/tablesView/models/interfaces'
|
|
16
|
+
// import type { API_I_HostTableItem } from '~/models/store/inventory/host/interfaces'
|
|
17
|
+
import { E_StatusEnum } from '~/components/templates/inventory/treeView/models/enums'
|
|
18
|
+
import { hostTableItemKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/tableKeys'
|
|
19
|
+
|
|
20
|
+
const getItems = (
|
|
21
|
+
localization: UI_I_Localization
|
|
22
|
+
): [string, boolean, string, string][] => {
|
|
23
|
+
return [
|
|
24
|
+
[localization.name, true, '180px', hostTableItemKeys[0]],
|
|
25
|
+
[localization.state, true, '96px', hostTableItemKeys[1]],
|
|
26
|
+
[localization.cluster, true, '180px', hostTableItemKeys[2]],
|
|
27
|
+
[localization.faultDomain, true, '180px', hostTableItemKeys[3]],
|
|
28
|
+
[`${localization.consumedCpu} %`, true, '180px', hostTableItemKeys[4]],
|
|
29
|
+
[`${localization.consumedMemory} %`, true, '180px', hostTableItemKeys[5]],
|
|
30
|
+
[localization.haState, true, '180px', hostTableItemKeys[6]],
|
|
31
|
+
[localization.uptime, true, '180px', hostTableItemKeys[7]],
|
|
32
|
+
[localization.certificateValidTo, false, '180px', hostTableItemKeys[8]],
|
|
33
|
+
[
|
|
34
|
+
`${localization.memorySize} (${localization.mb})`,
|
|
35
|
+
false,
|
|
36
|
+
'180px',
|
|
37
|
+
hostTableItemKeys[9],
|
|
38
|
+
],
|
|
39
|
+
[localization.cpus, false, '180px', hostTableItemKeys[10]],
|
|
40
|
+
[localization.nics, false, '180px', hostTableItemKeys[11]],
|
|
41
|
+
[localization.version, false, '180px', hostTableItemKeys[12]],
|
|
42
|
+
[localization.alarmActions, false, '180px', hostTableItemKeys[13]],
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const columnKeys = (
|
|
47
|
+
localization: UI_I_Localization
|
|
48
|
+
): UI_I_ColumnKey[] => {
|
|
49
|
+
const result: UI_I_ColumnKey[] = []
|
|
50
|
+
getItems(localization).forEach((item, i) => {
|
|
51
|
+
const col =
|
|
52
|
+
i === 0 ? 'icon' : i === 5 || i === 6 ? 'progress' : `col${i + 1}`
|
|
53
|
+
result.push(constructColumnKey(col, item[0], item[1]))
|
|
54
|
+
})
|
|
55
|
+
return result
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
59
|
+
const result: UI_I_HeadItem[] = []
|
|
60
|
+
getItems(localization).forEach((item, i) => {
|
|
61
|
+
const col =
|
|
62
|
+
i === 0 ? 'icon' : i === 5 || i === 6 ? 'progress' : `col${i + 1}`
|
|
63
|
+
result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
|
|
64
|
+
})
|
|
65
|
+
return result
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const bodyItems = (
|
|
69
|
+
data: API_I_HostTableItem[],
|
|
70
|
+
localization: UI_I_Localization
|
|
71
|
+
): UI_I_BodyItem[][] => {
|
|
72
|
+
const { $number } = useNuxtApp()
|
|
73
|
+
|
|
74
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
75
|
+
data.forEach((host, key) => {
|
|
76
|
+
const hostData: any = {
|
|
77
|
+
iconClassName: `vsphere-icon-${hostIconByState[host.state]}`,
|
|
78
|
+
name: host.name,
|
|
79
|
+
// @ts-ignore TODO id надо для перехода, пока что так оставить чтобы нигде не ломалось потом поправить для всех
|
|
80
|
+
id: host.name,
|
|
81
|
+
nav: 'h',
|
|
82
|
+
type: 'host',
|
|
83
|
+
isLink: true,
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const clusterData: any = {
|
|
87
|
+
iconClassName: E_StatusEnum.cluster_Normal,
|
|
88
|
+
name: host.cluster,
|
|
89
|
+
nav: 'h',
|
|
90
|
+
type: 'cluster',
|
|
91
|
+
isLink: true,
|
|
92
|
+
}
|
|
93
|
+
bodyItems.push([
|
|
94
|
+
{
|
|
95
|
+
key: 'icon',
|
|
96
|
+
text: host[hostTableItemKeys[0]],
|
|
97
|
+
data: hostData,
|
|
98
|
+
id: key,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: 'col2',
|
|
102
|
+
text: localization[hostLocalizationByState[host[hostTableItemKeys[1]]]],
|
|
103
|
+
id: key,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: 'col3',
|
|
107
|
+
text: host[hostTableItemKeys[2]],
|
|
108
|
+
data: clusterData,
|
|
109
|
+
id: key,
|
|
110
|
+
},
|
|
111
|
+
{ key: 'col4', text: host[hostTableItemKeys[3]], id: key },
|
|
112
|
+
{
|
|
113
|
+
key: 'progress',
|
|
114
|
+
text: `${host[hostTableItemKeys[4]].toFixed(2)}%`,
|
|
115
|
+
data: host[hostTableItemKeys[4]],
|
|
116
|
+
id: key,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: 'progress',
|
|
120
|
+
text: `${host[hostTableItemKeys[5]].toFixed(2)}%`,
|
|
121
|
+
data: host[hostTableItemKeys[5]],
|
|
122
|
+
id: key,
|
|
123
|
+
},
|
|
124
|
+
{ key: 'col7', text: host[hostTableItemKeys[6]], id: key },
|
|
125
|
+
{ key: 'col8', text: host[hostTableItemKeys[7]], id: key },
|
|
126
|
+
{ key: 'col9', text: host[hostTableItemKeys[8]], id: key },
|
|
127
|
+
{
|
|
128
|
+
key: 'col10',
|
|
129
|
+
text: `${$number.format(host[hostTableItemKeys[9]], 'en')} ${
|
|
130
|
+
localization.mb
|
|
131
|
+
}`,
|
|
132
|
+
id: key,
|
|
133
|
+
},
|
|
134
|
+
{ key: 'col11', text: host[hostTableItemKeys[10]], id: key },
|
|
135
|
+
{ key: 'col12', text: host[hostTableItemKeys[11]], id: key },
|
|
136
|
+
{ key: 'col13', text: host[hostTableItemKeys[12]], id: key },
|
|
137
|
+
{ key: 'col14', text: host[hostTableItemKeys[13]], id: key },
|
|
138
|
+
])
|
|
139
|
+
})
|
|
140
|
+
return bodyItems
|
|
141
|
+
}
|
|
@@ -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/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 { resourcePoolsTableItemKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/tableKeys'
|
|
12
|
+
|
|
13
|
+
const getItems = (
|
|
14
|
+
localization: UI_I_Localization
|
|
15
|
+
): [string, boolean, string, string][] => {
|
|
16
|
+
return [
|
|
17
|
+
[localization.name, true, '90px', resourcePoolsTableItemKeys[0]],
|
|
18
|
+
[
|
|
19
|
+
localization.cpuReservationMhz,
|
|
20
|
+
true,
|
|
21
|
+
'180px',
|
|
22
|
+
resourcePoolsTableItemKeys[0],
|
|
23
|
+
],
|
|
24
|
+
[localization.cpuLimitMhz, true, '180px', resourcePoolsTableItemKeys[0]],
|
|
25
|
+
[
|
|
26
|
+
localization.cpuAllocationType,
|
|
27
|
+
true,
|
|
28
|
+
'180px',
|
|
29
|
+
resourcePoolsTableItemKeys[0],
|
|
30
|
+
],
|
|
31
|
+
[localization.cpuShares, true, '180px', resourcePoolsTableItemKeys[1]],
|
|
32
|
+
[localization.cpuSharesValue, true, '180px', resourcePoolsTableItemKeys[2]],
|
|
33
|
+
[
|
|
34
|
+
localization.memoryReservationMb,
|
|
35
|
+
true,
|
|
36
|
+
'180px',
|
|
37
|
+
resourcePoolsTableItemKeys[2],
|
|
38
|
+
],
|
|
39
|
+
[localization.memoryLimitMb, true, '180px', resourcePoolsTableItemKeys[2]],
|
|
40
|
+
[
|
|
41
|
+
localization.memoryAllocationType,
|
|
42
|
+
true,
|
|
43
|
+
'180px',
|
|
44
|
+
resourcePoolsTableItemKeys[2],
|
|
45
|
+
],
|
|
46
|
+
[localization.memoryShares, true, '180px', resourcePoolsTableItemKeys[3]],
|
|
47
|
+
[
|
|
48
|
+
localization.memorySharesValue,
|
|
49
|
+
true,
|
|
50
|
+
'180px',
|
|
51
|
+
resourcePoolsTableItemKeys[4],
|
|
52
|
+
],
|
|
53
|
+
[localization.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
|
+
}
|
package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/tableKeys.ts
ADDED
|
@@ -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/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
|
+
]
|
package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/vappsTable.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
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
|
+
// I_TableIconColumnData,
|
|
9
|
+
// I_Vapps,
|
|
10
|
+
// } from '~/components/templates/inventory/mainBlock/tablesView/models/interfaces'
|
|
11
|
+
import { E_StatusEnum } from '~/components/templates/inventory/treeView/models/enums'
|
|
12
|
+
import { columnKeys as getColumnKeys } from '~/components/templates/inventory/mainBlock/tablesView/config/columnKeys'
|
|
13
|
+
import { headItems as getHeadItems } from '~/components/templates/inventory/mainBlock/tablesView/config/headItems'
|
|
14
|
+
import { vAppsTableItemKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/tableKeys'
|
|
15
|
+
|
|
16
|
+
const getItems = (
|
|
17
|
+
localization: UI_I_Localization
|
|
18
|
+
): [string, boolean, string, string][] => {
|
|
19
|
+
return [
|
|
20
|
+
[localization.name, true, '180px', vAppsTableItemKeys[0]],
|
|
21
|
+
[localization.cpuShares, true, '180px', vAppsTableItemKeys[1]],
|
|
22
|
+
[localization.cpuSharesValue, true, '180px', vAppsTableItemKeys[2]],
|
|
23
|
+
[localization.memoryShares, true, '180px', vAppsTableItemKeys[3]],
|
|
24
|
+
[localization.memorySharesValue, true, '180px', vAppsTableItemKeys[4]],
|
|
25
|
+
[localization.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,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
|
+
]
|