bfg-common 1.2.178 → 1.2.179
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 +3 -1
- package/assets/localization/local_en.json +3 -1
- package/assets/localization/local_hy.json +3 -1
- package/assets/localization/local_kk.json +3 -1
- package/assets/localization/local_ru.json +3 -1
- package/assets/localization/local_zh.json +3 -1
- package/assets/scss/common/icons/icons-2.scss +222 -222
- package/components/atoms/switch/Switch.vue +107 -107
- package/components/atoms/table/dataGrid/DataGrid.vue +1489 -1490
- package/components/common/BadBrowser.vue +114 -114
- package/components/common/adapterManager/AddAdapterWarningModal.vue +82 -82
- package/components/common/adapterManager/NoActiveAdaptersModal.vue +62 -62
- package/components/common/adapterManager/NoConnectedActiveAdaptersModal.vue +62 -62
- package/components/common/browse/blocks/Title.vue +66 -66
- package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +339 -339
- package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +202 -202
- package/components/common/diagramMain/modals/remove/RemoveModal.vue +226 -226
- package/components/common/feedback/Feedback.vue +261 -261
- package/components/common/feedback/VisitPortal.vue +53 -53
- package/components/common/help/navbar/left/utils/constructAccordion.ts +27 -27
- package/components/common/recursionTree/RecursionTree.vue +201 -201
- package/components/common/tools/Actions.vue +167 -164
- package/components/common/vm/actions/clone/Clone.vue +545 -545
- package/components/common/vm/actions/clone/select/options/Options.vue +65 -65
- package/components/common/vm/actions/clone/utils.ts +43 -43
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +109 -109
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +394 -394
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +234 -234
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/config/options.ts +28 -28
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +316 -316
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/config/memoryOptions.ts +35 -35
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +447 -447
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +77 -77
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/reservation/Reservation.vue +235 -235
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +177 -177
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +197 -197
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +181 -181
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/CopyPaste.vue +51 -51
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +253 -253
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +55 -55
- package/components/common/vm/actions/common/select/storage/config/config.ts +154 -154
- package/components/common/vm/utils/powerActions.ts +55 -55
- package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +54 -54
- package/components/common/wizards/vm/migrate/Migrate.vue +13 -2
- package/components/common/wizards/vm/migrate/config/constructDataReady.ts +1 -2
- package/components/common/wizards/vm/migrate/models/interfaces.ts +4 -0
- package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +45 -8
- package/components/common/wizards/vm/migrate/select/computeResource/models/enums.ts +6 -0
- package/components/common/wizards/vm/migrate/select/computeResource/models/interfaces.ts +30 -0
- package/components/common/wizards/vm/migrate/select/computeResource/models/types.ts +12 -0
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/TableView.vue +78 -26
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/hostTable.ts +16 -33
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/models/interfaces.ts +29 -0
- package/components/common/wizards/vm/migrate/select/priority/config/typeOptions.ts +2 -2
- package/components/common/wizards/vm/migrate/select/priority/models/types.ts +1 -1
- package/components/common/wizards/vm/migrate/select/storage/Storage.vue +27 -17
- package/components/layout/theHeader/utils/localization.ts +32 -32
- package/composables/useLocal.ts +38 -38
- package/minify.js +146 -146
- package/models/composables/useMyFetch/interfaces.ts +25 -25
- package/models/interfaces.ts +49 -49
- package/models/store/interfaces.ts +37 -37
- package/models/store/storage/interfaces.ts +32 -32
- package/models/store/types.ts +43 -43
- package/modules/fixContentBuild/utils/methods.ts +114 -114
- package/package.json +1 -1
- package/public/spice-console/application/codec.js +257 -257
- package/public/spice-console/lib/rasterEngine.js +907 -907
- package/public/spice-console/network/spicechannel.js +369 -369
- package/utils/contentBuild.ts +34 -34
- package/utils/sendTask.ts +77 -77
|
@@ -30,8 +30,11 @@
|
|
|
30
30
|
/>
|
|
31
31
|
|
|
32
32
|
<common-wizards-vm-migrate-select-compute-resource-table-view
|
|
33
|
-
v-model:selected-data="
|
|
34
|
-
:data
|
|
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"
|
|
35
38
|
:type="activeTab"
|
|
36
39
|
/>
|
|
37
40
|
</template>
|
|
@@ -48,13 +51,18 @@
|
|
|
48
51
|
import type { UI_I_Localization } from '~/models/interfaces'
|
|
49
52
|
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/models/interfaces'
|
|
50
53
|
import type { UI_I_TreeNode } from '~/components/common/recursionTree/models/interfaces'
|
|
54
|
+
import type { UI_I_TablePayload } from '~/models/store/interfaces'
|
|
51
55
|
import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
56
|
+
import type { UI_E_ComputeResourceTabKamelKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/models/enums'
|
|
52
57
|
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
58
|
+
import type { UI_I_SelectedTableDataKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/models/interfaces'
|
|
53
59
|
import { vmMigrateComputeResourceTabsFunc } from '~/components/common/wizards/vm/migrate/select/computeResource/config/tabsPannel'
|
|
54
60
|
|
|
55
61
|
const props = defineProps<{
|
|
56
62
|
submit: number
|
|
63
|
+
getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
|
|
57
64
|
migrateType: UI_T_VmMigrateType
|
|
65
|
+
computeResourceData: any
|
|
58
66
|
computeResourceTree: UI_I_TreeNode
|
|
59
67
|
}>()
|
|
60
68
|
const emits = defineEmits<{
|
|
@@ -71,10 +79,35 @@ const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
|
|
|
71
79
|
|
|
72
80
|
const computeResourceDataLocal = ref<any>({
|
|
73
81
|
selectedNode: null,
|
|
82
|
+
host: null,
|
|
83
|
+
cluster: null,
|
|
84
|
+
resourcePool: null,
|
|
85
|
+
vApps: null,
|
|
74
86
|
})
|
|
75
87
|
|
|
76
|
-
const
|
|
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
|
+
)
|
|
77
109
|
|
|
110
|
+
const nodes = ref<UI_I_TreeNode[]>([])
|
|
78
111
|
watch(
|
|
79
112
|
props.computeResourceTree,
|
|
80
113
|
(newValue) => {
|
|
@@ -140,16 +173,20 @@ const onHideErrorMessageAlert = (): void => {
|
|
|
140
173
|
errorMessages.value = []
|
|
141
174
|
}
|
|
142
175
|
|
|
143
|
-
const selectedData = ref([])
|
|
144
|
-
|
|
145
176
|
const checkValidityBlock = (): boolean => {
|
|
146
|
-
|
|
177
|
+
const hasSelectedData = Object.values(computeResourceDataLocal.value).some(
|
|
178
|
+
(value) => value !== null
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
if (!hasSelectedData) {
|
|
147
182
|
const errorText = localization.value.selectValidDestinationComputeResource
|
|
148
|
-
|
|
183
|
+
|
|
149
184
|
errorMessages.value = [errorText]
|
|
150
185
|
return false
|
|
151
186
|
}
|
|
152
|
-
emits('next-step', {
|
|
187
|
+
emits('next-step', {
|
|
188
|
+
...computeResourceDataLocal.value,
|
|
189
|
+
})
|
|
153
190
|
return true
|
|
154
191
|
}
|
|
155
192
|
watch(
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UI_T_ComputeResourceTableItem } from '~/components/common/wizards/vm/migrate/select/computeResource/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/models/interfaces'
|
|
8
|
+
import type { UI_I_TreeNode } from '~/components/common/recursionTree/models/interfaces'
|
|
9
|
+
import type { API_UI_I_DataTable } from '~/models/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 {}
|
|
@@ -0,0 +1,12 @@
|
|
|
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/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,20 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="table-
|
|
2
|
+
<div class="data-table-view">
|
|
3
3
|
<atoms-table-data-grid
|
|
4
4
|
v-model:selected-row="selectedRow"
|
|
5
5
|
v-model:column-keys="columnKeys"
|
|
6
6
|
v-model:page-size="pagination.pageSize"
|
|
7
7
|
v-model:page="pagination.page"
|
|
8
|
-
type="checkbox"
|
|
9
8
|
:head-items="headItems"
|
|
10
9
|
:body-items="bodyItems"
|
|
11
|
-
:total-items="
|
|
12
|
-
:total-pages="
|
|
10
|
+
:total-items="props.totalItems"
|
|
11
|
+
:total-pages="props.totalPages"
|
|
12
|
+
:loading="loading"
|
|
13
|
+
class="data-table"
|
|
13
14
|
server-off
|
|
14
|
-
hide-footer
|
|
15
15
|
hide-page-size
|
|
16
|
-
|
|
16
|
+
hide-pagination
|
|
17
17
|
>
|
|
18
|
+
<template #icon="{ item }">
|
|
19
|
+
<span :class="['datagrid-cell-icon', item.data.iconClassName]" />
|
|
20
|
+
|
|
21
|
+
<span class="text-ellipsis">
|
|
22
|
+
{{ item.text }}
|
|
23
|
+
</span>
|
|
24
|
+
</template>
|
|
25
|
+
<template #progress="{ item }">
|
|
26
|
+
<div class="flex-align-center w-100">
|
|
27
|
+
<div class="progress flex-1">
|
|
28
|
+
<progress class="progress-block" :max="100" :value="item.data" />
|
|
29
|
+
</div>
|
|
30
|
+
<span class="text-ellipsis ml-1" :title="item.text">{{
|
|
31
|
+
item.text
|
|
32
|
+
}}</span>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
18
35
|
</atoms-table-data-grid>
|
|
19
36
|
</div>
|
|
20
37
|
</template>
|
|
@@ -26,24 +43,34 @@ import type {
|
|
|
26
43
|
UI_I_HeadItem,
|
|
27
44
|
UI_I_BodyItem,
|
|
28
45
|
} 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
46
|
import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
47
|
+
import type { UI_I_TablePayload } from '~/models/store/interfaces'
|
|
48
|
+
import type { UI_T_ComputeResourceTableItem } from '~/components/common/wizards/vm/migrate/select/computeResource/models/types'
|
|
31
49
|
import * as hostTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/hostTable'
|
|
32
50
|
import * as clusterTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/clusterTable'
|
|
33
51
|
import * as resourcePoolTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/resourcePoolTable'
|
|
34
52
|
import * as vAppsTable from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/vappsTable'
|
|
35
53
|
|
|
36
54
|
const props = defineProps<{
|
|
37
|
-
|
|
38
|
-
|
|
55
|
+
getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
|
|
56
|
+
selectedData: number
|
|
57
|
+
dataTable: UI_T_ComputeResourceTableItem[]
|
|
58
|
+
totalItems: number
|
|
59
|
+
totalPages: number
|
|
39
60
|
type: UI_T_SelectComputeResourceTabType
|
|
40
61
|
}>()
|
|
41
62
|
const emits = defineEmits<{
|
|
42
|
-
(event: 'update:selected-data', value: number
|
|
63
|
+
(event: 'update:selected-data', value: number): void
|
|
43
64
|
}>()
|
|
44
65
|
|
|
45
66
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
46
67
|
|
|
68
|
+
const loading = ref<boolean>(false)
|
|
69
|
+
const pagination = ref<UI_I_Pagination>({
|
|
70
|
+
page: 1,
|
|
71
|
+
pageSize: 100,
|
|
72
|
+
})
|
|
73
|
+
|
|
47
74
|
const table: any = {
|
|
48
75
|
host: hostTable,
|
|
49
76
|
cluster: clusterTable,
|
|
@@ -51,6 +78,26 @@ const table: any = {
|
|
|
51
78
|
'v-apps': vAppsTable,
|
|
52
79
|
}
|
|
53
80
|
|
|
81
|
+
const getData = async (
|
|
82
|
+
type: UI_T_SelectComputeResourceTabType
|
|
83
|
+
): Promise<void> => {
|
|
84
|
+
const payload: UI_I_TablePayload = {
|
|
85
|
+
pagination: pagination.value,
|
|
86
|
+
sortBy: null,
|
|
87
|
+
schema: 'full',
|
|
88
|
+
type,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
props.getComputeResourceData(payload).then(() => {})
|
|
92
|
+
}
|
|
93
|
+
watch(
|
|
94
|
+
() => props.type,
|
|
95
|
+
(newValue: UI_T_SelectComputeResourceTabType) => {
|
|
96
|
+
getData(newValue)
|
|
97
|
+
},
|
|
98
|
+
{ deep: true, immediate: true }
|
|
99
|
+
)
|
|
100
|
+
|
|
54
101
|
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
55
102
|
table[props.type].headItems(localization.value)
|
|
56
103
|
)
|
|
@@ -62,29 +109,34 @@ watch(localization, () => {
|
|
|
62
109
|
})
|
|
63
110
|
|
|
64
111
|
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,
|
|
112
|
+
return table[props.type].bodyItems(props.dataTable, localization.value)
|
|
72
113
|
})
|
|
73
114
|
|
|
74
|
-
const
|
|
75
|
-
const [column, status] = data
|
|
76
|
-
const direction = status ? 'asc' : 'desc'
|
|
77
|
-
sort.value = `${column}.${direction}`
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const selectedRow = computed<number[]>({
|
|
115
|
+
const selectedRow = computed<number>({
|
|
81
116
|
get() {
|
|
82
117
|
return props.selectedData
|
|
83
118
|
},
|
|
84
|
-
set(newValue: number
|
|
119
|
+
set(newValue: number) {
|
|
85
120
|
emits('update:selected-data', newValue)
|
|
86
121
|
},
|
|
87
122
|
})
|
|
88
123
|
</script>
|
|
89
124
|
|
|
90
|
-
<style lang="scss" scoped
|
|
125
|
+
<style lang="scss" scoped>
|
|
126
|
+
@import 'assets/scss/common/mixins.scss';
|
|
127
|
+
.data-table-view {
|
|
128
|
+
@include flex($dir: column);
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
height: inherit;
|
|
131
|
+
max-height: 250px;
|
|
132
|
+
.data-table {
|
|
133
|
+
@include flex($dir: column);
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
height: inherit;
|
|
137
|
+
:deep(.datagrid-outer-wrapper) {
|
|
138
|
+
height: inherit;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
</style>
|
package/components/common/wizards/vm/migrate/select/computeResource/tableView/config/hostTable.ts
CHANGED
|
@@ -12,9 +12,8 @@ import {
|
|
|
12
12
|
hostIconByState,
|
|
13
13
|
hostLocalizationByState,
|
|
14
14
|
} from '~/components/common/config/states'
|
|
15
|
+
import type { UI_I_HostTableItem } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/models/interfaces'
|
|
15
16
|
// 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
17
|
import { hostTableItemKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/tableView/config/tableKeys'
|
|
19
18
|
|
|
20
19
|
const getItems = (
|
|
@@ -24,7 +23,7 @@ const getItems = (
|
|
|
24
23
|
[localization.name, true, '180px', hostTableItemKeys[0]],
|
|
25
24
|
[localization.state, true, '96px', hostTableItemKeys[1]],
|
|
26
25
|
[localization.cluster, true, '180px', hostTableItemKeys[2]],
|
|
27
|
-
[localization.faultDomain,
|
|
26
|
+
[localization.faultDomain, false, '180px', hostTableItemKeys[3]],
|
|
28
27
|
[`${localization.consumedCpu} %`, true, '180px', hostTableItemKeys[4]],
|
|
29
28
|
[`${localization.consumedMemory} %`, true, '180px', hostTableItemKeys[5]],
|
|
30
29
|
[localization.haState, true, '180px', hostTableItemKeys[6]],
|
|
@@ -48,8 +47,7 @@ export const columnKeys = (
|
|
|
48
47
|
): UI_I_ColumnKey[] => {
|
|
49
48
|
const result: UI_I_ColumnKey[] = []
|
|
50
49
|
getItems(localization).forEach((item, i) => {
|
|
51
|
-
const col =
|
|
52
|
-
i === 0 ? 'icon' : i === 5 || i === 6 ? 'progress' : `col${i + 1}`
|
|
50
|
+
const col = i === 0 ? 'icon' : i === 4 || i === 5 ? 'progress' : `col${i}`
|
|
53
51
|
result.push(constructColumnKey(col, item[0], item[1]))
|
|
54
52
|
})
|
|
55
53
|
return result
|
|
@@ -58,38 +56,24 @@ export const columnKeys = (
|
|
|
58
56
|
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
59
57
|
const result: UI_I_HeadItem[] = []
|
|
60
58
|
getItems(localization).forEach((item, i) => {
|
|
61
|
-
const col =
|
|
62
|
-
i === 0 ? 'icon' : i === 5 || i === 6 ? 'progress' : `col${i + 1}`
|
|
59
|
+
const col = i === 0 ? 'icon' : i === 4 || i === 5 ? 'progress' : `col${i}`
|
|
63
60
|
result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
|
|
64
61
|
})
|
|
65
62
|
return result
|
|
66
63
|
}
|
|
67
64
|
|
|
68
65
|
export const bodyItems = (
|
|
69
|
-
data:
|
|
66
|
+
data: UI_I_HostTableItem[],
|
|
70
67
|
localization: UI_I_Localization
|
|
71
68
|
): UI_I_BodyItem[][] => {
|
|
72
69
|
const { $number } = useNuxtApp()
|
|
73
70
|
|
|
74
71
|
const bodyItems: UI_I_BodyItem[][] = []
|
|
75
72
|
data.forEach((host, key) => {
|
|
76
|
-
const hostData
|
|
73
|
+
const hostData = {
|
|
77
74
|
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
75
|
}
|
|
85
76
|
|
|
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
77
|
bodyItems.push([
|
|
94
78
|
{
|
|
95
79
|
key: 'icon',
|
|
@@ -98,17 +82,16 @@ export const bodyItems = (
|
|
|
98
82
|
id: key,
|
|
99
83
|
},
|
|
100
84
|
{
|
|
101
|
-
key: '
|
|
85
|
+
key: 'col1',
|
|
102
86
|
text: localization[hostLocalizationByState[host[hostTableItemKeys[1]]]],
|
|
103
87
|
id: key,
|
|
104
88
|
},
|
|
105
89
|
{
|
|
106
|
-
key: '
|
|
90
|
+
key: 'col2',
|
|
107
91
|
text: host[hostTableItemKeys[2]],
|
|
108
|
-
data: clusterData,
|
|
109
92
|
id: key,
|
|
110
93
|
},
|
|
111
|
-
{ key: '
|
|
94
|
+
{ key: 'col3', text: host[hostTableItemKeys[3]], id: key },
|
|
112
95
|
{
|
|
113
96
|
key: 'progress',
|
|
114
97
|
text: `${host[hostTableItemKeys[4]].toFixed(2)}%`,
|
|
@@ -121,19 +104,19 @@ export const bodyItems = (
|
|
|
121
104
|
data: host[hostTableItemKeys[5]],
|
|
122
105
|
id: key,
|
|
123
106
|
},
|
|
124
|
-
{ key: '
|
|
125
|
-
{ key: '
|
|
126
|
-
{ key: '
|
|
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 },
|
|
127
110
|
{
|
|
128
|
-
key: '
|
|
111
|
+
key: 'col9',
|
|
129
112
|
text: `${$number.format(host[hostTableItemKeys[9]], 'en')} ${
|
|
130
113
|
localization.mb
|
|
131
114
|
}`,
|
|
132
115
|
id: key,
|
|
133
116
|
},
|
|
134
|
-
{ key: '
|
|
135
|
-
{ key: '
|
|
136
|
-
{ key: '
|
|
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 },
|
|
137
120
|
{ key: 'col14', text: host[hostTableItemKeys[13]], id: key },
|
|
138
121
|
])
|
|
139
122
|
})
|
package/components/common/wizards/vm/migrate/select/computeResource/tableView/models/interfaces.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
export interface UI_I_ClusterTableItem extends API_UI_I_ClusterTableItem {}
|
|
23
|
+
|
|
24
|
+
export interface API_UI_I_ResourcePoolsTableItem {}
|
|
25
|
+
export interface UI_I_ResourcePoolsTableItem
|
|
26
|
+
extends API_UI_I_ResourcePoolsTableItem {}
|
|
27
|
+
|
|
28
|
+
export interface API_UI_I_VAppsTableItem {}
|
|
29
|
+
export interface UI_I_VAppsTableItem extends API_UI_I_VAppsTableItem {}
|
|
@@ -7,13 +7,13 @@ export const vmMigrateSelectPriorityTypesFunc = (
|
|
|
7
7
|
return [
|
|
8
8
|
{
|
|
9
9
|
label: localization.scheduleVMotionWithHighPriority,
|
|
10
|
-
value: 'high
|
|
10
|
+
value: 'high',
|
|
11
11
|
disabled: false,
|
|
12
12
|
description: localization.scheduleVMotionWithHighPriorityDesc,
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
label: localization.scheduleNormalVMotion,
|
|
16
|
-
value: '
|
|
16
|
+
value: 'normal',
|
|
17
17
|
disabled: false,
|
|
18
18
|
description: localization.scheduleNormalVMotionDesc,
|
|
19
19
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type UI_T_SelectVMotionPriority = 'high
|
|
1
|
+
export type UI_T_SelectVMotionPriority = 'high' | 'normal'
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="select-storage">
|
|
3
|
+
<atoms-alert
|
|
4
|
+
v-if="errorMessages.length"
|
|
5
|
+
test-id="select-storage-alert"
|
|
6
|
+
status="alert-danger"
|
|
7
|
+
:items="errorMessages"
|
|
8
|
+
@remove="onHideErrorMessageAlert"
|
|
9
|
+
/>
|
|
10
|
+
|
|
3
11
|
<common-wizards-vm-migrate-select-storage-selected-per-disk
|
|
4
12
|
v-if="isShowSelectedPerDisks"
|
|
5
13
|
v-model="isShowSelectedPerDisks"
|
|
@@ -20,12 +28,12 @@
|
|
|
20
28
|
|
|
21
29
|
<common-wizards-vm-migrate-select-storage-configure-batch
|
|
22
30
|
v-show="activeTab === 'batch-configure'"
|
|
23
|
-
v-model:vm-disk-format="
|
|
31
|
+
v-model:vm-disk-format="selectStorageDataLocal.vmDiskFormat"
|
|
24
32
|
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
25
33
|
:datastore="props.datastore"
|
|
26
34
|
:connected-storage-id="connectedStorageId"
|
|
27
35
|
:is-hide-select-disk-format="isHideSelectDiskFormat"
|
|
28
|
-
@update-selected-datastore="
|
|
36
|
+
@update-selected-datastore="selectStorageDataLocal.storage = $event"
|
|
29
37
|
>
|
|
30
38
|
<template v-if="isShowSelectedPerDisks" #buttonConfirm>
|
|
31
39
|
<button class="btn btn-sm btn-primary" @click="onApplyChanges">
|
|
@@ -44,7 +52,7 @@
|
|
|
44
52
|
/>
|
|
45
53
|
|
|
46
54
|
<common-wizards-vm-common-validation-compatibility
|
|
47
|
-
:loading="!
|
|
55
|
+
:loading="!selectStorageDataLocal.storage"
|
|
48
56
|
:status="'Success'"
|
|
49
57
|
text="compatibilityChecksSucceeded"
|
|
50
58
|
/>
|
|
@@ -82,7 +90,11 @@ const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
|
|
|
82
90
|
vmMigrateSelectStorageTabsFunc(localization.value)
|
|
83
91
|
)
|
|
84
92
|
|
|
85
|
-
|
|
93
|
+
const errorMessages = ref<string[]>([])
|
|
94
|
+
const selectStorageDataLocal = ref<UI_I_SelectStorageDataLocal>({
|
|
95
|
+
vmDiskFormat: 0,
|
|
96
|
+
storage: null,
|
|
97
|
+
})
|
|
86
98
|
const isShowSelectedPerDisks = ref<boolean>(false)
|
|
87
99
|
|
|
88
100
|
const selectedPerDiskKeys = ref<number[]>([])
|
|
@@ -106,7 +118,7 @@ const onChangePerDiskStorage = (
|
|
|
106
118
|
event: UI_I_StorageConfigurePerDiskItem[]
|
|
107
119
|
): void => {
|
|
108
120
|
connectedStorageIdLocal.value = event[0].extra.datastore_id
|
|
109
|
-
|
|
121
|
+
selectStorageDataLocal.value.vmDiskFormat = event[0].disk_format
|
|
110
122
|
|
|
111
123
|
selectedPerDisks.value = event
|
|
112
124
|
}
|
|
@@ -122,7 +134,7 @@ const onApplyChanges = (): void => {
|
|
|
122
134
|
)!
|
|
123
135
|
|
|
124
136
|
if (selectedDisk) {
|
|
125
|
-
const { storage, vmDiskFormat } =
|
|
137
|
+
const { storage, vmDiskFormat } = selectStorageDataLocal.value
|
|
126
138
|
|
|
127
139
|
// ;({ name: disk.storage, id: disk.extra.datastore_id } = storage)
|
|
128
140
|
disk.storage = storage.name
|
|
@@ -144,23 +156,21 @@ const isHideSelectDiskFormat = computed<boolean>(() => {
|
|
|
144
156
|
selectedPerDisks.value[0].file === 'Configuration file'
|
|
145
157
|
)
|
|
146
158
|
})
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
storage: null,
|
|
151
|
-
})
|
|
159
|
+
const onHideErrorMessageAlert = (): void => {
|
|
160
|
+
errorMessages.value = []
|
|
161
|
+
}
|
|
152
162
|
|
|
153
163
|
const checkValidityBlock = (): boolean => {
|
|
154
|
-
if (!
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
164
|
+
if (!selectStorageDataLocal.value.storage) {
|
|
165
|
+
const errorText = localization.value.selectValidDestinationStorage
|
|
166
|
+
|
|
167
|
+
errorMessages.value = [errorText]
|
|
158
168
|
return false
|
|
159
169
|
}
|
|
170
|
+
onHideErrorMessageAlert()
|
|
160
171
|
const isActivePerDiskTab = activeTab.value === 'configure-disk'
|
|
161
|
-
|
|
162
172
|
emits('next-step', {
|
|
163
|
-
...
|
|
173
|
+
...selectStorageDataLocal.value,
|
|
164
174
|
tab: activeTab.value,
|
|
165
175
|
// ...(isActivePerDiskTab && { configureDisks: props.configurePerDisks }),
|
|
166
176
|
configureDisks: isActivePerDiskTab
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import type { UI_T_LangValue } from '~/models/types'
|
|
2
|
-
|
|
3
|
-
export const defineBrowserLangFunc = (): Exclude<UI_T_LangValue, 'BROWSER'> => {
|
|
4
|
-
const browserLanguage: string = navigator.language
|
|
5
|
-
|
|
6
|
-
let lang: Exclude<UI_T_LangValue, 'BROWSER'>
|
|
7
|
-
|
|
8
|
-
switch (browserLanguage.substring(0, 2)) {
|
|
9
|
-
case 'en':
|
|
10
|
-
lang = 'en_US'
|
|
11
|
-
break
|
|
12
|
-
case 'ru':
|
|
13
|
-
lang = 'ru_RU'
|
|
14
|
-
break
|
|
15
|
-
case 'hy':
|
|
16
|
-
lang = 'hy_AM'
|
|
17
|
-
break
|
|
18
|
-
case 'zh':
|
|
19
|
-
lang = 'zh_CHS'
|
|
20
|
-
break
|
|
21
|
-
case 'kk':
|
|
22
|
-
lang = 'kk_KZ'
|
|
23
|
-
break
|
|
24
|
-
case 'be':
|
|
25
|
-
lang = 'be_BY'
|
|
26
|
-
break
|
|
27
|
-
default:
|
|
28
|
-
lang = 'en_US'
|
|
29
|
-
break
|
|
30
|
-
}
|
|
31
|
-
return lang
|
|
32
|
-
}
|
|
1
|
+
import type { UI_T_LangValue } from '~/models/types'
|
|
2
|
+
|
|
3
|
+
export const defineBrowserLangFunc = (): Exclude<UI_T_LangValue, 'BROWSER'> => {
|
|
4
|
+
const browserLanguage: string = navigator.language
|
|
5
|
+
|
|
6
|
+
let lang: Exclude<UI_T_LangValue, 'BROWSER'>
|
|
7
|
+
|
|
8
|
+
switch (browserLanguage.substring(0, 2)) {
|
|
9
|
+
case 'en':
|
|
10
|
+
lang = 'en_US'
|
|
11
|
+
break
|
|
12
|
+
case 'ru':
|
|
13
|
+
lang = 'ru_RU'
|
|
14
|
+
break
|
|
15
|
+
case 'hy':
|
|
16
|
+
lang = 'hy_AM'
|
|
17
|
+
break
|
|
18
|
+
case 'zh':
|
|
19
|
+
lang = 'zh_CHS'
|
|
20
|
+
break
|
|
21
|
+
case 'kk':
|
|
22
|
+
lang = 'kk_KZ'
|
|
23
|
+
break
|
|
24
|
+
case 'be':
|
|
25
|
+
lang = 'be_BY'
|
|
26
|
+
break
|
|
27
|
+
default:
|
|
28
|
+
lang = 'en_US'
|
|
29
|
+
break
|
|
30
|
+
}
|
|
31
|
+
return lang
|
|
32
|
+
}
|