bfg-common 1.2.108 → 1.2.109
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 +5 -1
- package/assets/localization/local_en.json +5 -1
- package/assets/localization/local_hy.json +5 -1
- package/assets/localization/local_kk.json +5 -1
- package/assets/localization/local_ru.json +5 -1
- package/assets/localization/local_zh.json +5 -1
- package/components/atoms/modal/bySteps/BySteps.vue +1 -1
- package/components/atoms/modal/byStepsSecond/ByStepsSecond.vue +2 -2
- package/components/atoms/step/VerticalStep.vue +1 -1
- package/components/common/monitor/advanced/tools/Tools.vue +428 -428
- package/components/common/wizards/datastore/add/config/stepItems.ts +3 -3
- package/components/common/wizards/vm/common/Tooltip.vue +74 -0
- package/components/common/wizards/vm/common/readyComplete/ReadyComplete.vue +15 -0
- package/components/common/wizards/vm/migrate/Migrate.vue +204 -0
- package/components/common/wizards/vm/migrate/config/constructDataReady.ts +82 -0
- package/components/common/wizards/vm/migrate/contentHeading/ContentHeading.vue +31 -0
- package/components/common/wizards/vm/migrate/models/enums.ts +6 -0
- package/components/common/wizards/vm/migrate/models/interfaces.ts +13 -0
- package/components/common/wizards/vm/migrate/models/types.ts +5 -0
- package/components/common/wizards/vm/migrate/select/storage/Storage.vue +136 -0
- package/components/common/wizards/vm/migrate/select/storage/config/tabsPannel.ts +18 -0
- package/components/common/wizards/vm/migrate/select/storage/configure/batch/Batch.vue +61 -0
- package/components/common/wizards/vm/migrate/select/storage/configure/disk/Disk.vue +73 -0
- package/components/common/wizards/vm/migrate/select/storage/diskFormat/DiskFormat.vue +68 -0
- package/components/common/wizards/vm/migrate/select/storage/diskFormat/config/formatOptions.ts +22 -0
- package/components/common/wizards/vm/migrate/select/storage/models/interfaces.ts +14 -0
- package/components/common/wizards/vm/migrate/select/storage/models/types.ts +3 -0
- package/components/common/wizards/vm/migrate/select/storage/policy/Policy.vue +83 -0
- package/components/common/wizards/vm/migrate/select/storage/selectedPerDisk/SelectedPerDisk.vue +84 -0
- package/components/common/wizards/vm/migrate/select/storage/table/datastore/Datastore.vue +105 -0
- package/components/common/wizards/vm/migrate/select/storage/table/datastore/config/config.ts +154 -0
- package/components/common/wizards/vm/migrate/select/storage/table/datastore/models/types.ts +15 -0
- package/components/common/wizards/vm/migrate/select/storage/table/disk/Disk.vue +73 -0
- package/components/common/wizards/vm/migrate/select/storage/table/disk/config/config.ts +102 -0
- package/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces.ts +9 -0
- package/components/common/wizards/vm/migrate/select/storage/table/disk/models/types.ts +9 -0
- package/components/common/wizards/vm/migrate/select/type/Type.vue +38 -0
- package/components/common/wizards/vm/migrate/select/type/config/typeOptions.ts +41 -0
- package/components/common/wizards/vm/migrate/select/type/models/interfaces.ts +5 -0
- package/components/common/wizards/vm/migrate/utils.ts +125 -0
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="migrate-configure-disk">
|
|
3
|
+
<div class="btn-group">
|
|
4
|
+
<button
|
|
5
|
+
id="vm-migrate-configure"
|
|
6
|
+
class="btn btn-link btn-sm"
|
|
7
|
+
:disabled="!selectedDisksFromTable.length"
|
|
8
|
+
@click="onConfigure"
|
|
9
|
+
>
|
|
10
|
+
{{ localization.configure }}
|
|
11
|
+
</button>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<common-wizards-vm-migrate-select-storage-table-disk
|
|
15
|
+
v-model:selected-per-disk="selectedPerDiskKeys"
|
|
16
|
+
:configure-per-disks="props.configurePerDisks"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts" setup>
|
|
22
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
23
|
+
import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces'
|
|
24
|
+
import type { UI_T_VmMigrateSelectStorageTab } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
25
|
+
|
|
26
|
+
const props = defineProps<{
|
|
27
|
+
modelValue: boolean
|
|
28
|
+
configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
|
|
29
|
+
activeTab: UI_T_VmMigrateSelectStorageTab
|
|
30
|
+
}>()
|
|
31
|
+
const emits = defineEmits<{
|
|
32
|
+
(event: 'update:model-value', value: boolean): void
|
|
33
|
+
(
|
|
34
|
+
event: 'update-selected-per-disks',
|
|
35
|
+
value: UI_I_StorageConfigurePerDiskItem[]
|
|
36
|
+
): void
|
|
37
|
+
(event: 'update:active-tab', value: string): void
|
|
38
|
+
}>()
|
|
39
|
+
|
|
40
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
41
|
+
|
|
42
|
+
const selectedPerDiskKeys = ref<number[]>([])
|
|
43
|
+
const selectedDisksFromTable = computed<UI_I_StorageConfigurePerDiskItem[]>(
|
|
44
|
+
() => {
|
|
45
|
+
if (!props.configurePerDisks) return []
|
|
46
|
+
|
|
47
|
+
return props.configurePerDisks.filter((_: never, key: number) =>
|
|
48
|
+
selectedPerDiskKeys.value.includes(key)
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
const onConfigure = (): void => {
|
|
54
|
+
emits('update-selected-per-disks', selectedDisksFromTable.value)
|
|
55
|
+
emits('update:model-value', true)
|
|
56
|
+
activeTabValue.value = 'batch-configure'
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const activeTabValue = computed<UI_T_VmMigrateSelectStorageTab>({
|
|
60
|
+
get() {
|
|
61
|
+
return props.activeTab
|
|
62
|
+
},
|
|
63
|
+
set(newValue: string) {
|
|
64
|
+
emits('update:active-tab', newValue)
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style lang="scss" scoped>
|
|
70
|
+
.migrate-configure-disk {
|
|
71
|
+
margin-top: 10px;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="disk-format clr-flex-row">
|
|
3
|
+
<label
|
|
4
|
+
for="storage-locator-disk-format-label"
|
|
5
|
+
class="clr-col-3 clr-control-label"
|
|
6
|
+
>
|
|
7
|
+
{{ localization.selectVirtualDiskFormat }}
|
|
8
|
+
</label>
|
|
9
|
+
<div class="select select-lang mt-0 clr-form-control">
|
|
10
|
+
<select
|
|
11
|
+
id="storage-locator-disk-format-label"
|
|
12
|
+
v-model="selectedVirtualDiskFormat"
|
|
13
|
+
class="storage-locator-disk-format-label"
|
|
14
|
+
>
|
|
15
|
+
<option
|
|
16
|
+
v-for="option in configuredSpeedOptions"
|
|
17
|
+
:key="option.value"
|
|
18
|
+
:value="option.value"
|
|
19
|
+
>
|
|
20
|
+
{{ option.text }}
|
|
21
|
+
</option>
|
|
22
|
+
</select>
|
|
23
|
+
</div>
|
|
24
|
+
</section>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script lang="ts" setup>
|
|
28
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
29
|
+
import type { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
30
|
+
import { vmDiskFormatOptions } from '~/components/common/wizards/vm/migrate/select/storage/diskFormat/config/formatOptions'
|
|
31
|
+
|
|
32
|
+
const props = defineProps<{
|
|
33
|
+
vmDiskFormat: string
|
|
34
|
+
}>()
|
|
35
|
+
const emits = defineEmits<{
|
|
36
|
+
(event: 'update:vm-disk-format', value: string): void
|
|
37
|
+
}>()
|
|
38
|
+
|
|
39
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
40
|
+
|
|
41
|
+
const configuredSpeedOptions = computed<UI_I_OptionItem[]>(() =>
|
|
42
|
+
vmDiskFormatOptions()
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
const selectedVirtualDiskFormat = computed<string>({
|
|
46
|
+
get() {
|
|
47
|
+
return props.vmDiskFormat
|
|
48
|
+
},
|
|
49
|
+
set(newValue: string) {
|
|
50
|
+
emits('update:vm-disk-format', newValue)
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<style lang="scss" scoped>
|
|
56
|
+
@import 'assets/scss/common/mixins.scss';
|
|
57
|
+
.disk-format {
|
|
58
|
+
@include flex($align: center);
|
|
59
|
+
}
|
|
60
|
+
.select-lang {
|
|
61
|
+
margin-left: 25px;
|
|
62
|
+
height: 24px;
|
|
63
|
+
min-width: 210px;
|
|
64
|
+
& > select {
|
|
65
|
+
height: 100%;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</style>
|
package/components/common/wizards/vm/migrate/select/storage/diskFormat/config/formatOptions.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
2
|
+
|
|
3
|
+
export const vmDiskFormatOptions = (): UI_I_OptionItem[] => {
|
|
4
|
+
return [
|
|
5
|
+
{
|
|
6
|
+
text: 'Same Format as source',
|
|
7
|
+
value: 'same-format-source',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
text: 'Thick Provision Lazy Zeroed',
|
|
11
|
+
value: 'thick-provision-lazy-zeroed',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
text: 'Thick Provision Eager Zeroed',
|
|
15
|
+
value: 'thick-provision-eager-zeroed',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
text: 'Thin Provision',
|
|
19
|
+
value: 'thin-provision',
|
|
20
|
+
},
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { UI_I_DatastoreTableItem } from '~/models/store/storage/interfaces'
|
|
2
|
+
import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces'
|
|
3
|
+
import type { UI_T_VmMigrateSelectStorageTab } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
4
|
+
|
|
5
|
+
export interface UI_I_SelectStorageDataLocal {
|
|
6
|
+
vmDiskFormat: string
|
|
7
|
+
storage: UI_I_DatastoreTableItem | null
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface UI_I_SelectStorageReadyData
|
|
11
|
+
extends UI_I_SelectStorageDataLocal {
|
|
12
|
+
tab: UI_T_VmMigrateSelectStorageTab
|
|
13
|
+
configureDisks?: UI_I_StorageConfigurePerDiskItem[]
|
|
14
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="storage-policy clr-flex-row">
|
|
3
|
+
<label
|
|
4
|
+
for="storage-locator-disk-policy-label"
|
|
5
|
+
class="clr-col-3 clr-control-label"
|
|
6
|
+
>
|
|
7
|
+
{{ localization.vmStoragePolicy }}
|
|
8
|
+
</label>
|
|
9
|
+
<div
|
|
10
|
+
class="mt-0 clr-form-control btn btn-outline-primary dropdown-toggle storage-policy__select-wrapper"
|
|
11
|
+
>
|
|
12
|
+
<select
|
|
13
|
+
id="storage-locator-disk-policy-label"
|
|
14
|
+
v-model="selectedVmStoragePolicy"
|
|
15
|
+
class="storage-locator-disk-format-label"
|
|
16
|
+
>
|
|
17
|
+
<option
|
|
18
|
+
v-for="option in configuredSpeedOptions"
|
|
19
|
+
:key="option.value"
|
|
20
|
+
:value="option.value"
|
|
21
|
+
>
|
|
22
|
+
{{ option.text }}
|
|
23
|
+
</option>
|
|
24
|
+
</select>
|
|
25
|
+
</div>
|
|
26
|
+
</section>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script lang="ts" setup>
|
|
30
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
31
|
+
import type { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
32
|
+
|
|
33
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
34
|
+
|
|
35
|
+
const selectedVmStoragePolicy = ref<string>('keep-existing-storage-policies')
|
|
36
|
+
|
|
37
|
+
const configuredSpeedOptions = computed<UI_I_OptionItem[]>(() => {
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
text: 'Keep existing VM storage policies',
|
|
41
|
+
value: 'keep-existing-storage-policies',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
text: 'Datastore Default',
|
|
45
|
+
value: 'datastore-default',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
text: 'Management Storage Policy - Large',
|
|
49
|
+
value: 'management-storage-policy-large',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
text: 'Management Storage Policy - Regular',
|
|
53
|
+
value: 'management-storage-policy-regular',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
text: 'vSAN Default Storage Policy',
|
|
57
|
+
value: 'vsan-default-storage-policy',
|
|
58
|
+
},
|
|
59
|
+
]
|
|
60
|
+
})
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="scss" scoped>
|
|
64
|
+
@import 'assets/scss/common/mixins.scss';
|
|
65
|
+
.storage-policy {
|
|
66
|
+
@include flex($align: center);
|
|
67
|
+
margin-top: 2px;
|
|
68
|
+
&__select-wrapper {
|
|
69
|
+
margin-left: 25px;
|
|
70
|
+
height: 24px;
|
|
71
|
+
min-width: 420px;
|
|
72
|
+
& > select {
|
|
73
|
+
width: 100%;
|
|
74
|
+
height: 100%;
|
|
75
|
+
text-align: center;
|
|
76
|
+
border: none;
|
|
77
|
+
&:focus-visible {
|
|
78
|
+
outline: none;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</style>
|
package/components/common/wizards/vm/migrate/select/storage/selectedPerDisk/SelectedPerDisk.vue
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="selected-per-disk">
|
|
3
|
+
<atoms-the-icon
|
|
4
|
+
class="icon-arrow"
|
|
5
|
+
name="arrow"
|
|
6
|
+
@click="onGoBack"
|
|
7
|
+
></atoms-the-icon>
|
|
8
|
+
|
|
9
|
+
<div>
|
|
10
|
+
<span class="icon vsphere-icon-vm"></span>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<span v-if="normalizedData.length === 1">{{ normalizedData[0] }}</span>
|
|
14
|
+
|
|
15
|
+
<div v-else class="selected-per-disk__all-objects">
|
|
16
|
+
<span>
|
|
17
|
+
{{ localization.allSelectedObjects }}
|
|
18
|
+
</span>
|
|
19
|
+
<common-wizards-vm-common-tooltip>
|
|
20
|
+
<template #content>
|
|
21
|
+
<div v-for="(item, key) in normalizedData" :key="key">
|
|
22
|
+
{{ item }}
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
</common-wizards-vm-common-tooltip>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script lang="ts" setup>
|
|
31
|
+
import type { UI_I_Localization } from '~/models/interfaces'
|
|
32
|
+
import type { UI_T_VmMigrateSelectStorageTab } from '~/components/common/wizards/vm/migrate/select/storage/models/types'
|
|
33
|
+
|
|
34
|
+
const props = defineProps<{
|
|
35
|
+
modelValue: boolean
|
|
36
|
+
activeTab: UI_T_VmMigrateSelectStorageTab
|
|
37
|
+
data: any[]
|
|
38
|
+
}>()
|
|
39
|
+
const emits = defineEmits<{
|
|
40
|
+
(event: 'update:model-value', value: boolean): void
|
|
41
|
+
(event: 'update:active-tab', value: UI_T_VmMigrateSelectStorageTab): void
|
|
42
|
+
}>()
|
|
43
|
+
|
|
44
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
45
|
+
|
|
46
|
+
const normalizedData = computed<string[]>(() =>
|
|
47
|
+
props.data.map((item) => `${item.name} | ${item.file}`)
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
const onGoBack = (): void => {
|
|
51
|
+
emits('update:model-value', false)
|
|
52
|
+
activeTabValue.value = 'configure-disk'
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const activeTabValue = computed<UI_T_VmMigrateSelectStorageTab>({
|
|
56
|
+
get() {
|
|
57
|
+
return props.activeTab
|
|
58
|
+
},
|
|
59
|
+
set(newValue: string) {
|
|
60
|
+
emits('update:active-tab', newValue)
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<style lang="scss" scoped>
|
|
66
|
+
@import 'assets/scss/common/mixins.scss';
|
|
67
|
+
.selected-per-disk {
|
|
68
|
+
@include flex($align: center);
|
|
69
|
+
.icon {
|
|
70
|
+
display: block;
|
|
71
|
+
}
|
|
72
|
+
.icon-arrow {
|
|
73
|
+
width: 16px;
|
|
74
|
+
height: 16px;
|
|
75
|
+
margin: 0 20px 0 15px;
|
|
76
|
+
transform: rotate(270deg);
|
|
77
|
+
fill: #0079b8;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
}
|
|
80
|
+
&__all-objects {
|
|
81
|
+
@include flex($align: center);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
</style>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-wrap">
|
|
3
|
+
<atoms-table-data-grid
|
|
4
|
+
v-model:selected-row="selectedStorageKey"
|
|
5
|
+
v-model:column-keys="columnKeys"
|
|
6
|
+
v-model:page-size="pagination.pageSize"
|
|
7
|
+
v-model:page="pagination.page"
|
|
8
|
+
type="radio"
|
|
9
|
+
:head-items="headItems"
|
|
10
|
+
:body-items="bodyItems"
|
|
11
|
+
:total-items="bodyItems.length"
|
|
12
|
+
:total-pages="1"
|
|
13
|
+
server-off
|
|
14
|
+
hide-page-size
|
|
15
|
+
@sorting="sorting"
|
|
16
|
+
@change="changeStorage"
|
|
17
|
+
>
|
|
18
|
+
<template #icon="{ item }">
|
|
19
|
+
<span :class="['datagrid-cell-icon', item.data]" />
|
|
20
|
+
<span class="text-ellipsis">
|
|
21
|
+
{{ item.text }}
|
|
22
|
+
</span>
|
|
23
|
+
</template>
|
|
24
|
+
</atoms-table-data-grid>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script lang="ts" setup>
|
|
29
|
+
import type { UI_I_Pagination, UI_I_Localization } from '~/models/interfaces'
|
|
30
|
+
import type { UI_I_TablePayload } from '~/models/store/interfaces'
|
|
31
|
+
import type { UI_I_DatastoreTableItem } from '~/models/store/storage/interfaces'
|
|
32
|
+
import type {
|
|
33
|
+
UI_I_ColumnKey,
|
|
34
|
+
UI_I_HeadItem,
|
|
35
|
+
UI_I_BodyItem,
|
|
36
|
+
} from '~/components/atoms/table/dataGrid/models/interfaces'
|
|
37
|
+
import * as table from '~/components/common/wizards/vm/migrate/select/storage/table/datastore/config/config'
|
|
38
|
+
|
|
39
|
+
const props = defineProps<{
|
|
40
|
+
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
41
|
+
datastore: UI_I_DatastoreTableItem[]
|
|
42
|
+
connectedStorageId: string | null
|
|
43
|
+
}>()
|
|
44
|
+
|
|
45
|
+
const emits = defineEmits<{
|
|
46
|
+
(event: 'update-selected-datastore', value: UI_I_TablePayload): void
|
|
47
|
+
}>()
|
|
48
|
+
|
|
49
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
50
|
+
|
|
51
|
+
const headItems = ref<UI_I_HeadItem[]>(table.headItems(localization.value))
|
|
52
|
+
const columnKeys = ref<UI_I_ColumnKey[]>(table.columnKeys(localization.value))
|
|
53
|
+
watch(localization, () => {
|
|
54
|
+
columnKeys.value = table.columnKeys(localization.value)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
58
|
+
return table.bodyItems(props.datastore || [], localization.value)
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
const sort = ref<string | null>(null)
|
|
62
|
+
const pagination = ref<UI_I_Pagination>({
|
|
63
|
+
page: 1,
|
|
64
|
+
pageSize: 100,
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
const sorting = (data: [string, boolean]): void => {
|
|
68
|
+
const [column, status] = data
|
|
69
|
+
const direction = status ? 'asc' : 'desc'
|
|
70
|
+
sort.value = `${column}.${direction}`
|
|
71
|
+
|
|
72
|
+
getStorage()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const getStorage = async (): Promise<void> => {
|
|
76
|
+
const payload: UI_I_TablePayload = {
|
|
77
|
+
pagination: pagination.value,
|
|
78
|
+
sortBy: sort.value,
|
|
79
|
+
type: 'datastore',
|
|
80
|
+
schema: 'full',
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
props.getDatastoreTableFunc(payload).then(() => {
|
|
84
|
+
selectedStorageKey.value = null
|
|
85
|
+
setStorageFromProps()
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
getStorage()
|
|
89
|
+
|
|
90
|
+
const selectedStorageKey = ref<number | null>(null)
|
|
91
|
+
const changeStorage = (index: number): void => {
|
|
92
|
+
if (!props.datastore) return
|
|
93
|
+
emits('update-selected-datastore', props.datastore[index])
|
|
94
|
+
selectedStorageKey.value = index
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const setStorageFromProps = (): void => {
|
|
98
|
+
if (!props.connectedStorageId) return
|
|
99
|
+
props.datastore.forEach((item, index) => {
|
|
100
|
+
if (item.id === props.connectedStorageId) changeStorage(index)
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { UI_I_DatastoreTableItem } from 'bfg-common/models/store/storage/interfaces'
|
|
2
|
+
import type {
|
|
3
|
+
UI_I_ColumnKey,
|
|
4
|
+
UI_I_HeadItem,
|
|
5
|
+
UI_I_BodyItem,
|
|
6
|
+
} from 'bfg-common/components/atoms/table/dataGrid/models/interfaces'
|
|
7
|
+
import type { UI_I_Localization } from 'bfg-common/models/interfaces'
|
|
8
|
+
import type { UI_T_StorageColumnKeys } from 'bfg-common/components/common/vm/actions/common/select/storage/models/types'
|
|
9
|
+
import {
|
|
10
|
+
constructColumnKey,
|
|
11
|
+
constructHeadItem,
|
|
12
|
+
} from 'bfg-common/components/atoms/table/dataGrid/utils/constructDataTable'
|
|
13
|
+
import {
|
|
14
|
+
datastoreIconByState,
|
|
15
|
+
datastoreLocalizationByState,
|
|
16
|
+
} from 'bfg-common/components/common/config/states'
|
|
17
|
+
|
|
18
|
+
export const storageTableKeys: UI_T_StorageColumnKeys = [
|
|
19
|
+
'name',
|
|
20
|
+
'state',
|
|
21
|
+
'capacity_mb',
|
|
22
|
+
'provisioned_mb',
|
|
23
|
+
'free_mb',
|
|
24
|
+
'used_mb',
|
|
25
|
+
'type_text',
|
|
26
|
+
'thin_provisioning',
|
|
27
|
+
'access_mode',
|
|
28
|
+
'hardware_acceleration',
|
|
29
|
+
'drive_type',
|
|
30
|
+
'device',
|
|
31
|
+
'storage_io_control',
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
const getItems = (
|
|
35
|
+
localization: UI_I_Localization
|
|
36
|
+
): [string, boolean, string, string][] => {
|
|
37
|
+
return [
|
|
38
|
+
[localization.name, true, '96px', storageTableKeys[0]],
|
|
39
|
+
[localization.state, true, '138px', storageTableKeys[1]],
|
|
40
|
+
[localization.capacity, true, '110px', storageTableKeys[2]],
|
|
41
|
+
[localization.provisioned, true, '128px', storageTableKeys[3]],
|
|
42
|
+
[localization.free, true, '110px', storageTableKeys[4]],
|
|
43
|
+
[localization.used, true, '110px', storageTableKeys[5]],
|
|
44
|
+
[localization.type, true, '110px', storageTableKeys[6]],
|
|
45
|
+
[localization.thinProvisioning, true, '132px', storageTableKeys[7]],
|
|
46
|
+
[localization.access, true, '110px', storageTableKeys[8]],
|
|
47
|
+
[localization.hardwareAcceleration, true, '134px', storageTableKeys[9]],
|
|
48
|
+
[localization.driverType, true, '110px', storageTableKeys[10]],
|
|
49
|
+
[localization.device, true, '110px', storageTableKeys[11]],
|
|
50
|
+
[localization.storageIoControl, true, '110px', storageTableKeys[12]],
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const columnKeys = (
|
|
55
|
+
localization: UI_I_Localization
|
|
56
|
+
): UI_I_ColumnKey[] => {
|
|
57
|
+
const result: UI_I_ColumnKey[] = []
|
|
58
|
+
getItems(localization).forEach((item, i) => {
|
|
59
|
+
const col = i === 0 ? 'icon' : `col${i}`
|
|
60
|
+
result.push(constructColumnKey(col, item[0], item[1]))
|
|
61
|
+
})
|
|
62
|
+
return result
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
66
|
+
const result: UI_I_HeadItem[] = []
|
|
67
|
+
getItems(localization).forEach((item, i) => {
|
|
68
|
+
const col = i === 0 ? 'icon' : `col${i}`
|
|
69
|
+
result.push(constructHeadItem(col, item[0], item[3], true, item[2]))
|
|
70
|
+
})
|
|
71
|
+
return result
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const bodyItems = (
|
|
75
|
+
data: UI_I_DatastoreTableItem[],
|
|
76
|
+
localization: UI_I_Localization
|
|
77
|
+
): UI_I_BodyItem[][] => {
|
|
78
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
79
|
+
const { $binary } = useNuxtApp()
|
|
80
|
+
|
|
81
|
+
data.forEach((storage: UI_I_DatastoreTableItem, key: number) => {
|
|
82
|
+
const state =
|
|
83
|
+
localization[datastoreLocalizationByState[storage[storageTableKeys[1]]]]
|
|
84
|
+
bodyItems.push([
|
|
85
|
+
{
|
|
86
|
+
key: 'icon',
|
|
87
|
+
text: storage[storageTableKeys[0]].toString(),
|
|
88
|
+
data: `vsphere-icon-${datastoreIconByState[storage.state]}`,
|
|
89
|
+
id: key,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
key: 'col1',
|
|
93
|
+
text: state,
|
|
94
|
+
id: key,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
key: 'col2',
|
|
98
|
+
text: $binary.round(storage.capacity[storageTableKeys[2]]),
|
|
99
|
+
id: key,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
key: 'col3',
|
|
103
|
+
text: $binary.round(storage.capacity[storageTableKeys[3]].toString()),
|
|
104
|
+
id: key,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: 'col4',
|
|
108
|
+
text: $binary.round(storage.capacity[storageTableKeys[4]].toString()),
|
|
109
|
+
id: key,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
key: 'col5',
|
|
113
|
+
text: $binary.round(storage.capacity[storageTableKeys[5]].toString()),
|
|
114
|
+
id: key,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
key: 'col6',
|
|
118
|
+
text: storage[storageTableKeys[6]].toString(),
|
|
119
|
+
id: key,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
key: 'col7',
|
|
123
|
+
text: storage[storageTableKeys[7]] ? localization.yes : localization.no,
|
|
124
|
+
id: key,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
key: 'col8',
|
|
128
|
+
text: storage[storageTableKeys[8]].toString(),
|
|
129
|
+
id: key,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
key: 'col9',
|
|
133
|
+
text: storage[storageTableKeys[9]].toString(),
|
|
134
|
+
id: key,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
key: 'col10',
|
|
138
|
+
text: storage[storageTableKeys[10]].toString(),
|
|
139
|
+
id: key,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
key: 'col11',
|
|
143
|
+
text: storage[storageTableKeys[11]].toString(),
|
|
144
|
+
id: key,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
key: 'col12',
|
|
148
|
+
text: storage[storageTableKeys[12]].toString(),
|
|
149
|
+
id: key,
|
|
150
|
+
},
|
|
151
|
+
])
|
|
152
|
+
})
|
|
153
|
+
return bodyItems
|
|
154
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type UI_T_StorageColumnKeys = [
|
|
2
|
+
'name',
|
|
3
|
+
'state',
|
|
4
|
+
'capacity_mb',
|
|
5
|
+
'provisioned_mb',
|
|
6
|
+
'free_mb',
|
|
7
|
+
'used_mb',
|
|
8
|
+
'type_text',
|
|
9
|
+
'thin_provisioning',
|
|
10
|
+
'access_mode',
|
|
11
|
+
'hardware_acceleration',
|
|
12
|
+
'drive_type',
|
|
13
|
+
'device',
|
|
14
|
+
'storage_io_control',
|
|
15
|
+
]
|