bfg-common 1.4.113 → 1.4.114

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.
Files changed (76) hide show
  1. package/assets/scss/common/icons/icons-5.scss +28 -4
  2. package/components/common/layout/theHeader/TheHeaderNew.vue +12 -2
  3. package/components/common/layout/theHeader/ThemeSwitch.vue +8 -1
  4. package/components/common/layout/theHeader/helpMenu/helpMenuNew/HelpMenuNew.vue +8 -2
  5. package/components/common/layout/theHeader/userMenu/userMenuNew/UserMenuNew.vue +7 -1
  6. package/components/common/select/input/lib/models/interfaces.ts +0 -1
  7. package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +4 -3
  8. package/package.json +2 -2
  9. package/components/common/wizards/vmNew/common/computeResource/TreeView.vue +0 -61
  10. package/components/common/wizards/vmNew/common/tooltip/Tooltip.vue +0 -84
  11. package/components/common/wizards/vmNew/common/validation/compatibility/Compatibility.vue +0 -62
  12. package/components/common/wizards/vmNew/common/validation/lib/models/enums.ts +0 -5
  13. package/components/common/wizards/vmNew/migrate/Migrate.vue +0 -235
  14. package/components/common/wizards/vmNew/migrate/lib/config/constructDataReady.ts +0 -100
  15. package/components/common/wizards/vmNew/migrate/lib/config/steps.ts +0 -82
  16. package/components/common/wizards/vmNew/migrate/lib/models/enums.ts +0 -6
  17. package/components/common/wizards/vmNew/migrate/lib/models/interfaces.ts +0 -32
  18. package/components/common/wizards/vmNew/migrate/lib/utils.ts +0 -0
  19. package/components/common/wizards/vmNew/migrate/lib/validations.ts +0 -29
  20. package/components/common/wizards/vmNew/migrate/select/computeResource/ComputeResource.vue +0 -219
  21. package/components/common/wizards/vmNew/migrate/select/computeResource/lib/config/tabsPannel.ts +0 -28
  22. package/components/common/wizards/vmNew/migrate/select/computeResource/lib/models/enums.ts +0 -6
  23. package/components/common/wizards/vmNew/migrate/select/computeResource/lib/models/interfaces.ts +0 -30
  24. package/components/common/wizards/vmNew/migrate/select/computeResource/lib/models/types.ts +0 -12
  25. package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/TableView.vue +0 -143
  26. package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/config/clusterTable.ts +0 -113
  27. package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/config/hostTable.ts +0 -124
  28. package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/config/resourcePoolTable.ts +0 -115
  29. package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/config/tableKeys.ts +0 -65
  30. package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/config/vappsTable.ts +0 -66
  31. package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/models/interfaces.ts +0 -50
  32. package/components/common/wizards/vmNew/migrate/select/computeResource/tableView/lib/models/types.ts +0 -60
  33. package/components/common/wizards/vmNew/migrate/select/network/Network.vue +0 -125
  34. package/components/common/wizards/vmNew/migrate/select/network/table/network/Network.vue +0 -114
  35. package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/config/advancedTable.ts +0 -78
  36. package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/config/basicTable.ts +0 -70
  37. package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/config/tableKeys.ts +0 -13
  38. package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/models/interfaces.ts +0 -12
  39. package/components/common/wizards/vmNew/migrate/select/network/table/network/lib/models/types.ts +0 -21
  40. package/components/common/wizards/vmNew/migrate/select/network/table/useAt/UseAt.vue +0 -54
  41. package/components/common/wizards/vmNew/migrate/select/network/table/useAt/lib/config/tableKeys.ts +0 -7
  42. package/components/common/wizards/vmNew/migrate/select/network/table/useAt/lib/config/useAtTable.ts +0 -47
  43. package/components/common/wizards/vmNew/migrate/select/network/table/useAt/lib/models/interfaces.ts +0 -1
  44. package/components/common/wizards/vmNew/migrate/select/network/table/useAt/lib/models/types.ts +0 -5
  45. package/components/common/wizards/vmNew/migrate/select/priority/Priority.vue +0 -39
  46. package/components/common/wizards/vmNew/migrate/select/priority/lib/config/typeOptions.ts +0 -21
  47. package/components/common/wizards/vmNew/migrate/select/priority/lib/models/types.ts +0 -1
  48. package/components/common/wizards/vmNew/migrate/select/storage/Storage.vue +0 -206
  49. package/components/common/wizards/vmNew/migrate/select/storage/configure/batch/Batch.vue +0 -58
  50. package/components/common/wizards/vmNew/migrate/select/storage/configure/batch/config/virtualDiskFormat.ts +0 -30
  51. package/components/common/wizards/vmNew/migrate/select/storage/configure/batch/table/Table.vue +0 -118
  52. package/components/common/wizards/vmNew/migrate/select/storage/configure/batch/table/lib/config/datastoreTable.ts +0 -177
  53. package/components/common/wizards/vmNew/migrate/select/storage/configure/batch/table/lib/models/types.ts +0 -15
  54. package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/Disk.vue +0 -68
  55. package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/table/Table.vue +0 -74
  56. package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/table/lib/config/diskTable.ts +0 -135
  57. package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/table/lib/config/tableKeys.ts +0 -15
  58. package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/table/lib/models/interfaces.ts +0 -24
  59. package/components/common/wizards/vmNew/migrate/select/storage/configure/disk/table/lib/models/types.ts +0 -13
  60. package/components/common/wizards/vmNew/migrate/select/storage/lib/config/tabsPannel.ts +0 -20
  61. package/components/common/wizards/vmNew/migrate/select/storage/lib/models/enums.ts +0 -6
  62. package/components/common/wizards/vmNew/migrate/select/storage/lib/models/interfaces.ts +0 -14
  63. package/components/common/wizards/vmNew/migrate/select/storage/lib/models/types.ts +0 -9
  64. package/components/common/wizards/vmNew/migrate/select/storage/policy/Policy.vue +0 -84
  65. package/components/common/wizards/vmNew/migrate/select/storage/selectedPerDisk/SelectedPerDisk.vue +0 -88
  66. package/components/common/wizards/vmNew/migrate/select/targetServer/lib/config/tabsPannel.ts +0 -18
  67. package/components/common/wizards/vmNew/migrate/select/targetServer/lib/models/types.ts +0 -1
  68. package/components/common/wizards/vmNew/migrate/select/targetServer/new/New.vue +0 -294
  69. package/components/common/wizards/vmNew/migrate/select/targetServer/new/lib/config/defaultForm.ts +0 -36
  70. package/components/common/wizards/vmNew/migrate/select/targetServer/new/lib/models/interfaces.ts +0 -13
  71. package/components/common/wizards/vmNew/migrate/select/targetServer/saved/Saved.vue +0 -27
  72. package/components/common/wizards/vmNew/migrate/select/targetServer/targetServer.vue +0 -41
  73. package/components/common/wizards/vmNew/migrate/select/type/Type.vue +0 -27
  74. package/components/common/wizards/vmNew/migrate/select/type/lib/config/typeOptions.ts +0 -41
  75. package/components/common/wizards/vmNew/migrate/select/type/lib/models/interfaces.ts +0 -5
  76. package/components/common/wizards/vmNew/migrate/select/type/lib/models/types.ts +0 -5
