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.
Files changed (41) hide show
  1. package/assets/localization/local_be.json +5 -1
  2. package/assets/localization/local_en.json +5 -1
  3. package/assets/localization/local_hy.json +5 -1
  4. package/assets/localization/local_kk.json +5 -1
  5. package/assets/localization/local_ru.json +5 -1
  6. package/assets/localization/local_zh.json +5 -1
  7. package/components/atoms/modal/bySteps/BySteps.vue +1 -1
  8. package/components/atoms/modal/byStepsSecond/ByStepsSecond.vue +2 -2
  9. package/components/atoms/step/VerticalStep.vue +1 -1
  10. package/components/common/monitor/advanced/tools/Tools.vue +428 -428
  11. package/components/common/wizards/datastore/add/config/stepItems.ts +3 -3
  12. package/components/common/wizards/vm/common/Tooltip.vue +74 -0
  13. package/components/common/wizards/vm/common/readyComplete/ReadyComplete.vue +15 -0
  14. package/components/common/wizards/vm/migrate/Migrate.vue +204 -0
  15. package/components/common/wizards/vm/migrate/config/constructDataReady.ts +82 -0
  16. package/components/common/wizards/vm/migrate/contentHeading/ContentHeading.vue +31 -0
  17. package/components/common/wizards/vm/migrate/models/enums.ts +6 -0
  18. package/components/common/wizards/vm/migrate/models/interfaces.ts +13 -0
  19. package/components/common/wizards/vm/migrate/models/types.ts +5 -0
  20. package/components/common/wizards/vm/migrate/select/storage/Storage.vue +136 -0
  21. package/components/common/wizards/vm/migrate/select/storage/config/tabsPannel.ts +18 -0
  22. package/components/common/wizards/vm/migrate/select/storage/configure/batch/Batch.vue +61 -0
  23. package/components/common/wizards/vm/migrate/select/storage/configure/disk/Disk.vue +73 -0
  24. package/components/common/wizards/vm/migrate/select/storage/diskFormat/DiskFormat.vue +68 -0
  25. package/components/common/wizards/vm/migrate/select/storage/diskFormat/config/formatOptions.ts +22 -0
  26. package/components/common/wizards/vm/migrate/select/storage/models/interfaces.ts +14 -0
  27. package/components/common/wizards/vm/migrate/select/storage/models/types.ts +3 -0
  28. package/components/common/wizards/vm/migrate/select/storage/policy/Policy.vue +83 -0
  29. package/components/common/wizards/vm/migrate/select/storage/selectedPerDisk/SelectedPerDisk.vue +84 -0
  30. package/components/common/wizards/vm/migrate/select/storage/table/datastore/Datastore.vue +105 -0
  31. package/components/common/wizards/vm/migrate/select/storage/table/datastore/config/config.ts +154 -0
  32. package/components/common/wizards/vm/migrate/select/storage/table/datastore/models/types.ts +15 -0
  33. package/components/common/wizards/vm/migrate/select/storage/table/disk/Disk.vue +73 -0
  34. package/components/common/wizards/vm/migrate/select/storage/table/disk/config/config.ts +102 -0
  35. package/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces.ts +9 -0
  36. package/components/common/wizards/vm/migrate/select/storage/table/disk/models/types.ts +9 -0
  37. package/components/common/wizards/vm/migrate/select/type/Type.vue +38 -0
  38. package/components/common/wizards/vm/migrate/select/type/config/typeOptions.ts +41 -0
  39. package/components/common/wizards/vm/migrate/select/type/models/interfaces.ts +5 -0
  40. package/components/common/wizards/vm/migrate/utils.ts +125 -0
  41. package/package.json +1 -1
