bfg-common 1.2.138 → 1.2.140
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/scss/common/utilities.scss +2 -0
- package/components/atoms/nav/NavBar.vue +1 -1
- package/components/atoms/tabs/Tabs.vue +1 -3
- package/components/common/wizards/vm/migrate/Migrate.vue +25 -5
- package/components/common/wizards/vm/migrate/config/constructDataReady.ts +28 -21
- package/components/common/wizards/vm/migrate/models/interfaces.ts +5 -1
- 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/storage/Storage.vue +2 -0
- package/components/common/wizards/vm/migrate/select/storage/configure/batch/Batch.vue +14 -14
- package/components/common/wizards/vm/migrate/select/storage/table/disk/config/config.ts +10 -37
- package/components/common/wizards/vm/migrate/select/storage/table/disk/config/tableKeys.ts +8 -0
- package/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces.ts +16 -6
- package/components/common/wizards/vm/migrate/select/storage/table/disk/models/types.ts +3 -6
- package/package.json +1 -1
|
@@ -58,7 +58,7 @@ const setTriggerElementWidth = (): void => {
|
|
|
58
58
|
if (!id.value || !props.testId) return
|
|
59
59
|
|
|
60
60
|
const element = document.querySelector(
|
|
61
|
-
`#${id.value}
|
|
61
|
+
`#${id.value} #${props.testId}-container`
|
|
62
62
|
)
|
|
63
63
|
triggerElementWidth =
|
|
64
64
|
element && element?.style?.display !== 'none'
|
|
@@ -81,9 +81,7 @@ let triggerElementWidth = 0
|
|
|
81
81
|
const setTriggerElementWidth = (): void => {
|
|
82
82
|
if (!id.value || !props.testId) return
|
|
83
83
|
|
|
84
|
-
const element = document.querySelector(
|
|
85
|
-
`#${id.value} [test-id="${props.testId}-item"]`
|
|
86
|
-
)
|
|
84
|
+
const element = document.querySelector(`#${id.value} #${props.testId}-item`)
|
|
87
85
|
if (
|
|
88
86
|
element &&
|
|
89
87
|
element?.style?.display !== 'none' &&
|
|
@@ -79,6 +79,7 @@ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/in
|
|
|
79
79
|
import type { UI_I_SelectStorageReadyData } from '~/components/common/wizards/vm/migrate/select/storage/models/interfaces'
|
|
80
80
|
import type { UI_I_MigrateVerticalStepItem } from '~/components/common/wizards/vm/migrate/models/interfaces'
|
|
81
81
|
import type { UI_T_SelectVMotionPriority } from '~/components/common/wizards/vm/migrate/select/priority/models/types'
|
|
82
|
+
import type { UI_I_CollectedDataFormLocal } from '~/components/common/wizards/vm/migrate/models/interfaces'
|
|
82
83
|
import { stepItemsFunc } from '~/components/common/wizards/vm/migrate/utils'
|
|
83
84
|
import { constructDataReadyViewFunc } from '~/components/common/wizards/vm/migrate/config/constructDataReady'
|
|
84
85
|
|
|
@@ -123,15 +124,34 @@ const connectedStorageIdOnVm = computed<string>(
|
|
|
123
124
|
() => props.vmSettings?.storage.id || ''
|
|
124
125
|
)
|
|
125
126
|
|
|
127
|
+
const dataFormLocal = ref<UI_I_CollectedDataFormLocal>({
|
|
128
|
+
selectStorage: null,
|
|
129
|
+
})
|
|
130
|
+
|
|
126
131
|
const onSelectStorageAndNext = (event: UI_I_SelectStorageReadyData): void => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
dataFormLocal.value.selectStorage = event
|
|
133
|
+
// dataReadyView.value = constructDataReadyViewFunc<UI_I_SelectStorageReadyData>(
|
|
134
|
+
// vmMigrateType.value,
|
|
135
|
+
// props.vmName,
|
|
136
|
+
// event
|
|
137
|
+
// )
|
|
132
138
|
|
|
133
139
|
onNextStep(true)
|
|
134
140
|
}
|
|
141
|
+
|
|
142
|
+
watch(
|
|
143
|
+
currentBlockId,
|
|
144
|
+
(newValue: string) => {
|
|
145
|
+
if (newValue !== 'ready-complete') return
|
|
146
|
+
|
|
147
|
+
dataReadyView.value = constructDataReadyViewFunc<any>(
|
|
148
|
+
vmMigrateType.value,
|
|
149
|
+
props.vmName,
|
|
150
|
+
dataFormLocal.value
|
|
151
|
+
)
|
|
152
|
+
},
|
|
153
|
+
{ deep: true, immediate: true }
|
|
154
|
+
)
|
|
135
155
|
const onFinish = (): void => {
|
|
136
156
|
loading.value = true
|
|
137
157
|
props.finishFunc().then(() => {
|
|
@@ -2,20 +2,25 @@ import type { UI_I_Localization } from '~/models/interfaces'
|
|
|
2
2
|
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
|
|
3
3
|
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
4
4
|
import { UI_E_VmMigrationType } from '~/components/common/wizards/vm/migrate/models/enums'
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
UI_I_CollectedDataFormLocal,
|
|
7
|
+
UI_I_MigrateReadyBlockData,
|
|
8
|
+
} from '~/components/common/wizards/vm/migrate/models/interfaces'
|
|
9
|
+
// import { UI_I_SelectStorageReadyData } from '~/components/common/wizards/vm/migrate/select/storage/models/interfaces'
|
|
7
10
|
import { vmDiskFormatOptions } from '~/components/common/wizards/vm/migrate/select/storage/diskFormat/config/formatOptions'
|
|
8
11
|
|
|
9
12
|
const storageDetailsFunc = (
|
|
10
13
|
localization: UI_I_Localization,
|
|
11
14
|
migrationType: string,
|
|
12
15
|
name: string,
|
|
13
|
-
event:
|
|
16
|
+
event: UI_I_CollectedDataFormLocal
|
|
14
17
|
): UI_I_MigrateReadyBlockData[] => {
|
|
15
|
-
const
|
|
18
|
+
const { selectStorage } = event
|
|
19
|
+
|
|
20
|
+
const isActivePerDiskTab: boolean = selectStorage.tab === 'configure-disk'
|
|
16
21
|
|
|
17
22
|
const diskFormat = vmDiskFormatOptions().find(
|
|
18
|
-
(file) => file.value ===
|
|
23
|
+
(file) => file.value === selectStorage.vmDiskFormat
|
|
19
24
|
)!
|
|
20
25
|
|
|
21
26
|
let result: UI_I_MigrateReadyBlockData[] = [
|
|
@@ -31,7 +36,7 @@ const storageDetailsFunc = (
|
|
|
31
36
|
},
|
|
32
37
|
{
|
|
33
38
|
label: localization.storage,
|
|
34
|
-
value:
|
|
39
|
+
value: selectStorage.storage?.name,
|
|
35
40
|
permissions: ['batch-configure'],
|
|
36
41
|
},
|
|
37
42
|
{
|
|
@@ -46,8 +51,8 @@ const storageDetailsFunc = (
|
|
|
46
51
|
},
|
|
47
52
|
]
|
|
48
53
|
|
|
49
|
-
if (isActivePerDiskTab &&
|
|
50
|
-
const perDiskItems: UI_I_MigrateReadyBlockData[] =
|
|
54
|
+
if (isActivePerDiskTab && selectStorage.configureDisks) {
|
|
55
|
+
const perDiskItems: UI_I_MigrateReadyBlockData[] = selectStorage.configureDisks.map(
|
|
51
56
|
(item) => ({
|
|
52
57
|
label: item.name,
|
|
53
58
|
value: `${item.file} ${item.disk_format}`,
|
|
@@ -58,26 +63,28 @@ const storageDetailsFunc = (
|
|
|
58
63
|
result = result.concat(perDiskItems)
|
|
59
64
|
}
|
|
60
65
|
|
|
61
|
-
return result.filter((option) => option.permissions.includes(
|
|
66
|
+
return result.filter((option) => option.permissions.includes(selectStorage.tab))
|
|
62
67
|
}
|
|
63
|
-
export const constructDataReadyViewFunc =
|
|
68
|
+
export const constructDataReadyViewFunc = (
|
|
64
69
|
type: UI_T_VmMigrateType,
|
|
65
70
|
name: string,
|
|
66
|
-
data:
|
|
71
|
+
data: UI_I_CollectedDataFormLocal
|
|
67
72
|
): UI_I_TableInfoItem[] => {
|
|
68
73
|
const localization: UI_I_Localization = useLocal()
|
|
69
74
|
|
|
70
|
-
const details = {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
75
|
+
// const details = {
|
|
76
|
+
// storage: storageDetailsFunc,
|
|
77
|
+
// 'resource-storage': storageDetailsFunc, // временно чтобы не было ошибка при исползоване сфере
|
|
78
|
+
// }
|
|
74
79
|
|
|
75
80
|
const migrationType = localization[UI_E_VmMigrationType[type]]
|
|
76
81
|
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
return storageDetailsFunc(localization, migrationType, name, data)
|
|
83
|
+
|
|
84
|
+
// return details[type as keyof typeof details](
|
|
85
|
+
// localization,
|
|
86
|
+
// migrationType,
|
|
87
|
+
// name,
|
|
88
|
+
// data
|
|
89
|
+
// )
|
|
83
90
|
}
|
|
@@ -2,8 +2,8 @@ import type { UI_I_VerticalStepItem } from '~/components/atoms/models/interfaces
|
|
|
2
2
|
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/models/interfaces'
|
|
3
3
|
import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
|
|
4
4
|
import type { UI_T_VmMigrateSelectStorageTab } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
5
|
+
import type { UI_I_SelectStorageReadyData } from '~/components/common/wizards/vm/migrate/select/storage/models/interfaces'
|
|
5
6
|
import type { UI_T_Project } from '~/models/types'
|
|
6
|
-
|
|
7
7
|
export interface UI_I_MigrateVerticalStepItem extends UI_I_VerticalStepItem {
|
|
8
8
|
id: string
|
|
9
9
|
project: UI_T_Project[]
|
|
@@ -14,3 +14,7 @@ export interface UI_I_MigrateVerticalStepItem extends UI_I_VerticalStepItem {
|
|
|
14
14
|
export interface UI_I_MigrateReadyBlockData extends UI_I_TableInfoItem {
|
|
15
15
|
permissions: UI_T_VmMigrateSelectStorageTab[]
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
export interface UI_I_CollectedDataFormLocal {
|
|
19
|
+
selectStorage: UI_I_SelectStorageReadyData
|
|
20
|
+
}
|
|
@@ -1,9 +1,51 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="select-network">
|
|
3
|
-
<common-wizards-vm-
|
|
3
|
+
<common-wizards-vm-migrate-select-network-table-disk
|
|
4
|
+
v-model="selected"
|
|
5
|
+
:type="tableType"
|
|
6
|
+
:data-table="[]"
|
|
7
|
+
/>
|
|
8
|
+
|
|
9
|
+
<div class="vm-migrate-advanced-view-button">
|
|
10
|
+
<button
|
|
11
|
+
class="btn btn-sm migrate-network-advanced-btn"
|
|
12
|
+
@click="isShowNetworkBasic = !isShowNetworkBasic"
|
|
13
|
+
>
|
|
14
|
+
<span v-if="isShowNetworkBasic"> ≪ </span>
|
|
15
|
+
{{ buttonText }}
|
|
16
|
+
<span v-if="!isShowNetworkBasic"> ≫ </span>
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<common-wizards-vm-common-validation-compatibility
|
|
21
|
+
:loading="false"
|
|
22
|
+
status="Success"
|
|
23
|
+
text="compatibilityChecksSucceeded"
|
|
24
|
+
/>
|
|
4
25
|
</div>
|
|
5
26
|
</template>
|
|
6
27
|
|
|
7
|
-
<script lang="ts" setup
|
|
28
|
+
<script lang="ts" setup>
|
|
29
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
30
|
+
|
|
31
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
32
|
+
|
|
33
|
+
const selected = ref<number[]>([])
|
|
34
|
+
const isShowNetworkBasic = ref<boolean>(false)
|
|
35
|
+
|
|
36
|
+
const buttonText = computed(
|
|
37
|
+
() => localization.value[isShowNetworkBasic.value ? 'basic' : 'advanced']
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
const tableType = computed<string>(() =>
|
|
41
|
+
isShowNetworkBasic.value ? 'basic' : 'advanced'
|
|
42
|
+
)
|
|
43
|
+
</script>
|
|
8
44
|
|
|
9
|
-
<style lang="scss" scoped
|
|
45
|
+
<style lang="scss" scoped>
|
|
46
|
+
.select-network {
|
|
47
|
+
.vm-migrate-advanced-view-button {
|
|
48
|
+
text-align: end;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,84 @@
|
|
|
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 * as basicTable from '~/components/common/wizards/vm/migrate/select/network/table/disk/config/basicTable'
|
|
30
|
+
import * as advancedTable from '~/components/common/wizards/vm/migrate/select/network/table/disk/config/advancedTable'
|
|
31
|
+
|
|
32
|
+
const props = defineProps<{
|
|
33
|
+
modelValue: number[]
|
|
34
|
+
dataTable: any[]
|
|
35
|
+
type: 'basic' | 'advanced'
|
|
36
|
+
}>()
|
|
37
|
+
const emits = defineEmits<{
|
|
38
|
+
(event: 'update:model-value', value: number[] | null): void
|
|
39
|
+
}>()
|
|
40
|
+
|
|
41
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
42
|
+
|
|
43
|
+
const table: any = {
|
|
44
|
+
basic: basicTable,
|
|
45
|
+
advanced: advancedTable,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
49
|
+
table[props.type].headItems(localization.value)
|
|
50
|
+
)
|
|
51
|
+
const columnKeys = computed<UI_I_ColumnKey[]>(() =>
|
|
52
|
+
table[props.type].columnKeys(localization.value)
|
|
53
|
+
)
|
|
54
|
+
watch(localization, () => {
|
|
55
|
+
columnKeys.value = table[props.type].columnKeys(localization.value)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
59
|
+
return table[props.type].bodyItems(props.dataTable)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const sort = ref<string | null>(null)
|
|
63
|
+
const pagination = ref<UI_I_Pagination>({
|
|
64
|
+
page: 1,
|
|
65
|
+
pageSize: 100,
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const sorting = (data: [string, boolean]): void => {
|
|
69
|
+
const [column, status] = data
|
|
70
|
+
const direction = status ? 'asc' : 'desc'
|
|
71
|
+
sort.value = `${column}.${direction}`
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const selectedRow = computed<number[]>({
|
|
75
|
+
get() {
|
|
76
|
+
return props.modelValue
|
|
77
|
+
},
|
|
78
|
+
set(newValue: number[]) {
|
|
79
|
+
emits('update:model-value', newValue)
|
|
80
|
+
},
|
|
81
|
+
})
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<style lang="scss" scoped></style>
|
package/components/common/wizards/vm/migrate/select/network/table/disk/config/advancedTable.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
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 { networkAdvancedTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/disk/config/tableKeys'
|
|
12
|
+
|
|
13
|
+
const getItems = (
|
|
14
|
+
localization: UI_I_Localization
|
|
15
|
+
): [string, boolean, string, string][] => {
|
|
16
|
+
return [
|
|
17
|
+
[localization.vm, true, '25%', networkAdvancedTableItemKeys[0]],
|
|
18
|
+
[localization.networkAdapter, true, '25%', networkAdvancedTableItemKeys[1]],
|
|
19
|
+
[localization.sourceNetwork, true, '25%', networkAdvancedTableItemKeys[2]],
|
|
20
|
+
[
|
|
21
|
+
localization.destinationNetwork,
|
|
22
|
+
true,
|
|
23
|
+
'25%',
|
|
24
|
+
networkAdvancedTableItemKeys[3],
|
|
25
|
+
],
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const columnKeys = (
|
|
30
|
+
localization: UI_I_Localization
|
|
31
|
+
): UI_I_ColumnKey[] => {
|
|
32
|
+
const result: UI_I_ColumnKey[] = []
|
|
33
|
+
getItems(localization).forEach((item, i) => {
|
|
34
|
+
const col = `col${i}`
|
|
35
|
+
result.push(constructColumnKey(col, item[0], item[1]))
|
|
36
|
+
})
|
|
37
|
+
return result
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
41
|
+
const result: UI_I_HeadItem[] = []
|
|
42
|
+
getItems(localization).forEach((item, i) => {
|
|
43
|
+
const col = `col${i}`
|
|
44
|
+
result.push(constructHeadItem(col, item[0], item[3], true, item[2]))
|
|
45
|
+
})
|
|
46
|
+
return result
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const bodyItems = (data: any[]): UI_I_BodyItem[][] => {
|
|
50
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
51
|
+
|
|
52
|
+
data.forEach((storage: any, key: number) => {
|
|
53
|
+
bodyItems.push([
|
|
54
|
+
{
|
|
55
|
+
key: 'col0',
|
|
56
|
+
text: storage[networkAdvancedTableItemKeys[0]],
|
|
57
|
+
id: key,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: 'col1',
|
|
61
|
+
text: storage[networkAdvancedTableItemKeys[1]],
|
|
62
|
+
id: key,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: 'col2',
|
|
66
|
+
text: storage[networkAdvancedTableItemKeys[2]],
|
|
67
|
+
id: key,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: 'col3',
|
|
71
|
+
text: storage[networkAdvancedTableItemKeys[3]],
|
|
72
|
+
id: key,
|
|
73
|
+
},
|
|
74
|
+
])
|
|
75
|
+
})
|
|
76
|
+
return bodyItems
|
|
77
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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 { networkBasicsTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/disk/config/tableKeys'
|
|
12
|
+
|
|
13
|
+
const getItems = (
|
|
14
|
+
localization: UI_I_Localization
|
|
15
|
+
): [string, boolean, string, string][] => {
|
|
16
|
+
return [
|
|
17
|
+
[localization.sourceNetwork, true, '33.3%', networkBasicsTableItemKeys[0]],
|
|
18
|
+
[localization.usedBy, true, '33.3%', networkBasicsTableItemKeys[1]],
|
|
19
|
+
[
|
|
20
|
+
localization.destinationNetwork,
|
|
21
|
+
true,
|
|
22
|
+
'33.3%',
|
|
23
|
+
networkBasicsTableItemKeys[2],
|
|
24
|
+
],
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const columnKeys = (
|
|
29
|
+
localization: UI_I_Localization
|
|
30
|
+
): UI_I_ColumnKey[] => {
|
|
31
|
+
const result: UI_I_ColumnKey[] = []
|
|
32
|
+
getItems(localization).forEach((item, i) => {
|
|
33
|
+
const col = `col${i}`
|
|
34
|
+
result.push(constructColumnKey(col, item[0], item[1]))
|
|
35
|
+
})
|
|
36
|
+
return result
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
40
|
+
const result: UI_I_HeadItem[] = []
|
|
41
|
+
getItems(localization).forEach((item, i) => {
|
|
42
|
+
const col = `col${i}`
|
|
43
|
+
result.push(constructHeadItem(col, item[0], item[3], true, item[2]))
|
|
44
|
+
})
|
|
45
|
+
return result
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const bodyItems = (data: any[]): UI_I_BodyItem[][] => {
|
|
49
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
50
|
+
|
|
51
|
+
data.forEach((storage: any, key: number) => {
|
|
52
|
+
bodyItems.push([
|
|
53
|
+
{
|
|
54
|
+
key: 'col0',
|
|
55
|
+
text: storage[networkBasicsTableItemKeys[0]],
|
|
56
|
+
id: key,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: 'col1',
|
|
60
|
+
text: storage[networkBasicsTableItemKeys[1]],
|
|
61
|
+
id: key,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
key: 'col2',
|
|
65
|
+
text: storage[networkBasicsTableItemKeys[2]],
|
|
66
|
+
id: key,
|
|
67
|
+
},
|
|
68
|
+
])
|
|
69
|
+
})
|
|
70
|
+
return bodyItems
|
|
71
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_T_NetworkBasicsTableTableKeysTuple,
|
|
3
|
+
UI_T_NetworkAdvancedTableKeysTuple,
|
|
4
|
+
} from '~/components/common/wizards/vm/migrate/select/network/table/disk/models/types'
|
|
5
|
+
|
|
6
|
+
export const networkBasicsTableItemKeys: UI_T_NetworkBasicsTableTableKeysTuple =
|
|
7
|
+
['source_network', 'used_by', 'destination_network']
|
|
8
|
+
|
|
9
|
+
export const networkAdvancedTableItemKeys: UI_T_NetworkAdvancedTableKeysTuple =
|
|
10
|
+
['vm_name', 'network_adapter', 'source_network', 'destination_network']
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
v-model:vm-disk-format="selectedVmDiskFormat"
|
|
5
5
|
/>
|
|
6
6
|
|
|
7
|
-
<common-wizards-vm-migrate-select-storage-policy
|
|
8
|
-
|
|
9
|
-
<div class="clr-checkbox-wrapper flex-align-center w-100"
|
|
10
|
-
<input
|
|
11
|
-
id="suspend-on-revert"
|
|
12
|
-
v-model="isDisableStorageDrs"
|
|
13
|
-
type="checkbox"
|
|
14
|
-
class="checkbox-btn"
|
|
15
|
-
|
|
16
|
-
<label for="suspend-on-revert" class="clr-control-label"
|
|
17
|
-
{{ localization.disableStorageDRSVirtualMachine }}
|
|
18
|
-
</label
|
|
19
|
-
</div
|
|
7
|
+
<!-- <common-wizards-vm-migrate-select-storage-policy />-->
|
|
8
|
+
|
|
9
|
+
<!-- <div class="clr-checkbox-wrapper flex-align-center w-100">-->
|
|
10
|
+
<!-- <input-->
|
|
11
|
+
<!-- id="suspend-on-revert"-->
|
|
12
|
+
<!-- v-model="isDisableStorageDrs"-->
|
|
13
|
+
<!-- type="checkbox"-->
|
|
14
|
+
<!-- class="checkbox-btn"-->
|
|
15
|
+
<!-- />-->
|
|
16
|
+
<!-- <label for="suspend-on-revert" class="clr-control-label">-->
|
|
17
|
+
<!-- {{ localization.disableStorageDRSVirtualMachine }}-->
|
|
18
|
+
<!-- </label>-->
|
|
19
|
+
<!-- </div>-->
|
|
20
20
|
|
|
21
21
|
<common-wizards-vm-migrate-select-storage-table-datastore
|
|
22
22
|
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
@@ -41,7 +41,7 @@ const props = defineProps<{
|
|
|
41
41
|
|
|
42
42
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
43
43
|
|
|
44
|
-
const isDisableStorageDrs = ref<boolean>(false)
|
|
44
|
+
// const isDisableStorageDrs = ref<boolean>(false)
|
|
45
45
|
|
|
46
46
|
const emits = defineEmits<{
|
|
47
47
|
(event: 'update-selected-datastore', value: UI_I_TablePayload): void
|
|
@@ -8,29 +8,17 @@ import {
|
|
|
8
8
|
constructColumnKey,
|
|
9
9
|
constructHeadItem,
|
|
10
10
|
} from '~/components/atoms/table/dataGrid/utils/constructDataTable'
|
|
11
|
-
import type { UI_T_StorageTableItemTuple } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/types'
|
|
12
11
|
import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces'
|
|
13
|
-
|
|
14
|
-
export const storageTableKeys: UI_T_StorageTableItemTuple = [
|
|
15
|
-
'name',
|
|
16
|
-
'disk_group',
|
|
17
|
-
'file',
|
|
18
|
-
'storage',
|
|
19
|
-
'disk_format',
|
|
20
|
-
'vm_storage_policy',
|
|
21
|
-
'replication_group',
|
|
22
|
-
]
|
|
12
|
+
import { vmMigrateDiskTableItemKeys } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/config/tableKeys'
|
|
23
13
|
const getItems = (
|
|
24
14
|
localization: UI_I_Localization
|
|
25
15
|
): [string, boolean, string, string][] => {
|
|
26
16
|
return [
|
|
27
|
-
[localization.virtualMachine, true, '96px',
|
|
28
|
-
[localization.diskGroup, false, '138px',
|
|
29
|
-
[localization.file, true, '110px',
|
|
30
|
-
[localization.storage, true, '96px',
|
|
31
|
-
[localization.diskFormat, true, '110px',
|
|
32
|
-
[localization.vmStoragePolicy, true, '110px', storageTableKeys[5]],
|
|
33
|
-
[localization.replicationGroup, true, '110px', storageTableKeys[6]],
|
|
17
|
+
[localization.virtualMachine, true, '96px', vmMigrateDiskTableItemKeys[0]],
|
|
18
|
+
[localization.diskGroup, false, '138px', vmMigrateDiskTableItemKeys[1]],
|
|
19
|
+
[localization.file, true, '110px', vmMigrateDiskTableItemKeys[2]],
|
|
20
|
+
[localization.storage, true, '96px', vmMigrateDiskTableItemKeys[3]],
|
|
21
|
+
// [localization.diskFormat, true, '110px', vmMigrateDiskTableItemKeys[4]],
|
|
34
22
|
]
|
|
35
23
|
}
|
|
36
24
|
|
|
@@ -63,37 +51,22 @@ export const bodyItems = (
|
|
|
63
51
|
bodyItems.push([
|
|
64
52
|
{
|
|
65
53
|
key: 'col0',
|
|
66
|
-
text: storage[
|
|
54
|
+
text: storage[vmMigrateDiskTableItemKeys[0]],
|
|
67
55
|
id: key,
|
|
68
56
|
},
|
|
69
57
|
{
|
|
70
58
|
key: 'col1',
|
|
71
|
-
text: storage[
|
|
59
|
+
text: storage[vmMigrateDiskTableItemKeys[1]],
|
|
72
60
|
id: key,
|
|
73
61
|
},
|
|
74
62
|
{
|
|
75
63
|
key: 'col2',
|
|
76
|
-
text: storage[
|
|
64
|
+
text: storage[vmMigrateDiskTableItemKeys[2]],
|
|
77
65
|
id: key,
|
|
78
66
|
},
|
|
79
67
|
{
|
|
80
68
|
key: 'col3',
|
|
81
|
-
text: storage[
|
|
82
|
-
id: key,
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
key: 'col4',
|
|
86
|
-
text: storage[storageTableKeys[4]],
|
|
87
|
-
id: key,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
key: 'col5',
|
|
91
|
-
text: storage[storageTableKeys[5]],
|
|
92
|
-
id: key,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
key: 'col6',
|
|
96
|
-
text: storage[storageTableKeys[6]],
|
|
69
|
+
text: storage[vmMigrateDiskTableItemKeys[3]],
|
|
97
70
|
id: key,
|
|
98
71
|
},
|
|
99
72
|
])
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UI_T_VmMigrateDiskTableTuple } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/types'
|
|
2
|
+
|
|
3
|
+
export const vmMigrateDiskTableItemKeys: UI_T_VmMigrateDiskTableTuple = [
|
|
4
|
+
'virtual_machine',
|
|
5
|
+
'disk_group',
|
|
6
|
+
'file',
|
|
7
|
+
'datastore',
|
|
8
|
+
]
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
|
|
1
|
+
export interface API_UI_I_StorageConfigurePerDiskItem {
|
|
2
|
+
virtual_machine: string
|
|
3
|
+
target: string
|
|
3
4
|
disk_group: string
|
|
5
|
+
disk_source: string
|
|
6
|
+
disk_size: string
|
|
4
7
|
file: string
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
datastore: string
|
|
9
|
+
datastore_id: string
|
|
10
|
+
sharing: string
|
|
11
|
+
read_only: string
|
|
12
|
+
disk_mode: string
|
|
13
|
+
cache: string
|
|
14
|
+
io_control: string
|
|
15
|
+
discard: string
|
|
9
16
|
}
|
|
17
|
+
|
|
18
|
+
export interface UI_I_StorageConfigurePerDiskItem
|
|
19
|
+
extends API_UI_I_StorageConfigurePerDiskItem {}
|