bfg-common 1.5.418 → 1.5.420

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 (34) hide show
  1. package/components/common/backup/storage/actions/delete/Delete.vue +1 -1
  2. package/components/common/modals/confirmation/ConfirmationNew.vue +1 -1
  3. package/components/common/pages/backups/lib/models/interfaces.ts +13 -1
  4. package/components/common/pages/backups/lib/models/types.ts +3 -3
  5. package/components/common/{backup → pages/backups}/lib/utils/getBackupOrBackupStorageId.ts +0 -4
  6. package/components/common/pages/backups/modals/Modals.vue +16 -37
  7. package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +15 -33
  8. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/MaxBandwidth.vue +3 -2
  9. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +2 -2
  10. package/components/common/pages/backups/modals/createBackup/configuration/strategy/Strategy.vue +2 -3
  11. package/components/common/pages/backups/modals/createBackup/datastores/Datastores.vue +5 -4
  12. package/components/common/pages/backups/modals/createBackup/datastores/tableView/TableView.vue +95 -94
  13. package/components/common/pages/backups/modals/createBackup/datastores/tableView/lib/config/table.ts +119 -117
  14. package/components/common/pages/backups/modals/createBackup/disks/tableView/lib/config/table.ts +117 -117
  15. package/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions.ts +2 -2
  16. package/components/common/pages/backups/modals/deleteBackup/DeleteBackup.vue +12 -5
  17. package/components/common/pages/backups/modals/lib/models/interfaces.ts +185 -164
  18. package/components/common/pages/backups/modals/restore/Restore.vue +74 -45
  19. package/components/common/pages/backups/modals/restore/disks/Disks.vue +4 -5
  20. package/components/common/pages/backups/modals/restore/disks/tableView/TableView.vue +9 -8
  21. package/components/common/pages/backups/modals/restore/disks/tableView/lib/config/table.ts +117 -114
  22. package/components/common/pages/backups/modals/restore/lib/config/restoreCodes.ts +5 -0
  23. package/components/common/pages/backups/modals/restore/lib/config/steps.ts +108 -92
  24. package/components/common/pages/backups/modals/restore/name/Name.vue +160 -159
  25. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -0
  26. package/components/common/pages/backups/modals/restore/networks/Networks.vue +67 -67
  27. package/components/common/pages/backups/modals/restore/networks/table/Table.vue +3 -5
  28. package/components/common/pages/backups/modals/restore/networks/table/lib/config/networkTable.ts +1 -8
  29. package/components/common/pages/backups/modals/restore/types/Types.vue +10 -11
  30. package/components/common/pages/backups/modals/restore/types/lib/config/typeOptions.ts +25 -24
  31. package/components/common/pages/backups/tools/lib/config/tabs.ts +7 -7
  32. package/package.json +1 -1
  33. package/components/common/pages/backups/modals/createBackup/lib/config/createBackup.ts +0 -14
  34. package/components/common/pages/backups/modals/restore/disks/tableView/lib/models/interfaces.ts +0 -4