@@ -0,0 +1,73 @@
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-page-size
15
+ @sorting="sorting"
16
+ >
17
+ </atoms-table-data-grid>
18
+ </div>
19
+ </template>
20
+
21
+ <script lang="ts" setup>
22
+ import type { UI_I_Pagination, UI_I_Localization } from '~/models/interfaces'
23
+ import type {
24
+ UI_I_ColumnKey,
25
+ UI_I_HeadItem,
26
+ UI_I_BodyItem,
27
+ } from '~/components/atoms/table/dataGrid/models/interfaces'
28
+ import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/interfaces'
29
+ import * as table from '~/components/common/wizards/vm/migrate/select/storage/table/disk/config/config'
30
+
31
+ const props = defineProps<{
32
+ selectedPerDisk: number[]
33
+ configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
34
+ }>()
35
+ const emits = defineEmits<{
36
+ (event: 'update:selected-per-disk', value: number[]): void
37
+ }>()
38
+
39
+ const localization = computed<UI_I_Localization>(() => useLocal())
40
+
41
+ const headItems = ref<UI_I_HeadItem[]>(table.headItems(localization.value))
42
+ const columnKeys = ref<UI_I_ColumnKey[]>(table.columnKeys(localization.value))
43
+ watch(localization, () => {
44
+ columnKeys.value = table.columnKeys(localization.value)
45
+ })
46
+
47
+ const bodyItems = computed<UI_I_BodyItem[][]>(() => {
48
+ return table.bodyItems(props.configurePerDisks)
49
+ })
50
+
51
+ const sort = ref<string | null>(null)
52
+ const pagination = ref<UI_I_Pagination>({
53
+ page: 1,
54
+ pageSize: 100,
55
+ })
56
+
57
+ const sorting = (data: [string, boolean]): void => {
58
+ const [column, status] = data
59
+ const direction = status ? 'asc' : 'desc'
60
+ sort.value = `${column}.${direction}`
61
+ }
62
+
63
+ const selectedRow = computed<number[]>({
64
+ get() {
65
+ return props.selectedPerDisk
66
+ },
67
+ set(newValue: number[]) {
68
+ emits('update:selected-per-disk', newValue)
69
+ },
70
+ })
71
+ </script>
72
+
73
+ <style lang="scss" scoped></style>
@@ -0,0 +1,102 @@
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 type { UI_T_StorageTableItemTuple } from '~/components/common/wizards/vm/migrate/select/storage/table/disk/models/types'
12
+ 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
+ ]
23
+ const getItems = (
24
+ localization: UI_I_Localization
25
+ ): [string, boolean, string, string][] => {
26
+ return [
27
+ [localization.virtualMachine, true, '96px', storageTableKeys[0]],
28
+ [localization.diskGroup, false, '138px', storageTableKeys[1]],
29
+ [localization.file, true, '110px', storageTableKeys[2]],
30
+ [localization.storage, true, '96px', storageTableKeys[3]],
31
+ [localization.diskFormat, true, '110px', storageTableKeys[4]],
32
+ [localization.vmStoragePolicy, true, '110px', storageTableKeys[5]],
33
+ [localization.replicationGroup, true, '110px', storageTableKeys[6]],
34
+ ]
35
+ }
36
+
37
+ export const columnKeys = (
38
+ localization: UI_I_Localization
39
+ ): UI_I_ColumnKey[] => {
40
+ const result: UI_I_ColumnKey[] = []
41
+ getItems(localization).forEach((item, i) => {
42
+ const col = `col${i}`
43
+ result.push(constructColumnKey(col, item[0], item[1]))
44
+ })
45
+ return result
46
+ }
47
+
48
+ export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
49
+ const result: UI_I_HeadItem[] = []
50
+ getItems(localization).forEach((item, i) => {
51
+ const col = `col${i}`
52
+ result.push(constructHeadItem(col, item[0], item[3], true, item[2]))
53
+ })
54
+ return result
55
+ }
56
+
57
+ export const bodyItems = (
58
+ data: UI_I_StorageConfigurePerDiskItem[]
59
+ ): UI_I_BodyItem[][] => {
60
+ const bodyItems: UI_I_BodyItem[][] = []
61
+
62
+ data.forEach((storage: UI_I_StorageConfigurePerDiskItem, key: number) => {
63
+ bodyItems.push([
64
+ {
65
+ key: 'col0',
66
+ text: storage[storageTableKeys[0]],
67
+ id: key,
68
+ },
69
+ {
70
+ key: 'col1',
71
+ text: storage[storageTableKeys[1]],
72
+ id: key,
73
+ },
74
+ {
75
+ key: 'col2',
76
+ text: storage[storageTableKeys[2]],
77
+ id: key,
78
+ },
79
+ {
80
+ key: 'col3',
81
+ text: storage[storageTableKeys[3]],
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]],
97
+ id: key,
98
+ },
99
+ ])
100
+ })
101
+ return bodyItems
102
+ }
@@ -0,0 +1,9 @@
1
+ export interface UI_I_StorageConfigurePerDiskItem {
2
+ name: string
3
+ disk_group: string
4
+ file: string
5
+ storage: string
6
+ disk_format: string
7
+ vm_storage_policy: string
8
+ replication_group: string
9
+ }
@@ -0,0 +1,9 @@
1
+ export type UI_T_StorageTableItemTuple = [
2
+ 'name',
3
+ 'disk_group',
4
+ 'file',
5
+ 'storage',
6
+ 'disk_format',
7
+ 'vm_storage_policy',
8
+ 'replication_group'
9
+ ]
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <div>
3
+ <common-select-radio-group
4
+ v-model="selectedType"
5
+ :options="vmMigrationTypes"
6
+ />
7
+ </div>
8
+ </template>
9
+
10
+ <script lang="ts" setup>
11
+ import type { UI_T_Project } from '~/models/types'
12
+ import type { UI_I_VmMigrateTypeOption } from '~/components/common/wizards/vm/migrate/select/type/models/interfaces'
13
+ import { vmMigrateTypesFunc } from '~/components/common/wizards/vm/migrate/select/type/config/typeOptions'
14
+
15
+ const props = defineProps<{
16
+ modelValue: string
17
+ project: UI_T_Project
18
+ }>()
19
+ const emits = defineEmits<{
20
+ (event: 'update:model-value', value: string | number): void
21
+ }>()
22
+ const localization = computed<any>(() => useLocal())
23
+
24
+ const vmMigrationTypes = ref<UI_I_VmMigrateTypeOption[]>(
25
+ vmMigrateTypesFunc(localization.value, props.project)
26
+ )
27
+
28
+ const selectedType = computed<string>({
29
+ get() {
30
+ return props.modelValue
31
+ },
32
+ set(newValue) {
33
+ emits('update:model-value', newValue)
34
+ },
35
+ })
36
+ </script>
37
+
38
+ <style lang="scss" scoped></style>
@@ -0,0 +1,41 @@
1
+ import { UI_I_Localization } from '~/models/interfaces'
2
+ import type { UI_T_Project } from '~/models/types'
3
+ import type { UI_I_VmMigrateTypeOption } from '~/components/common/wizards/vm/migrate/select/type/models/interfaces'
4
+
5
+ export const vmMigrateTypesFunc = (
6
+ localization: UI_I_Localization,
7
+ project: UI_T_Project
8
+ ): UI_I_VmMigrateTypeOption[] => {
9
+ const options: UI_I_VmMigrateTypeOption[] = [
10
+ {
11
+ label: localization.changeComputeResourceOnly,
12
+ value: 'resource',
13
+ disabled: false,
14
+ description: localization.changeComputeResourceOnlyDesc,
15
+ permissions: ['sphere'],
16
+ },
17
+ {
18
+ label: localization.changeStorageOnly,
19
+ value: 'storage',
20
+ disabled: false,
21
+ description: localization.changeStorageOnlyDesc,
22
+ permissions: ['sphere', 'procurator'],
23
+ },
24
+ {
25
+ label: localization.changeBothComputeResourceStorage,
26
+ value: 'resource-storage',
27
+ disabled: false,
28
+ description: localization.changeBothComputeResourceStorageDesc,
29
+ permissions: ['sphere'],
30
+ },
31
+ {
32
+ label: localization.crossVCenterServerExport,
33
+ value: 'server',
34
+ disabled: true,
35
+ description: localization.crossVCenterServerExportDesc,
36
+ permissions: ['sphere'],
37
+ },
38
+ ]
39
+
40
+ return options.filter((option) => option.permissions.includes(project))
41
+ }
@@ -0,0 +1,5 @@
1
+ import type { UI_I_RadioOption } from '~/components/common/select/radio/models/interfaces'
2
+
3
+ export interface UI_I_VmMigrateTypeOption extends UI_I_RadioOption {
4
+ permissions: string[]
5
+ }
@@ -0,0 +1,125 @@
1
+ import type { UI_I_Localization } from '~/models/interfaces'
2
+ import type { UI_T_VmMigrateType } from '~/components/common/wizards/vm/migrate/models/types'
3
+ import type { UI_T_Project } from '~/models/types'
4
+ import { UI_I_MigrateVerticalStepItem } from '~/components/common/wizards/vm/migrate/models/interfaces'
5
+
6
+ export const stepItemsFunc = (
7
+ localization: UI_I_Localization,
8
+ type: UI_T_VmMigrateType,
9
+ project: UI_T_Project
10
+ ): UI_I_MigrateVerticalStepItem[] => {
11
+ const stepsType = {
12
+ sphere: stepForSphere,
13
+ procurator: stepForProcurator,
14
+ }
15
+
16
+ return stepsType[project](localization, type)
17
+ }
18
+
19
+ const stepForSphere = (
20
+ localization: UI_I_Localization
21
+ ): UI_I_MigrateVerticalStepItem[] => {
22
+ return [
23
+ {
24
+ text: localization.selectName,
25
+ disabled: false,
26
+ complete: false,
27
+ description: '',
28
+ id: '',
29
+ },
30
+ {
31
+ text: localization.selectStorage,
32
+ disabled: true,
33
+ complete: false,
34
+ description: '',
35
+ id: '',
36
+ },
37
+ {
38
+ text: localization.selectCloneOptions,
39
+ disabled: true,
40
+ complete: false,
41
+ description: '',
42
+ id: '',
43
+ },
44
+ {
45
+ text: localization.customizeHardware,
46
+ disabled: true,
47
+ complete: false,
48
+ description: '',
49
+ id: '',
50
+ },
51
+ {
52
+ text: localization.readyComplete,
53
+ disabled: true,
54
+ complete: false,
55
+ description: '',
56
+ id: '',
57
+ },
58
+ ]
59
+ }
60
+
61
+ const stepForProcurator = (
62
+ localization: UI_I_Localization,
63
+ type: UI_T_VmMigrateType
64
+ ): UI_I_MigrateVerticalStepItem[] => {
65
+ const stepItems: UI_I_MigrateVerticalStepItem[] = [
66
+ {
67
+ text: localization.selectMigrationType,
68
+ disabled: false,
69
+ complete: false,
70
+ description: localization.selectMigrationTypeDesc,
71
+ id: 'select-migration-type',
72
+ },
73
+ {
74
+ text: localization.selectTargetVCenterSer,
75
+ disabled: true,
76
+ complete: false,
77
+ description: localization.selectComputeResourceDesc,
78
+ permissions: ['server'],
79
+ id: 'select-target-center',
80
+ },
81
+ {
82
+ text: localization.selectComputeResource,
83
+ disabled: true,
84
+ complete: false,
85
+ description: localization.selectComputeResourceDesc,
86
+ permissions: ['resource', 'resource-storage', 'server'],
87
+ id: 'select-compute-resource',
88
+ },
89
+ {
90
+ text: localization.selectStorage,
91
+ disabled: true,
92
+ complete: false,
93
+ description: localization.selectStorageDesc,
94
+ permissions: ['storage', 'resource-storage', 'server'],
95
+ id: 'select-storage',
96
+ },
97
+ {
98
+ text: localization.selectNetworks,
99
+ disabled: true,
100
+ complete: false,
101
+ description: localization.selectNetworksDesc,
102
+ permissions: ['resource', 'resource-storage', 'server'],
103
+ id: 'select-networks',
104
+ },
105
+ {
106
+ text: localization.selectVMotionPriority,
107
+ disabled: true,
108
+ complete: false,
109
+ description: localization.selectVMotionPriorityDesc,
110
+ permissions: ['resource', 'resource-storage', 'server'],
111
+ id: 'select-motion-priority',
112
+ },
113
+ {
114
+ text: localization.readyComplete,
115
+ disabled: true,
116
+ complete: false,
117
+ id: 'ready-complete',
118
+ },
119
+ ]
120
+
121
+ return stepItems.filter((item) => {
122
+ // Если свойства permissions нет, возвращаем элемент
123
+ return !item.permissions || item.permissions.includes(type)
124
+ })
125
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.2.108",
4
+ "version": "1.2.109",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",