@@ -1,219 +0,0 @@
1
- <template>
2
- <div class="compute-resource">
3
- <atoms-alert
4
- v-if="errorMessages.length"
5
- test-id="compute-resource-alert"
6
- status="alert-danger"
7
- :items="errorMessages"
8
- @remove="onHideErrorMessageAlert"
9
- />
10
-
11
- <div
12
- v-if="props.migrateType === 'resource-storage'"
13
- class="tree-view-wrap mt-1"
14
- >
15
- <common-wizards-vm-common-compute-resource-tree-view
16
- v-model="computeResourceDataLocal.selectedNode"
17
- :compute-resource-tree="nodes"
18
- @show-compute-resource-tree="onShowComputeResourceTree"
19
- @select-compute-resource-tree="onSelectComputeResourceTree"
20
- />
21
- </div>
22
-
23
- <template v-else>
24
- <atoms-tabs
25
- v-model="activeTab"
26
- test-id="migrate-select-storage-tabs"
27
- :items="selectStorageTabs"
28
- size="small"
29
- class="compute-resource__tabs"
30
- />
31
-
32
- <common-wizards-vm-migrate-select-compute-resource-table-view
33
- v-model:selected-data="selectedTableDataKeys[activeTab]"
34
- :get-compute-resource-data="props.getComputeResourceData"
35
- :data-table="props.computeResourceData?.items || []"
36
- :total-items="props.computeResourceData?.total_items || 0"
37
- :total-pages="props.computeResourceData?.total_pages || 1"
38
- :type="activeTab"
39
- />
40
- </template>
41
-
42
- <common-wizards-vm-common-validation-compatibility
43
- :loading="!computeResourceDataLocal.selectedNode"
44
- :status="compatibilityText[0]"
45
- :text="compatibilityText[1]"
46
- />
47
- </div>
48
- </template>
49
-
50
- <script lang="ts" setup>
51
- import type { UI_I_Localization } from '~/lib/models/interfaces'
52
- import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
53
- import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
54
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
55
- import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/lib/models/types'
56
- import type { UI_E_ComputeResourceTabKamelKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/enums'
57
- import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/lib/models/types'
58
- import type { UI_I_SelectedTableDataKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/interfaces'
59
- import { vmMigrateComputeResourceTabsFunc } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/config/tabsPannel'
60
-
61
- const props = defineProps<{
62
- submit: number
63
- getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
64
- migrateType: UI_T_VmMigrateType
65
- computeResourceData: any
66
- computeResourceTree: UI_I_TreeNode
67
- }>()
68
- const emits = defineEmits<{
69
- (event: 'next-step', value: any): void
70
- }>()
71
-
72
- const localization = computed<UI_I_Localization>(() => useLocal())
73
- const { $recursion } = useNuxtApp()
74
-
75
- const activeTab = ref<UI_T_SelectComputeResourceTabType>('host')
76
- const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
77
- vmMigrateComputeResourceTabsFunc(localization.value)
78
- )
79
-
80
- const computeResourceDataLocal = ref<any>({
81
- selectedNode: null,
82
- host: null,
83
- cluster: null,
84
- resourcePool: null,
85
- vApps: null,
86
- })
87
-
88
- const selectedTableDataKeys = ref<UI_I_SelectedTableDataKeys>({
89
- host: null,
90
- cluster: null,
91
- 'resource-pool': null,
92
- 'v-apps': null,
93
- })
94
- watch(
95
- selectedTableDataKeys,
96
- (newValue) => {
97
- if (!props.computeResourceData?.items.length) return
98
-
99
- const data = props.computeResourceData.items.find(
100
- (_: never, key: number) => newValue[activeTab.value] === key
101
- )
102
- if (data) {
103
- const dataKeys = UI_E_ComputeResourceTabKamelKeys[activeTab.value]
104
- computeResourceDataLocal.value[dataKeys] = data
105
- }
106
- },
107
- { immediate: true, deep: true }
108
- )
109
-
110
- const nodes = ref<UI_I_TreeNode[]>([])
111
- watch(
112
- props.computeResourceTree,
113
- (newValue) => {
114
- if (nodes.value.length) return
115
-
116
- nodes.value = useDeepCopy([newValue])
117
- },
118
- { immediate: true, deep: true }
119
- )
120
-
121
- const onShowComputeResourceTree = ({
122
- node,
123
- cb,
124
- }: {
125
- node: UI_I_TreeNode
126
- cb: () => void
127
- }): void => {
128
- $recursion.findAndShow(
129
- nodes.value,
130
- [node.id, node.type],
131
- ['id', 'type'],
132
- 'nodes'
133
- )
134
- cb()
135
- }
136
- const onSelectComputeResourceTree = (node: UI_I_TreeNode): void => {
137
- $recursion.findAndActivate(
138
- nodes.value,
139
- [node.type, node.id],
140
- ['type', 'id'],
141
- 'nodes'
142
- )
143
- }
144
- const compatibilityText = computed<[string, string]>(() => {
145
- const { selectedNode } = computeResourceDataLocal.value
146
-
147
- if (!selectedNode) return ['Success', '']
148
-
149
- let res: [string, string] = ['Success', 'compatibilityChecksSucceeded']
150
-
151
- if (selectedNode.type === 'datacenter' || selectedNode.type === 'folder') {
152
- res = ['Error', 'selectValidClusterOrHostDestination']
153
- }
154
- if (selectedNode.type === 'cluster') {
155
- const hasHost = !!selectedNode.nodes.length
156
- if (!hasHost) {
157
- res = ['Error', 'clusterNotContainAnyHosts']
158
- }
159
- }
160
-
161
- if (selectedNode.type === 'host') {
162
- if (selectedNode.state === 'Error') {
163
- // TODO check Maintenance Mode
164
- res = ['Error', 'selectedHostDisconnectedMaintenanceMode']
165
- }
166
- }
167
-
168
- return res
169
- })
170
-
171
- const errorMessages = ref<string[]>([])
172
- const onHideErrorMessageAlert = (): void => {
173
- errorMessages.value = []
174
- }
175
-
176
- const checkValidityBlock = (): boolean => {
177
- const hasSelectedData = Object.values(computeResourceDataLocal.value).some(
178
- (value) => value !== null
179
- )
180
-
181
- if (!hasSelectedData) {
182
- const errorText = localization.value.common.selectValidDestinationComputeResource
183
-
184
- errorMessages.value = [errorText]
185
- return false
186
- }
187
-
188
- onHideErrorMessageAlert()
189
- emits('next-step', {
190
- ...computeResourceDataLocal.value,
191
- })
192
- return true
193
- }
194
- watch(
195
- () => props.submit,
196
- () => {
197
- checkValidityBlock()
198
- }
199
- )
200
- </script>
201
-
202
- <style lang="scss" scoped>
203
- .compute-resource {
204
- .tree-view-wrap {
205
- max-height: 250px;
206
- min-height: 200px;
207
- position: relative;
208
- border: 1px solid #000;
209
- padding: 5px 0 0 5px;
210
- overflow: auto;
211
- }
212
- &__tabs {
213
- width: 100%;
214
- :deep(.nav) {
215
- margin-top: 0;
216
- }
217
- }
218
- }
219
- </style>
@@ -1,28 +0,0 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
3
- export const vmMigrateComputeResourceTabsFunc = (
4
- localization: UI_I_Localization
5
- ): UI_I_CollapseNavItem[] => {
6
- return [
7
- {
8
- text: localization.common.hosts,
9
- value: 'host',
10
- disabled: false,
11
- },
12
- {
13
- text: localization.common.clusters,
14
- value: 'cluster',
15
- disabled: false,
16
- },
17
- {
18
- text: localization.common.resourcePools,
19
- value: 'resource-pool',
20
- disabled: false,
21
- },
22
- {
23
- text: localization.common.vApps,
24
- value: 'v-apps',
25
- disabled: false,
26
- },
27
- ]
28
- }
@@ -1,6 +0,0 @@
1
- export enum UI_E_ComputeResourceTabKamelKeys {
2
- host = 'host',
3
- cluster = 'cluster',
4
- 'resource-pool' = 'resourcePool',
5
- 'v-apps' = 'vApps',
6
- }
@@ -1,30 +0,0 @@
1
- import type { UI_T_ComputeResourceTableItem } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/types'
2
- import type {
3
- UI_I_HostTableItem,
4
- UI_I_ClusterTableItem,
5
- UI_I_ResourcePoolsTableItem,
6
- UI_I_VAppsTableItem,
7
- } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/models/interfaces'
8
- import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
9
- import type { API_UI_I_DataTable } from '~/lib/models/table/interfaces'
10
-
11
- export interface UI_I_SelectedTableDataKeys {
12
- host: UI_I_HostTableItem | null
13
- cluster: UI_I_ClusterTableItem | null
14
- 'resource-pool': UI_I_ResourcePoolsTableItem | null
15
- 'v-apps': UI_I_VAppsTableItem | null
16
- }
17
-
18
- export interface UI_I_ComputeResourceDataLocal {
19
- selectedNode: UI_I_TreeNode | null
20
- host: UI_I_HostTableItem | null
21
- cluster: UI_I_ClusterTableItem | null
22
- resourcePool: UI_I_ResourcePoolsTableItem | null
23
- vApps: UI_I_VAppsTableItem | null
24
- }
25
-
26
- export interface API_UI_I_ComputeResourceTableData
27
- extends API_UI_I_DataTable<UI_T_ComputeResourceTableItem[]> {}
28
-
29
- export interface UI_I_ComputeResourceTableData
30
- extends API_UI_I_ComputeResourceTableData {}
@@ -1,12 +0,0 @@
1
- import type {
2
- UI_I_HostTableItem,
3
- UI_I_ClusterTableItem,
4
- UI_I_ResourcePoolsTableItem,
5
- UI_I_VAppsTableItem,
6
- } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/models/interfaces'
7
-
8
- export type UI_T_ComputeResourceTableItem =
9
- | UI_I_HostTableItem
10
- | UI_I_ClusterTableItem
11
- | UI_I_ResourcePoolsTableItem
12
- | UI_I_VAppsTableItem
@@ -1,143 +0,0 @@
1
- <template>
2
- <div class="data-table-view">
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
- :head-items="headItems"
9
- :body-items="bodyItems"
10
- :total-items="props.totalItems"
11
- :total-pages="props.totalPages"
12
- :loading="loading"
13
- class="data-table"
14
- test-id="compute-resource-table"
15
- server-off
16
- hide-page-size
17
- hide-pagination
18
- >
19
- <template #icon="{ item }">
20
- <span :class="['datagrid-cell-icon', item.data.iconClassName]" />
21
-
22
- <span class="text-ellipsis">
23
- {{ item.text }}
24
- </span>
25
- </template>
26
- <template #progress="{ item }">
27
- <div class="flex-align-center w-100">
28
- <div class="progress flex-1">
29
- <progress class="progress-block" :max="100" :value="item.data" />
30
- </div>
31
- <span class="text-ellipsis ml-1" :title="item.text">{{
32
- item.text
33
- }}</span>
34
- </div>
35
- </template>
36
- </atoms-table-data-grid>
37
- </div>
38
- </template>
39
-
40
- <script lang="ts" setup>
41
- import type { UI_I_Localization } from '~/lib/models/interfaces'
42
- import type {
43
- UI_I_ColumnKey,
44
- UI_I_HeadItem,
45
- UI_I_BodyItem,
46
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
47
- import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/lib/models/types'
48
- import type { UI_I_TablePayload, UI_I_Pagination } from '~/lib/models/table/interfaces'
49
- import type { UI_T_ComputeResourceTableItem } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/types'
50
- import * as hostTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/config/hostTable'
51
- import * as clusterTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/config/clusterTable'
52
- import * as resourcePoolTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/config/resourcePoolTable'
53
- import * as vAppsTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/config/vappsTable'
54
-
55
- const props = defineProps<{
56
- getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
57
- selectedData: number
58
- dataTable: UI_T_ComputeResourceTableItem[]
59
- totalItems: number
60
- totalPages: number
61
- type: UI_T_SelectComputeResourceTabType
62
- }>()
63
- const emits = defineEmits<{
64
- (event: 'update:selected-data', value: number): void
65
- }>()
66
-
67
- const localization = computed<UI_I_Localization>(() => useLocal())
68
-
69
- const loading = ref<boolean>(false)
70
- const pagination = ref<UI_I_Pagination>({
71
- page: 1,
72
- pageSize: 100,
73
- })
74
-
75
- const table: any = {
76
- host: hostTable,
77
- cluster: clusterTable,
78
- 'resource-pool': resourcePoolTable,
79
- 'v-apps': vAppsTable,
80
- }
81
-
82
- const getData = async (
83
- type: UI_T_SelectComputeResourceTabType
84
- ): Promise<void> => {
85
- const payload: UI_I_TablePayload = {
86
- pagination: pagination.value,
87
- sortBy: null,
88
- schema: 'full',
89
- type,
90
- }
91
-
92
- props.getComputeResourceData(payload).then(() => {})
93
- }
94
- watch(
95
- () => props.type,
96
- (newValue: UI_T_SelectComputeResourceTabType) => {
97
- getData(newValue)
98
- },
99
- { deep: true, immediate: true }
100
- )
101
-
102
- const headItems = computed<UI_I_HeadItem[]>(() =>
103
- table[props.type].headItems(localization.value)
104
- )
105
- const columnKeys = computed<UI_I_ColumnKey[]>(() =>
106
- table[props.type].columnKeys(localization.value)
107
- )
108
- watch(localization, () => {
109
- columnKeys.value = table[props.type].columnKeys(localization.value)
110
- })
111
-
112
- const bodyItems = computed<UI_I_BodyItem[][]>(() => {
113
- return table[props.type].bodyItems(props.dataTable, localization.value)
114
- })
115
-
116
- const selectedRow = computed<number>({
117
- get() {
118
- return props.selectedData
119
- },
120
- set(newValue: number) {
121
- emits('update:selected-data', newValue)
122
- },
123
- })
124
- </script>
125
-
126
- <style lang="scss" scoped>
127
- @import 'assets/scss/common/mixins.scss';
128
- .data-table-view {
129
- @include flex($dir: column);
130
- overflow: hidden;
131
- height: inherit;
132
- max-height: 250px;
133
- .data-table {
134
- @include flex($dir: column);
135
- flex-direction: column;
136
- overflow: hidden;
137
- height: inherit;
138
- :deep(.datagrid-outer-wrapper) {
139
- height: inherit;
140
- }
141
- }
142
- }
143
- </style>
@@ -1,113 +0,0 @@
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 type { UI_I_ClusterTableItem } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/models/interfaces'
8
- import { clusterTableItemKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/config/tableKeys'
9
- import {
10
- constructColumnKey,
11
- constructHeadItem,
12
- } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
13
-
14
- const getItems = (
15
- localization: UI_I_Localization
16
- ): [string, boolean, string, string][] => {
17
- return [
18
- [localization.common.name, true, '180px', clusterTableItemKeys[0]],
19
- [localization.common.availableCpu, true, '180px', clusterTableItemKeys[1]],
20
- [localization.common.availableMemory, true, '180px', clusterTableItemKeys[2]],
21
- [localization.common.availableStorage, true, '180px', clusterTableItemKeys[3]],
22
- [localization.common.vSphere_DRS, true, '180px', clusterTableItemKeys[4]],
23
- [localization.common.vSphere_HA, true, '180px', clusterTableItemKeys[5]],
24
- [localization.common.totalCpu, false, '180px', clusterTableItemKeys[6]],
25
- [localization.common.totalMemory, false, '180px', clusterTableItemKeys[7]],
26
- [localization.common.totalStorage, false, '180px', clusterTableItemKeys[8]],
27
- [localization.common.vms, false, '180px', clusterTableItemKeys[9]],
28
- [localization.common.hosts, false, '180px', clusterTableItemKeys[10]],
29
- [localization.common.cpus, false, '180px', clusterTableItemKeys[11]],
30
- [localization.common.datastores, false, '180px', clusterTableItemKeys[12]],
31
- [localization.common.vSAN, false, '180px', clusterTableItemKeys[13]],
32
- [localization.common.vc, false, '180px', clusterTableItemKeys[14]],
33
- [localization.common.evcCpuMode, true, '180px', clusterTableItemKeys[15]],
34
- [localization.common.evcGraphicsMode, true, '240px', clusterTableItemKeys[16]],
35
- ]
36
- }
37
-
38
- export const columnKeys = (
39
- localization: UI_I_Localization
40
- ): UI_I_ColumnKey[] => {
41
- const result: UI_I_ColumnKey[] = []
42
- getItems(localization).forEach((item, i) => {
43
- const col = i === 0 ? 'icon' : `col${i}`
44
- result.push(constructColumnKey(col, item[0], item[1]))
45
- })
46
- return result
47
- }
48
-
49
- export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
50
- const result: UI_I_HeadItem[] = []
51
- getItems(localization).forEach((item, i) => {
52
- const col = i === 0 ? 'icon' : `col${i}`
53
- result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
54
- })
55
- return result
56
- }
57
-
58
- export const bodyItems = (data: UI_I_ClusterTableItem[]): UI_I_BodyItem[][] => {
59
- const { $binary } = useNuxtApp()
60
-
61
- const bodyItems: UI_I_BodyItem[][] = []
62
- data.forEach((cluster, key) => {
63
- bodyItems.push([
64
- {
65
- key: 'icon',
66
- text: cluster[clusterTableItemKeys[0]],
67
- data: { iconClassName: 'vsphere-icon-cluster' },
68
- id: key,
69
- },
70
- {
71
- key: 'col1',
72
- text: $binary.roundHz(cluster[clusterTableItemKeys[1]]),
73
- id: key,
74
- },
75
- {
76
- key: 'col2',
77
- text: $binary.round(cluster[clusterTableItemKeys[2]]),
78
- id: key,
79
- },
80
- {
81
- key: 'col3',
82
- text: $binary.round(cluster[clusterTableItemKeys[3]]),
83
- id: key,
84
- },
85
- { key: 'col4', text: cluster[clusterTableItemKeys[4]], id: key },
86
- { key: 'col5', text: cluster[clusterTableItemKeys[5]], id: key },
87
- {
88
- key: 'col6',
89
- text: $binary.roundHz(cluster[clusterTableItemKeys[6]]),
90
- id: key,
91
- },
92
- {
93
- key: 'col7',
94
- text: $binary.round(cluster[clusterTableItemKeys[7]]),
95
- id: key,
96
- },
97
- {
98
- key: 'col8',
99
- text: $binary.round(cluster[clusterTableItemKeys[8]]),
100
- id: key,
101
- },
102
- { key: 'col9', text: cluster[clusterTableItemKeys[9]], id: key },
103
- { key: 'col10', text: cluster[clusterTableItemKeys[10]], id: key },
104
- { key: 'col11', text: cluster[clusterTableItemKeys[11]], id: key },
105
- { key: 'col12', text: cluster[clusterTableItemKeys[12]], id: key },
106
- { key: 'col13', text: cluster[clusterTableItemKeys[13]], id: key },
107
- { key: 'col14', text: cluster[clusterTableItemKeys[14]], id: key },
108
- { key: 'col15', text: cluster[clusterTableItemKeys[15]], id: key },
109
- { key: 'col16', text: cluster[clusterTableItemKeys[16]], id: key },
110
- ])
111
- })
112
- return bodyItems
113
- }
@@ -1,124 +0,0 @@
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
- }