bfg-common 1.4.157 → 1.4.159
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 +0 -1
- package/assets/localization/local_en.json +0 -1
- package/assets/localization/local_hy.json +0 -1
- package/assets/localization/local_kk.json +0 -1
- package/assets/localization/local_ru.json +0 -1
- package/assets/localization/local_zh.json +0 -1
- package/components/common/layout/theHeader/TheHeaderNew.vue +1 -2
- package/components/common/layout/theHeader/helpMenu/helpMenuNew/HelpMenuNew.vue +0 -14
- package/components/common/layout/theHeader/userMenu/userMenuNew/UserMenuNew.vue +0 -14
- package/components/common/mainNavigationPanel/MainNavigationPanelNew.vue +53 -89
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/Object.vue +1 -4
- package/components/common/select/input/lib/models/interfaces.ts +1 -0
- package/components/common/split/horizontal/HorizontalNew.vue +0 -1
- package/components/common/wizards/vm/common/computeResource/TreeView.vue +3 -6
- package/components/common/wizards/vm/common/tooltip/Tooltip.vue +5 -5
- package/components/common/wizards/vm/migrate/Migrate.vue +161 -188
- package/components/common/wizards/vm/migrate/lib/config/constructDataReady.ts +166 -53
- package/components/common/wizards/vm/migrate/lib/config/steps.ts +93 -0
- package/components/common/wizards/vm/migrate/lib/models/interfaces.ts +26 -19
- package/components/common/wizards/vm/migrate/lib/utils.ts +0 -80
- package/components/common/wizards/vm/migrate/lib/validations.ts +57 -0
- package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +18 -52
- package/components/common/wizards/vm/migrate/select/computeResource/lib/config/tabsPannel.ts +1 -1
- package/components/common/wizards/vm/migrate/select/computeResource/lib/models/interfaces.ts +2 -1
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/TableView.vue +9 -18
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/config/clusterTable.ts +1 -1
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/config/resourcePoolTable.ts +1 -1
- package/components/common/wizards/vm/migrate/select/computeResource/tableView/lib/config/vappsTable.ts +20 -18
- package/components/common/wizards/vm/migrate/select/network/Network.vue +16 -11
- package/components/common/wizards/vm/migrate/select/network/lib/models/interfaces.ts +4 -0
- package/components/common/wizards/vm/migrate/select/network/table/network/Network.vue +16 -17
- package/components/common/wizards/vm/migrate/select/priority/Priority.vue +2 -16
- package/components/common/wizards/vm/migrate/select/storage/Storage.vue +29 -61
- package/components/common/wizards/vm/migrate/select/storage/configure/batch/Batch.vue +28 -33
- package/components/common/wizards/vm/migrate/select/storage/configure/batch/config/virtualDiskFormat.ts +30 -0
- package/components/common/wizards/vm/migrate/select/storage/{table/datastore/Datastore.vue → configure/batch/table/Table.vue} +48 -34
- package/components/common/wizards/vm/migrate/select/storage/configure/batch/table/lib/config/datastoreTable.ts +177 -0
- package/components/common/wizards/vm/migrate/select/storage/{table/datastore → configure/batch/table}/lib/models/types.ts +2 -2
- package/components/common/wizards/vm/migrate/select/storage/configure/disk/Disk.vue +11 -30
- package/components/common/wizards/vm/migrate/select/storage/{table/disk/Disk.vue → configure/disk/table/Table.vue} +5 -17
- package/components/common/wizards/vm/migrate/select/storage/{table/disk/lib/config/config.ts → configure/disk/table/lib/config/diskTable.ts} +36 -23
- package/components/common/wizards/vm/migrate/select/storage/{table/disk → configure/disk/table}/lib/config/tableKeys.ts +1 -1
- package/components/common/wizards/vm/migrate/select/storage/{table/disk → configure/disk/table}/lib/models/interfaces.ts +5 -0
- package/components/common/wizards/vm/migrate/select/storage/lib/models/interfaces.ts +0 -14
- package/components/common/wizards/vm/migrate/select/storage/selectedPerDisk/SelectedPerDisk.vue +14 -22
- package/components/common/wizards/vm/migrate/select/targetServer/new/New.vue +111 -144
- package/components/common/wizards/vm/migrate/select/targetServer/new/lib/models/interfaces.ts +8 -10
- package/components/common/wizards/vm/migrate/select/targetServer/targetServer.vue +11 -1
- package/components/common/wizards/vm/migrate/select/type/Type.vue +8 -19
- package/package.json +2 -2
- package/components/common/wizards/vm/migrate/contentHeading/ContentHeading.vue +0 -106
- package/components/common/wizards/vm/migrate/contentHeading/lib/models/interfaces.ts +0 -7
- package/components/common/wizards/vm/migrate/select/storage/diskFormat/DiskFormat.vue +0 -69
- package/components/common/wizards/vm/migrate/select/storage/diskFormat/lib/config/formatOptions.ts +0 -26
- package/components/common/wizards/vm/migrate/select/storage/table/datastore/lib/config/config.ts +0 -179
- package/components/common/wizards/vm/migrate/select/targetServer/new/lib/config/defaultForm.ts +0 -36
- /package/components/common/wizards/vm/migrate/select/storage/{table/disk → configure/disk/table}/lib/models/types.ts +0 -0
- /package/components/common/wizards/vm/migrate/{lib → select/type/lib}/models/types.ts +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="select-storage">
|
|
3
3
|
<atoms-alert
|
|
4
|
-
v-
|
|
4
|
+
v-show="props.alertMessages?.length"
|
|
5
5
|
test-id="select-storage-alert"
|
|
6
6
|
status="alert-danger"
|
|
7
|
-
:items="
|
|
8
|
-
@remove="
|
|
7
|
+
:items="props.alertMessages"
|
|
8
|
+
@remove="onHideAlert"
|
|
9
9
|
/>
|
|
10
10
|
|
|
11
11
|
<common-wizards-vm-migrate-select-storage-selected-per-disk
|
|
12
12
|
v-if="isShowSelectedPerDisks"
|
|
13
13
|
v-model="isShowSelectedPerDisks"
|
|
14
|
-
v-model:active-tab="
|
|
14
|
+
v-model:active-tab="model.configure.type"
|
|
15
15
|
v-model:connected-storage-id-local="connectedStorageIdLocal"
|
|
16
16
|
:data="selectedPerDisks"
|
|
17
17
|
/>
|
|
18
18
|
|
|
19
19
|
<atoms-tabs
|
|
20
20
|
v-else
|
|
21
|
-
v-model="
|
|
21
|
+
v-model="model.configure.type"
|
|
22
22
|
test-id="migrate-select-storage-tabs"
|
|
23
23
|
:items="selectStorageTabs"
|
|
24
24
|
size="small"
|
|
@@ -27,13 +27,12 @@
|
|
|
27
27
|
/>
|
|
28
28
|
|
|
29
29
|
<common-wizards-vm-migrate-select-storage-configure-batch
|
|
30
|
-
v-show="
|
|
31
|
-
v-model
|
|
30
|
+
v-show="model.configure.type === 'batch-configure'"
|
|
31
|
+
v-model="model"
|
|
32
32
|
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
33
33
|
:datastore="props.datastore"
|
|
34
34
|
:connected-storage-id="connectedStorageId"
|
|
35
35
|
:is-hide-select-disk-format="isHideSelectDiskFormat"
|
|
36
|
-
@update-selected-datastore="selectStorageDataLocal.storage = $event"
|
|
37
36
|
>
|
|
38
37
|
<template v-if="isShowSelectedPerDisks" #buttonConfirm>
|
|
39
38
|
<button
|
|
@@ -47,16 +46,16 @@
|
|
|
47
46
|
</common-wizards-vm-migrate-select-storage-configure-batch>
|
|
48
47
|
|
|
49
48
|
<common-wizards-vm-migrate-select-storage-configure-disk
|
|
50
|
-
v-show="
|
|
49
|
+
v-show="model.configure.type === 'configure-disk'"
|
|
51
50
|
v-model="isShowSelectedPerDisks"
|
|
52
51
|
v-model:selected-per-disk-keys="selectedPerDiskKeys"
|
|
53
|
-
v-model:active-tab="
|
|
54
|
-
:configure-per-disks="
|
|
52
|
+
v-model:active-tab="model.configure.type"
|
|
53
|
+
:configure-per-disks="model.configure.disks"
|
|
55
54
|
@update-selected-per-disks="onChangePerDiskStorage"
|
|
56
55
|
/>
|
|
57
56
|
|
|
58
57
|
<common-wizards-vm-common-validation-compatibility
|
|
59
|
-
:loading="!
|
|
58
|
+
:loading="!model.storage"
|
|
60
59
|
:status="'Success'"
|
|
61
60
|
text="compatibilityChecksSucceeded"
|
|
62
61
|
/>
|
|
@@ -68,46 +67,33 @@ import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
|
68
67
|
import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
|
|
69
68
|
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
70
69
|
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
71
|
-
import type {
|
|
72
|
-
import type {
|
|
73
|
-
import type {
|
|
74
|
-
UI_I_SelectStorageDataLocal,
|
|
75
|
-
UI_I_SelectStorageReadyData,
|
|
76
|
-
} from '~/components/common/wizards/vm/migrate/select/storage/lib/models/interfaces'
|
|
70
|
+
import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/configure/disk/table/lib/models/interfaces'
|
|
71
|
+
import type { UI_I_MigrateFormLocal } from '~/components/common/wizards/vm/migrate/lib/models/interfaces'
|
|
77
72
|
import { vmMigrateSelectStorageTabsFunc } from '~/components/common/wizards/vm/migrate/select/storage/lib/config/tabsPannel'
|
|
78
73
|
|
|
79
74
|
const props = defineProps<{
|
|
80
|
-
|
|
75
|
+
alertMessages: string[]
|
|
81
76
|
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
82
77
|
datastore: UI_I_DatastoreTableItem[]
|
|
83
78
|
connectedStorageIdDefault: string | null
|
|
84
79
|
configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
|
|
85
80
|
}>()
|
|
81
|
+
const model = defineModel<UI_I_MigrateFormLocal>({ required: true })
|
|
86
82
|
const emits = defineEmits<{
|
|
87
|
-
(event: '
|
|
83
|
+
(event: 'hide-alert', value: number): void
|
|
88
84
|
}>()
|
|
89
85
|
|
|
90
86
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
91
87
|
|
|
92
|
-
const activeTab = ref<UI_T_VmMigrateSelectStorageTab>('batch-configure')
|
|
93
88
|
const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
|
|
94
89
|
vmMigrateSelectStorageTabsFunc(localization.value)
|
|
95
90
|
)
|
|
96
91
|
|
|
97
|
-
const errorMessages = ref<string[]>([])
|
|
98
|
-
const selectStorageDataLocal = ref<UI_I_SelectStorageDataLocal>({
|
|
99
|
-
vmDiskFormat: 0,
|
|
100
|
-
storage: null,
|
|
101
|
-
})
|
|
102
92
|
const isShowSelectedPerDisks = ref<boolean>(false)
|
|
103
93
|
|
|
104
94
|
const selectedPerDiskKeys = ref<number[]>([])
|
|
105
95
|
const selectedPerDisks = ref<UI_I_StorageConfigurePerDiskItem[]>([])
|
|
106
96
|
|
|
107
|
-
const configurePerDisksLocal = ref<UI_I_StorageConfigurePerDiskItem[]>(
|
|
108
|
-
props.configurePerDisks
|
|
109
|
-
)
|
|
110
|
-
|
|
111
97
|
const connectedStorageIdLocal = ref<string>('')
|
|
112
98
|
const connectedStorageId = computed<string | null>(
|
|
113
99
|
() => connectedStorageIdLocal.value || props.connectedStorageIdDefault
|
|
@@ -122,14 +108,14 @@ const onChangePerDiskStorage = (
|
|
|
122
108
|
event: UI_I_StorageConfigurePerDiskItem[]
|
|
123
109
|
): void => {
|
|
124
110
|
connectedStorageIdLocal.value = event[0].extra.datastore_id
|
|
125
|
-
|
|
111
|
+
model.value.disk_format = event[0].disk_format
|
|
126
112
|
|
|
127
113
|
selectedPerDisks.value = event
|
|
128
114
|
}
|
|
129
115
|
|
|
130
116
|
const onApplyChanges = (): void => {
|
|
131
117
|
/* TODO сделать рефакторинг потом */
|
|
132
|
-
|
|
118
|
+
model.value.configure.disks.forEach((disk) => {
|
|
133
119
|
const selectedDisk = selectedPerDisks.value.find(
|
|
134
120
|
(selected) =>
|
|
135
121
|
selected.virtual_machine === disk.virtual_machine &&
|
|
@@ -138,17 +124,17 @@ const onApplyChanges = (): void => {
|
|
|
138
124
|
)!
|
|
139
125
|
|
|
140
126
|
if (selectedDisk) {
|
|
141
|
-
const { storage,
|
|
127
|
+
const { storage, disk_format } = model.value
|
|
142
128
|
|
|
143
129
|
// ;({ name: disk.storage, id: disk.extra.datastore_id } = storage)
|
|
144
130
|
disk.storage = storage.name
|
|
145
131
|
disk.extra.datastore_id = storage.id
|
|
146
|
-
disk.disk_format =
|
|
132
|
+
disk.disk_format = disk_format
|
|
147
133
|
}
|
|
148
134
|
})
|
|
149
135
|
|
|
150
136
|
isShowSelectedPerDisks.value = false
|
|
151
|
-
|
|
137
|
+
model.value.configure.type = 'configure-disk'
|
|
152
138
|
selectedPerDisks.value = []
|
|
153
139
|
selectedPerDiskKeys.value = []
|
|
154
140
|
}
|
|
@@ -160,35 +146,17 @@ const isHideSelectDiskFormat = computed<boolean>(() => {
|
|
|
160
146
|
selectedPerDisks.value[0].file === 'Configuration file'
|
|
161
147
|
)
|
|
162
148
|
})
|
|
163
|
-
const onHideErrorMessageAlert = (): void => {
|
|
164
|
-
errorMessages.value = []
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const checkValidityBlock = (): boolean => {
|
|
168
|
-
if (!selectStorageDataLocal.value.storage) {
|
|
169
|
-
const errorText = localization.value.common.selectValidDestinationStorage
|
|
170
149
|
|
|
171
|
-
errorMessages.value = [errorText]
|
|
172
|
-
return false
|
|
173
|
-
}
|
|
174
|
-
onHideErrorMessageAlert()
|
|
175
|
-
const isActivePerDiskTab = activeTab.value === 'configure-disk'
|
|
176
|
-
emits('next-step', {
|
|
177
|
-
...selectStorageDataLocal.value,
|
|
178
|
-
tab: activeTab.value,
|
|
179
|
-
// ...(isActivePerDiskTab && { configureDisks: props.configurePerDisks }),
|
|
180
|
-
configureDisks: isActivePerDiskTab
|
|
181
|
-
? configurePerDisksLocal.value
|
|
182
|
-
: props.configurePerDisks,
|
|
183
|
-
})
|
|
184
|
-
return true
|
|
185
|
-
}
|
|
186
150
|
watch(
|
|
187
|
-
() => props.
|
|
188
|
-
() => {
|
|
189
|
-
|
|
190
|
-
}
|
|
151
|
+
() => props.configurePerDisks,
|
|
152
|
+
(newValue: UI_I_StorageConfigurePerDiskItem) => {
|
|
153
|
+
model.value.configure.disks = newValue
|
|
154
|
+
},
|
|
155
|
+
{ immediate: true }
|
|
191
156
|
)
|
|
157
|
+
const onHideAlert = (): void => {
|
|
158
|
+
emits('hide-alert', 3)
|
|
159
|
+
}
|
|
192
160
|
</script>
|
|
193
161
|
|
|
194
162
|
<style lang="scss" scoped>
|
|
@@ -1,29 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="configure-batch-mode">
|
|
3
|
-
<common-
|
|
3
|
+
<common-select-input
|
|
4
4
|
v-if="!isHideSelectDiskFormat"
|
|
5
|
-
v-model
|
|
5
|
+
v-model="model.disk_format"
|
|
6
|
+
:data="virtualDiskFormatOptions"
|
|
7
|
+
:label="localization.common.selectVirtualDiskFormat"
|
|
8
|
+
class="configure-batch-mode__disk-format"
|
|
6
9
|
/>
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<!-- <div class="clr-checkbox-wrapper flex-align-center w-100">-->
|
|
11
|
-
<!-- <input-->
|
|
12
|
-
<!-- id="suspend-on-revert"-->
|
|
13
|
-
<!-- v-models="isDisableStorageDrs"-->
|
|
14
|
-
<!-- type="checkbox"-->
|
|
15
|
-
<!-- class="checkbox-btn"-->
|
|
16
|
-
<!-- />-->
|
|
17
|
-
<!-- <label for="suspend-on-revert" class="clr-control-label">-->
|
|
18
|
-
<!-- {{ localization.common.disableStorageDRSVirtualMachine }}-->
|
|
19
|
-
<!-- </label>-->
|
|
20
|
-
<!-- </div>-->
|
|
21
|
-
|
|
22
|
-
<common-wizards-vm-migrate-select-storage-table-datastore
|
|
11
|
+
<common-wizards-vm-migrate-select-storage-configure-batch-table
|
|
12
|
+
v-model="model.storage"
|
|
23
13
|
:get-datastore-table-func="props.getDatastoreTableFunc"
|
|
24
14
|
:datastore="props.datastore"
|
|
25
15
|
:connected-storage-id="props.connectedStorageId"
|
|
26
|
-
@update-selected-datastore="emits('update-selected-datastore', $event)"
|
|
27
16
|
/>
|
|
28
17
|
|
|
29
18
|
<div
|
|
@@ -36,36 +25,42 @@
|
|
|
36
25
|
</template>
|
|
37
26
|
|
|
38
27
|
<script lang="ts" setup>
|
|
28
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
39
29
|
import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
|
|
30
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
40
31
|
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
32
|
+
import type { UI_I_MigrateFormLocal } from '~/components/common/wizards/vm/migrate/lib/models/interfaces'
|
|
33
|
+
import { virtualDiskFormatOptionsFunc } from '~/components/common/wizards/vm/migrate/select/storage/configure/batch/config/virtualDiskFormat'
|
|
41
34
|
|
|
42
35
|
const props = defineProps<{
|
|
43
|
-
vmDiskFormat: number
|
|
44
36
|
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
45
37
|
datastore: UI_I_DatastoreTableItem[]
|
|
46
38
|
connectedStorageId: string | null
|
|
47
39
|
isHideSelectDiskFormat: boolean
|
|
48
40
|
}>()
|
|
41
|
+
const model = defineModel<UI_I_MigrateFormLocal>({ required: true })
|
|
49
42
|
|
|
50
|
-
|
|
43
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
51
44
|
|
|
52
|
-
const
|
|
53
|
-
(
|
|
54
|
-
|
|
55
|
-
}>()
|
|
56
|
-
|
|
57
|
-
const selectedVmDiskFormat = computed<number>({
|
|
58
|
-
get() {
|
|
59
|
-
return props.vmDiskFormat
|
|
60
|
-
},
|
|
61
|
-
set(newValue: number) {
|
|
62
|
-
emits('update:vm-disk-format', newValue)
|
|
63
|
-
},
|
|
64
|
-
})
|
|
45
|
+
const virtualDiskFormatOptions = computed<UI_I_OptionItem[]>(() =>
|
|
46
|
+
virtualDiskFormatOptionsFunc()
|
|
47
|
+
)
|
|
65
48
|
</script>
|
|
66
49
|
|
|
67
50
|
<style lang="scss" scoped>
|
|
51
|
+
@import 'assets/scss/common/mixins.scss';
|
|
68
52
|
.configure-batch-mode {
|
|
53
|
+
@include flex($dir: column);
|
|
54
|
+
height: inherit;
|
|
55
|
+
&__disk-format {
|
|
56
|
+
margin-left: 10px;
|
|
57
|
+
:deep(.select-input__label) {
|
|
58
|
+
flex: 0 0 25%;
|
|
59
|
+
}
|
|
60
|
+
:deep(.select-input__inner) {
|
|
61
|
+
flex: 0 0 25%;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
69
64
|
&__button {
|
|
70
65
|
display: flex;
|
|
71
66
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
|
2
|
+
|
|
3
|
+
export const virtualDiskFormatOptionsFunc = (): UI_I_SelectInputItem[] => {
|
|
4
|
+
return [
|
|
5
|
+
{
|
|
6
|
+
label: 'Same Format as source',
|
|
7
|
+
value: 0,
|
|
8
|
+
testId: 'migrate-disk-format-same-as-source',
|
|
9
|
+
// value: 'same-format-source',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
label: 'Thick Provision Lazy Zeroed',
|
|
13
|
+
value: 2,
|
|
14
|
+
testId: 'migrate-disk-format-thick-provision-lazy-zeroed',
|
|
15
|
+
// value: 'thick-provision-lazy-zeroed',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: 'Thick Provision Eager Zeroed',
|
|
19
|
+
value: 3,
|
|
20
|
+
testId: 'migrate-disk-format-thick-provision-eager-zeroed',
|
|
21
|
+
// value: 'thick-provision-eager-zeroed',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: 'Thin Provision',
|
|
25
|
+
value: 1,
|
|
26
|
+
testId: 'migrate-disk-format-thin-provision',
|
|
27
|
+
// value: 'thin-provision',
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="table-wrap">
|
|
3
3
|
<atoms-table-data-grid
|
|
4
|
-
v-model:selected-row="
|
|
4
|
+
v-model:selected-row="selectedStorageKeyLocal"
|
|
5
5
|
v-model:column-keys="columnKeys"
|
|
6
6
|
v-model:page-size="pagination.pageSize"
|
|
7
7
|
v-model:page="pagination.page"
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
:total-pages="1"
|
|
14
14
|
server-off
|
|
15
15
|
hide-page-size
|
|
16
|
+
class="table-wrap__container"
|
|
16
17
|
@sorting="sorting"
|
|
17
|
-
@change="
|
|
18
|
+
@change="selectStorageFromTable"
|
|
18
19
|
>
|
|
19
20
|
<template #icon="{ item }">
|
|
20
21
|
<span :class="['datagrid-cell-icon', item.data]" />
|
|
@@ -27,28 +28,37 @@
|
|
|
27
28
|
</template>
|
|
28
29
|
|
|
29
30
|
<script lang="ts" setup>
|
|
30
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
31
|
-
import type { UI_I_TablePayload, UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
32
|
-
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
33
31
|
import type {
|
|
34
32
|
UI_I_ColumnKey,
|
|
35
33
|
UI_I_HeadItem,
|
|
36
34
|
UI_I_BodyItem,
|
|
37
35
|
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
38
|
-
import
|
|
36
|
+
import type {
|
|
37
|
+
UI_I_TablePayload,
|
|
38
|
+
UI_I_Pagination,
|
|
39
|
+
} from '~/lib/models/table/interfaces'
|
|
40
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
41
|
+
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
42
|
+
import * as table from '~/components/common/wizards/vm/migrate/select/storage/configure/batch/table/lib/config/datastoreTable'
|
|
39
43
|
|
|
40
44
|
const props = defineProps<{
|
|
41
45
|
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
42
46
|
datastore: UI_I_DatastoreTableItem[]
|
|
43
47
|
connectedStorageId: string | null
|
|
44
48
|
}>()
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}>()
|
|
49
|
+
const modelStorageLocal = defineModel<UI_I_DatastoreTableItem>({
|
|
50
|
+
required: true,
|
|
51
|
+
})
|
|
49
52
|
|
|
50
53
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
51
54
|
|
|
55
|
+
const selectedStorageKeyLocal = ref<number | null>(null)
|
|
56
|
+
const sort = ref<string | null>(null)
|
|
57
|
+
const pagination = ref<UI_I_Pagination>({
|
|
58
|
+
page: 1,
|
|
59
|
+
pageSize: 100,
|
|
60
|
+
})
|
|
61
|
+
|
|
52
62
|
const headItems = ref<UI_I_HeadItem[]>(table.headItems(localization.value))
|
|
53
63
|
const columnKeys = ref<UI_I_ColumnKey[]>(table.columnKeys(localization.value))
|
|
54
64
|
watch(localization, () => {
|
|
@@ -58,22 +68,15 @@ watch(localization, () => {
|
|
|
58
68
|
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
59
69
|
return table.bodyItems(props.datastore || [], localization.value)
|
|
60
70
|
})
|
|
61
|
-
|
|
62
|
-
const sort = ref<string | null>(null)
|
|
63
|
-
const pagination = ref<UI_I_Pagination>({
|
|
64
|
-
page: 1,
|
|
65
|
-
pageSize: 100,
|
|
66
|
-
})
|
|
67
|
-
|
|
68
71
|
const sorting = (data: [string, boolean]): void => {
|
|
69
72
|
const [column, status] = data
|
|
70
73
|
const direction = status ? 'asc' : 'desc'
|
|
71
74
|
sort.value = `${column}.${direction}`
|
|
72
75
|
|
|
73
|
-
|
|
76
|
+
InitStorageData()
|
|
74
77
|
}
|
|
75
78
|
|
|
76
|
-
const
|
|
79
|
+
const InitStorageData = async (): Promise<void> => {
|
|
77
80
|
const payload: UI_I_TablePayload = {
|
|
78
81
|
pagination: pagination.value,
|
|
79
82
|
sortBy: sort.value,
|
|
@@ -82,33 +85,44 @@ const getStorage = async (): Promise<void> => {
|
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
props.getDatastoreTableFunc(payload).then(() => {
|
|
85
|
-
//
|
|
86
|
-
//
|
|
88
|
+
// selectedStorageKeyLocal.value = null
|
|
89
|
+
// defineDefaultSelectedStorage()
|
|
87
90
|
})
|
|
88
91
|
}
|
|
89
|
-
|
|
92
|
+
InitStorageData()
|
|
90
93
|
|
|
91
|
-
const
|
|
92
|
-
const changeStorage = (index: number): void => {
|
|
94
|
+
const selectStorageFromTable = (index: number): void => {
|
|
93
95
|
if (!props.datastore) return
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
|
|
97
|
+
modelStorageLocal.value = props.datastore[index]
|
|
98
|
+
selectedStorageKeyLocal.value = index
|
|
96
99
|
}
|
|
97
100
|
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
const defineDefaultSelectedStorage = (): void => {
|
|
102
|
+
props.datastore.forEach(
|
|
103
|
+
(datastore: UI_I_DatastoreTableItem, index: number) => {
|
|
104
|
+
if (datastore.id === props.connectedStorageId)
|
|
105
|
+
selectStorageFromTable(index)
|
|
106
|
+
}
|
|
107
|
+
)
|
|
103
108
|
}
|
|
104
109
|
|
|
105
110
|
watch(
|
|
106
111
|
() => props.connectedStorageId,
|
|
107
|
-
(newValue) => {
|
|
112
|
+
(newValue: string) => {
|
|
108
113
|
if (!props.datastore.length || !newValue) return
|
|
109
|
-
|
|
114
|
+
defineDefaultSelectedStorage()
|
|
110
115
|
}
|
|
111
116
|
)
|
|
112
117
|
</script>
|
|
113
118
|
|
|
114
|
-
<style lang="scss" scoped
|
|
119
|
+
<style lang="scss" scoped>
|
|
120
|
+
@import 'assets/scss/common/mixins.scss';
|
|
121
|
+
.table-wrap {
|
|
122
|
+
@include flex($dir: column);
|
|
123
|
+
height: inherit;
|
|
124
|
+
&__container {
|
|
125
|
+
height: inherit;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
2
|
+
import type {
|
|
3
|
+
UI_I_ColumnKey,
|
|
4
|
+
UI_I_HeadItem,
|
|
5
|
+
UI_I_BodyItem,
|
|
6
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
7
|
+
import * as defaultSettings from '~/components/atoms/table/dataGrid/lib/config/settingsTable'
|
|
8
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
9
|
+
import type { UI_T_DatastoreTableItemsTuple } from '~/components/common/wizards/vm/migrate/select/storage/configure/batch/table/lib/models/types'
|
|
10
|
+
import {
|
|
11
|
+
datastoreIconByState,
|
|
12
|
+
datastoreLocalizationByState,
|
|
13
|
+
} from '~/components/common/lib/config/states'
|
|
14
|
+
|
|
15
|
+
export const datastoreTableKeys: UI_T_DatastoreTableItemsTuple = [
|
|
16
|
+
'name',
|
|
17
|
+
'state',
|
|
18
|
+
'capacity_mb',
|
|
19
|
+
'provisioned_mb',
|
|
20
|
+
'free_mb',
|
|
21
|
+
'used_mb',
|
|
22
|
+
'type_text',
|
|
23
|
+
'thin_provisioning',
|
|
24
|
+
'access_mode',
|
|
25
|
+
'hardware_acceleration',
|
|
26
|
+
'drive_type',
|
|
27
|
+
'device',
|
|
28
|
+
'storage_io_control',
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
const getItems = (
|
|
32
|
+
localization: UI_I_Localization
|
|
33
|
+
): [string, boolean, string, string][] => {
|
|
34
|
+
return [
|
|
35
|
+
[localization.common.name, true, '96px', datastoreTableKeys[0]],
|
|
36
|
+
[localization.inventorySummary.state, true, '138px', datastoreTableKeys[1]],
|
|
37
|
+
[localization.common.capacity, true, '110px', datastoreTableKeys[2]],
|
|
38
|
+
[localization.common.provisioned, true, '128px', datastoreTableKeys[3]],
|
|
39
|
+
[localization.common.free, true, '110px', datastoreTableKeys[4]],
|
|
40
|
+
[localization.common.used, true, '110px', datastoreTableKeys[5]],
|
|
41
|
+
[localization.common.type, true, '110px', datastoreTableKeys[6]],
|
|
42
|
+
[
|
|
43
|
+
localization.common.thinProvisioning,
|
|
44
|
+
true,
|
|
45
|
+
'132px',
|
|
46
|
+
datastoreTableKeys[7],
|
|
47
|
+
],
|
|
48
|
+
[localization.common.access, true, '110px', datastoreTableKeys[8]],
|
|
49
|
+
[
|
|
50
|
+
localization.common.hardwareAcceleration,
|
|
51
|
+
true,
|
|
52
|
+
'134px',
|
|
53
|
+
datastoreTableKeys[9],
|
|
54
|
+
],
|
|
55
|
+
[localization.common.driverType, true, '110px', datastoreTableKeys[10]],
|
|
56
|
+
[localization.common.device, true, '110px', datastoreTableKeys[11]],
|
|
57
|
+
[
|
|
58
|
+
localization.common.storageIoControl,
|
|
59
|
+
true,
|
|
60
|
+
'110px',
|
|
61
|
+
datastoreTableKeys[12],
|
|
62
|
+
],
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const columnKeys = (
|
|
67
|
+
localization: UI_I_Localization
|
|
68
|
+
): UI_I_ColumnKey[] => {
|
|
69
|
+
return defaultSettings.defaultColumnKeys(getItems(localization), {
|
|
70
|
+
icon: [0],
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
75
|
+
return defaultSettings.defaultHeadItems(getItems(localization), {
|
|
76
|
+
icon: [0],
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const bodyItems = (
|
|
81
|
+
data: UI_I_DatastoreTableItem[],
|
|
82
|
+
localization: UI_I_Localization
|
|
83
|
+
): UI_I_BodyItem[][] => {
|
|
84
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
85
|
+
const { $binary }: any = useNuxtApp()
|
|
86
|
+
|
|
87
|
+
data.forEach((storage: UI_I_DatastoreTableItem, key: number) => {
|
|
88
|
+
const state =
|
|
89
|
+
localization.common[
|
|
90
|
+
datastoreLocalizationByState[storage[datastoreTableKeys[1]]]
|
|
91
|
+
]
|
|
92
|
+
bodyItems.push([
|
|
93
|
+
{
|
|
94
|
+
key: 'icon',
|
|
95
|
+
text: storage[datastoreTableKeys[0]],
|
|
96
|
+
data: `vsphere-icon-${datastoreIconByState[storage.state]}`,
|
|
97
|
+
id: key,
|
|
98
|
+
testId: storage[datastoreTableKeys[0]],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: 'col1',
|
|
102
|
+
text: state,
|
|
103
|
+
id: key,
|
|
104
|
+
testId: storage[datastoreTableKeys[0]],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: 'col2',
|
|
108
|
+
text: $binary.round(storage.capacity[datastoreTableKeys[2]]),
|
|
109
|
+
id: key,
|
|
110
|
+
testId: storage[datastoreTableKeys[0]],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
key: 'col3',
|
|
114
|
+
text: $binary.round(storage.capacity[datastoreTableKeys[3]]),
|
|
115
|
+
id: key,
|
|
116
|
+
testId: storage[datastoreTableKeys[0]],
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: 'col4',
|
|
120
|
+
text: $binary.round(storage.capacity[datastoreTableKeys[4]]),
|
|
121
|
+
id: key,
|
|
122
|
+
testId: storage[datastoreTableKeys[0]],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
key: 'col5',
|
|
126
|
+
text: $binary.round(storage.capacity[datastoreTableKeys[5]]),
|
|
127
|
+
id: key,
|
|
128
|
+
testId: storage[datastoreTableKeys[0]],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
key: 'col6',
|
|
132
|
+
text: storage[datastoreTableKeys[6]],
|
|
133
|
+
id: key,
|
|
134
|
+
testId: storage[datastoreTableKeys[0]],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
key: 'col7',
|
|
138
|
+
text: storage[datastoreTableKeys[7]]
|
|
139
|
+
? localization.common.yes
|
|
140
|
+
: localization.common.no,
|
|
141
|
+
id: key,
|
|
142
|
+
testId: storage[datastoreTableKeys[0]],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
key: 'col8',
|
|
146
|
+
text: storage[datastoreTableKeys[8]],
|
|
147
|
+
id: key,
|
|
148
|
+
testId: storage[datastoreTableKeys[0]],
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
key: 'col9',
|
|
152
|
+
text: storage[datastoreTableKeys[9]],
|
|
153
|
+
id: key,
|
|
154
|
+
testId: storage[datastoreTableKeys[0]],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
key: 'col10',
|
|
158
|
+
text: storage[datastoreTableKeys[10]],
|
|
159
|
+
id: key,
|
|
160
|
+
testId: storage[datastoreTableKeys[0]],
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
key: 'col11',
|
|
164
|
+
text: storage[datastoreTableKeys[11]],
|
|
165
|
+
id: key,
|
|
166
|
+
testId: storage[datastoreTableKeys[0]],
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
key: 'col12',
|
|
170
|
+
text: storage[datastoreTableKeys[12]],
|
|
171
|
+
id: key,
|
|
172
|
+
testId: storage[datastoreTableKeys[0]],
|
|
173
|
+
},
|
|
174
|
+
])
|
|
175
|
+
})
|
|
176
|
+
return bodyItems
|
|
177
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type UI_T_DatastoreTableItemsTuple = [
|
|
2
2
|
'name',
|
|
3
3
|
'state',
|
|
4
4
|
'capacity_mb',
|
|
@@ -11,5 +11,5 @@ export type UI_T_StorageColumnKeys = [
|
|
|
11
11
|
'hardware_acceleration',
|
|
12
12
|
'drive_type',
|
|
13
13
|
'device',
|
|
14
|
-
'storage_io_control'
|
|
14
|
+
'storage_io_control'
|
|
15
15
|
]
|