@@ -1,114 +1,117 @@
1
- import type {
2
- UI_I_HeadItem,
3
- UI_I_ColumnKey,
4
- UI_I_BodyItem,
5
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
6
- import type { UI_I_Localization } from '~/lib/models/interfaces'
7
- import {
8
- constructHeadItem,
9
- constructColumnKey,
10
- } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
11
- import { tableKeys } from '~/components/common/pages/backups/modals/createBackup/disks/tableView/lib/config/keys'
12
-
13
- const getItems = (
14
- localization: UI_I_Localization
15
- ): [string, boolean, string, string][] => {
16
- return [
17
- [localization.common.source, true, '180px', tableKeys[0]],
18
- [localization.common.deviceType, true, '180px', tableKeys[1]],
19
- [localization.common.bus, true, '180px', tableKeys[2]],
20
- [localization.common.target, true, '180px', tableKeys[3]],
21
- [localization.common.capacity, true, '180px', tableKeys[4]],
22
- [localization.common.used, true, '180px', tableKeys[5]],
23
- [localization.common.free, true, '180px', tableKeys[6]],
24
- [localization.common.volumePath, true, '180px', tableKeys[7]],
25
- ]
26
- }
27
- export const columnKeys = (
28
- localization: UI_I_Localization
29
- ): UI_I_ColumnKey[] => {
30
- const result: UI_I_ColumnKey[] = []
31
- getItems(localization).forEach((item, i) => {
32
- result.push(
33
- constructColumnKey(`col${i}`, item[0], item[1], `show-column-${item[3]}`)
34
- )
35
- })
36
- return result
37
- }
38
- export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
39
- const result: UI_I_HeadItem[] = []
40
- getItems(localization).forEach((item, i) => {
41
- result.push(
42
- constructHeadItem(
43
- `col${i}`,
44
- item[0],
45
- item[3],
46
- true,
47
- item[2],
48
- undefined,
49
- item[3]
50
- )
51
- )
52
- })
53
- return result
54
- }
55
-
56
- export const bodyItems = (data: I_DiskDevice[]): UI_I_BodyItem[][] => {
57
- const { $binary }: any = useNuxtApp()
58
- const lang = useLocalStorage('lang') === 'ru_RU' ? 'ru' : 'en'
59
-
60
- const bodyItems: UI_I_BodyItem[][] = []
61
- data.forEach((disk: I_DiskDevice) => {
62
- bodyItems.push([
63
- {
64
- key: 'col0',
65
- text: disk[tableKeys[0]],
66
- id: disk.source,
67
- data: {
68
- location: disk.source,
69
- target: disk.target,
70
- },
71
- },
72
- {
73
- key: 'col1',
74
- text: disk[tableKeys[1]],
75
- id: disk.source,
76
- },
77
- {
78
- key: 'col2',
79
- text: disk[tableKeys[2]],
80
- id: disk.source,
81
- },
82
- {
83
- key: 'col3',
84
- text: disk[tableKeys[3]],
85
- id: disk.source,
86
- },
87
- {
88
- key: 'col4',
89
- text: $binary.round(disk[tableKeys[4]], false, lang),
90
- id: disk.source,
91
- },
92
- {
93
- key: 'col5',
94
- text: $binary.round(
95
- disk[tableKeys[4]] - disk[tableKeys[6]],
96
- false,
97
- lang
98
- ),
99
- id: disk.source,
100
- },
101
- {
102
- key: 'col6',
103
- text: $binary.round(disk[tableKeys[6]], false, lang),
104
- id: disk.source,
105
- },
106
- {
107
- key: 'col7',
108
- text: disk[tableKeys[7]],
109
- id: disk.source,
110
- },
111
- ])
112
- })
113
- return bodyItems
114
- }
1
+ import type {
2
+ UI_I_HeadItem,
3
+ UI_I_ColumnKey,
4
+ UI_I_BodyItem,
5
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
6
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
7
+ import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
8
+ import {
9
+ constructHeadItem,
10
+ constructColumnKey,
11
+ } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
12
+ import { tableKeys } from '~/components/common/pages/backups/modals/restore/disks/tableView/lib/config/keys'
13
+
14
+ const getItems = (
15
+ localization: UI_I_Localization
16
+ ): [string, boolean, string, string][] => {
17
+ return [
18
+ [localization.common.source, true, '180px', tableKeys[0]],
19
+ [localization.common.deviceType, true, '180px', tableKeys[1]],
20
+ [localization.common.bus, true, '180px', tableKeys[2]],
21
+ [localization.common.target, true, '180px', tableKeys[3]],
22
+ [localization.common.capacity, true, '180px', tableKeys[4]],
23
+ [localization.common.used, true, '180px', tableKeys[5]],
24
+ [localization.common.free, true, '180px', tableKeys[6]],
25
+ [localization.common.volumePath, true, '180px', tableKeys[7]],
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
+ result.push(
34
+ constructColumnKey(`col${i}`, item[0], item[1], `show-column-${item[3]}`)
35
+ )
36
+ })
37
+ return result
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
+ result.push(
43
+ constructHeadItem(
44
+ `col${i}`,
45
+ item[0],
46
+ item[3],
47
+ true,
48
+ item[2],
49
+ undefined,
50
+ item[3]
51
+ )
52
+ )
53
+ })
54
+ return result
55
+ }
56
+
57
+ export const bodyItems = (
58
+ data: UI_I_RestoreForm['pvm']['disk_devices']
59
+ ): UI_I_BodyItem[][] => {
60
+ const { $binary }: any = useNuxtApp()
61
+ const lang = useLocalStorage('lang') === 'ru_RU' ? 'ru' : 'en'
62
+
63
+ const bodyItems: UI_I_BodyItem[][] = []
64
+ data.forEach((disk: UI_I_RestoreForm['pvm']['disk_devices'][0]) => {
65
+ bodyItems.push([
66
+ {
67
+ key: 'col0',
68
+ text: disk[tableKeys[0]],
69
+ id: disk.source,
70
+ data: {
71
+ location: disk.source,
72
+ target: disk.target,
73
+ },
74
+ },
75
+ {
76
+ key: 'col1',
77
+ text: disk[tableKeys[1]],
78
+ id: disk.source,
79
+ },
80
+ {
81
+ key: 'col2',
82
+ text: disk[tableKeys[2]],
83
+ id: disk.source,
84
+ },
85
+ {
86
+ key: 'col3',
87
+ text: disk[tableKeys[3]],
88
+ id: disk.source,
89
+ },
90
+ {
91
+ key: 'col4',
92
+ text: $binary.round(disk[tableKeys[4]], false, lang),
93
+ id: disk.source,
94
+ },
95
+ {
96
+ key: 'col5',
97
+ text: $binary.round(
98
+ disk[tableKeys[4]] - disk[tableKeys[6]],
99
+ false,
100
+ lang
101
+ ),
102
+ id: disk.source,
103
+ },
104
+ {
105
+ key: 'col6',
106
+ text: $binary.round(disk[tableKeys[6]], false, lang),
107
+ id: disk.source,
108
+ },
109
+ {
110
+ key: 'col7',
111
+ text: disk[tableKeys[7]],
112
+ id: disk.source,
113
+ },
114
+ ])
115
+ })
116
+ return bodyItems
117
+ }
@@ -0,0 +1,5 @@
1
+ export const restoreCodes = {
2
+ diskOnly: 1,
3
+ existing: 2,
4
+ asNew: 3
5
+ }
@@ -1,92 +1,108 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
3
- import { UI_E_WIZARD_STATUS } from '~/components/atoms/wizard/lib/models/enums'
4
-
5
- export const stepsFunc = (
6
- localization: UI_I_Localization
7
- ): UI_I_WizardStep[] => {
8
- return [
9
- {
10
- id: 0,
11
- stepName: '',
12
- title: localization.common.selectAType,
13
- subTitle: '',
14
- status: UI_E_WIZARD_STATUS.SELECTED,
15
- isValid: true,
16
- fields: {},
17
- testId: 'backup-restore-type',
18
- },
19
- {
20
- id: 1,
21
- stepName: '',
22
- title: localization.common.selectName,
23
- subTitle: '',
24
- status: UI_E_WIZARD_STATUS.INACTIVE,
25
- isValid: true,
26
- testId: 'backup-restore-select-name',
27
- fields: {
28
- name: {
29
- field: '',
30
- alert: '',
31
- },
32
- },
33
- },
34
- {
35
- id: 2,
36
- stepName: '',
37
- title: localization.common.selectStorage,
38
- subTitle: '',
39
- status: UI_E_WIZARD_STATUS.INACTIVE,
40
- isValid: true,
41
- testId: 'backup-restore-select-storage',
42
- fields: {
43
- storage: {
44
- field: '',
45
- alert: '',
46
- },
47
- },
48
- },
49
- {
50
- id: 3,
51
- stepName: '',
52
- title: localization.common.selectDisks,
53
- subTitle: localization.common.selectDisksInvolvedBackup,
54
- status: UI_E_WIZARD_STATUS.INACTIVE,
55
- isValid: true,
56
- fields: {
57
- disk_devices: {
58
- field: '',
59
- alert: '',
60
- },
61
- },
62
- testId: 'backup-restore-select--disks',
63
- },
64
- {
65
- id: 4,
66
- stepName: '',
67
- title: localization.common.selectNetwork,
68
- subTitle: '',
69
- status: UI_E_WIZARD_STATUS.INACTIVE,
70
- isValid: true,
71
- testId: 'backup-restore-select-network',
72
- fields: {},
73
- },
74
- {
75
- id: 5,
76
- stepName: '',
77
- title: localization.common.readyComplete,
78
- subTitle: localization.common.clickFinishRestore,
79
- status: UI_E_WIZARD_STATUS.INACTIVE,
80
- isValid: true,
81
- testId: 'backup-restore-ready-complete',
82
- fields: {},
83
- },
84
- ]
85
- }
86
-
87
- export const stepsSchemeInitial = [
88
- // [0, 1, 5], // disk only
89
- [0, 5], // disk only
90
- [0, 5], // existing
91
- [0, 1, 2, 3, 4, 5], // as new
92
- ]
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
3
+ import { UI_E_WIZARD_STATUS } from '~/components/atoms/wizard/lib/models/enums'
4
+
5
+ export const dynamicSteps = {
6
+ selectType: 0,
7
+ selectName: 1,
8
+ selectStorage: 2,
9
+ selectDisks: 3,
10
+ selectNetwork: 4,
11
+ readyComplete: 5,
12
+ }
13
+
14
+ export const stepsFunc = (
15
+ localization: UI_I_Localization
16
+ ): UI_I_WizardStep[] => {
17
+ return [
18
+ {
19
+ id: dynamicSteps.selectType,
20
+ stepName: '',
21
+ title: localization.common.selectAType,
22
+ subTitle: '',
23
+ status: UI_E_WIZARD_STATUS.SELECTED,
24
+ isValid: true,
25
+ fields: {},
26
+ testId: 'backup-restore-type',
27
+ },
28
+ {
29
+ id: dynamicSteps.selectName,
30
+ stepName: '',
31
+ title: localization.common.selectName,
32
+ subTitle: '',
33
+ status: UI_E_WIZARD_STATUS.INACTIVE,
34
+ isValid: true,
35
+ testId: 'backup-restore-select-name',
36
+ fields: {
37
+ name: {
38
+ field: '',
39
+ alert: '',
40
+ },
41
+ },
42
+ },
43
+ {
44
+ id: dynamicSteps.selectStorage,
45
+ stepName: '',
46
+ title: localization.common.selectStorage,
47
+ subTitle: '',
48
+ status: UI_E_WIZARD_STATUS.INACTIVE,
49
+ isValid: true,
50
+ testId: 'backup-restore-select-storage',
51
+ fields: {
52
+ storage: {
53
+ field: '',
54
+ alert: '',
55
+ },
56
+ },
57
+ },
58
+ {
59
+ id: dynamicSteps.selectDisks,
60
+ stepName: '',
61
+ title: localization.common.selectDisks,
62
+ subTitle: localization.common.selectDisksInvolvedBackup,
63
+ status: UI_E_WIZARD_STATUS.INACTIVE,
64
+ isValid: true,
65
+ fields: {
66
+ disk_devices: {
67
+ field: '',
68
+ alert: '',
69
+ },
70
+ },
71
+ testId: 'backup-restore-select--disks',
72
+ },
73
+ {
74
+ id: dynamicSteps.selectNetwork,
75
+ stepName: '',
76
+ title: localization.common.selectNetwork,
77
+ subTitle: '',
78
+ status: UI_E_WIZARD_STATUS.INACTIVE,
79
+ isValid: true,
80
+ testId: 'backup-restore-select-network',
81
+ fields: {},
82
+ },
83
+ {
84
+ id: dynamicSteps.readyComplete,
85
+ stepName: '',
86
+ title: localization.common.readyComplete,
87
+ subTitle: localization.common.clickFinishRestore,
88
+ status: UI_E_WIZARD_STATUS.INACTIVE,
89
+ isValid: true,
90
+ testId: 'backup-restore-ready-complete',
91
+ fields: {},
92
+ },
93
+ ]
94
+ }
95
+
96
+ export const stepsSchemeInitial = [
97
+ // [0, 1, 5], // disk only
98
+ [dynamicSteps.selectType, dynamicSteps.readyComplete], // disk only
99
+ [dynamicSteps.selectType, dynamicSteps.readyComplete], // existing
100
+ [
101
+ dynamicSteps.selectType,
102
+ dynamicSteps.selectName,
103
+ dynamicSteps.selectStorage,
104
+ dynamicSteps.selectDisks,
105
+ dynamicSteps.selectNetwork,
106
+ dynamicSteps.readyComplete,
107
+ ], // as new
108
+ ]