bfg-common 1.5.720 → 1.5.722
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/components/common/backup/storage/actions/add/lib/config/createDatastore.ts +1 -1
- package/components/common/backup/storage/actions/add/steps/typeMode/lib/config/typeOptions.ts +20 -20
- package/components/common/pages/backups/modals/restore/lib/config/readyToCompleteOptions.ts +84 -62
- package/components/common/pages/backups/modals/restore/lib/config/steps.ts +113 -108
- package/composables/useBrowse.ts +24 -0
- package/lib/models/composables/useBrowse/interfaces.ts +4 -0
- package/package.json +1 -1
package/components/common/backup/storage/actions/add/steps/typeMode/lib/config/typeOptions.ts
CHANGED
|
@@ -5,26 +5,26 @@ export const datastoreTypesFunc = (
|
|
|
5
5
|
localization: UI_I_Localization
|
|
6
6
|
): UI_I_RadioOption[] => {
|
|
7
7
|
return [
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
8
|
+
// {
|
|
9
|
+
// id: 'datastore-type-nfs',
|
|
10
|
+
// label: localization.common.nfs,
|
|
11
|
+
// value: 2,
|
|
12
|
+
// disabled: false,
|
|
13
|
+
// description: localization.common.nfsDesc,
|
|
14
|
+
// isTooltip: false,
|
|
15
|
+
// tooltipContent: localization.common.nfsHelpDesc,
|
|
16
|
+
// testId: 'datastore-type-nfs',
|
|
17
|
+
// },
|
|
18
|
+
// {
|
|
19
|
+
// id: 'datastore-type-samba',
|
|
20
|
+
// label: localization.common.samba,
|
|
21
|
+
// value: 3,
|
|
22
|
+
// disabled: false,
|
|
23
|
+
// description: localization.common.sambaDesc,
|
|
24
|
+
// isTooltip: false,
|
|
25
|
+
// tooltipContent: localization.common.sambaHelpDesc,
|
|
26
|
+
// testId: 'datastore-type-samba',
|
|
27
|
+
// },
|
|
28
28
|
{
|
|
29
29
|
id: 'datastore-type-shared-storm',
|
|
30
30
|
label: localization.common.stormSharedStorage,
|
|
@@ -1,62 +1,84 @@
|
|
|
1
|
-
import type {UI_I_RestoreForm} from
|
|
2
|
-
import type {UI_I_Localization} from
|
|
3
|
-
import type {UI_I_TableInfoItem} from
|
|
4
|
-
import { restoreCodes } from '~/components/common/pages/backups/modals/restore/lib/config/restoreCodes'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
3
|
+
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
|
|
4
|
+
import { restoreCodes } from '~/components/common/pages/backups/modals/restore/lib/config/restoreCodes'
|
|
5
|
+
|
|
6
|
+
const getDisks = (
|
|
7
|
+
model: UI_I_RestoreForm,
|
|
8
|
+
localization: UI_I_Localization
|
|
9
|
+
): UI_I_TableInfoItem[] => {
|
|
10
|
+
const result: UI_I_TableInfoItem[] = []
|
|
11
|
+
|
|
12
|
+
model.pvm.disk_devices.forEach((disk_device, i) => {
|
|
13
|
+
if (!disk_device.source) return
|
|
14
|
+
|
|
15
|
+
result.push({
|
|
16
|
+
label: `${localization.common.disk} ${i}`,
|
|
17
|
+
value: disk_device.source,
|
|
18
|
+
iconClassName: 'icon-vSphere-dsVmDisk',
|
|
19
|
+
})
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
return result
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const readyToCompleteOptions = (
|
|
26
|
+
model: UI_I_RestoreForm,
|
|
27
|
+
localization: UI_I_Localization,
|
|
28
|
+
selectedStorageName: string
|
|
29
|
+
): UI_I_TableInfoItem[] => {
|
|
30
|
+
const result: UI_I_TableInfoItem[] = []
|
|
31
|
+
|
|
32
|
+
switch (model.restore_code) {
|
|
33
|
+
case restoreCodes.diskOnly:
|
|
34
|
+
result.push({
|
|
35
|
+
label: localization.common.backup,
|
|
36
|
+
value: model.backup,
|
|
37
|
+
iconClassName: 'icon-backup',
|
|
38
|
+
})
|
|
39
|
+
// Disks
|
|
40
|
+
result.push(...getDisks(model, localization))
|
|
41
|
+
break
|
|
42
|
+
case restoreCodes.existing:
|
|
43
|
+
result.push({
|
|
44
|
+
label: localization.common.backup,
|
|
45
|
+
value: model.backup,
|
|
46
|
+
iconClassName: 'icon-backup',
|
|
47
|
+
})
|
|
48
|
+
break
|
|
49
|
+
case restoreCodes.asNew:
|
|
50
|
+
result.push({
|
|
51
|
+
label: localization.common.vmName,
|
|
52
|
+
value: model.pvm.name,
|
|
53
|
+
iconClassName: 'vsphere-icon-vm',
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
// Datastores
|
|
57
|
+
result.push({
|
|
58
|
+
label: localization.common.datastore,
|
|
59
|
+
value: selectedStorageName,
|
|
60
|
+
iconClassName: 'vsphere-icon-datastore',
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
// Disks
|
|
64
|
+
result.push(...getDisks(model, localization))
|
|
65
|
+
|
|
66
|
+
// Networks
|
|
67
|
+
model.pvm.network_devices.forEach((network) => {
|
|
68
|
+
result.push({
|
|
69
|
+
label: localization.common.network,
|
|
70
|
+
value: network.network,
|
|
71
|
+
iconClassName: 'vsphere-icon-network',
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
break
|
|
75
|
+
// case 1:
|
|
76
|
+
// result.push({
|
|
77
|
+
// label: localization.value.common.vmName,
|
|
78
|
+
// value: model.value.pvm.name,
|
|
79
|
+
// })
|
|
80
|
+
// break
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return result
|
|
84
|
+
}
|
|
@@ -1,108 +1,113 @@
|
|
|
1
|
-
import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
2
|
-
import { UI_E_WIZARD_STATUS } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/enums'
|
|
3
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
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.backup.selectType,
|
|
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: 'Specify a unique name for the virtual machine.',
|
|
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: 'Select a storage for the configuration and disk files.',
|
|
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: 'Select adapter types and networks in Procurator.',
|
|
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.backup.restoreBackupReviewSubtitle,
|
|
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
|
-
[
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
dynamicSteps.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
dynamicSteps.
|
|
107
|
-
|
|
108
|
-
|
|
1
|
+
import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
2
|
+
import { UI_E_WIZARD_STATUS } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/enums'
|
|
3
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
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.backup.selectType,
|
|
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: 'Specify a unique name for the virtual machine.',
|
|
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: 'Select a storage for the configuration and disk files.',
|
|
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: 'Select adapter types and networks in Procurator.',
|
|
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.backup.restoreBackupReviewSubtitle,
|
|
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
|
+
[
|
|
99
|
+
dynamicSteps.selectType,
|
|
100
|
+
dynamicSteps.selectDisks,
|
|
101
|
+
dynamicSteps.readyComplete,
|
|
102
|
+
], // disk only
|
|
103
|
+
// [dynamicSteps.selectType, dynamicSteps.readyComplete], // disk only
|
|
104
|
+
[dynamicSteps.selectType, dynamicSteps.readyComplete], // existing
|
|
105
|
+
[
|
|
106
|
+
dynamicSteps.selectType,
|
|
107
|
+
dynamicSteps.selectName,
|
|
108
|
+
dynamicSteps.selectStorage,
|
|
109
|
+
dynamicSteps.selectDisks,
|
|
110
|
+
dynamicSteps.selectNetwork,
|
|
111
|
+
dynamicSteps.readyComplete,
|
|
112
|
+
], // as new
|
|
113
|
+
]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { UI_I_Browse } from '~/lib/models/composables/useBrowse/interfaces'
|
|
2
|
+
|
|
3
|
+
export const useBrowse = (): UI_I_Browse => {
|
|
4
|
+
const browseInfo: UI_I_Browse = {
|
|
5
|
+
version: '',
|
|
6
|
+
type: '',
|
|
7
|
+
}
|
|
8
|
+
const userAgent = navigator.userAgent
|
|
9
|
+
if (userAgent.match(/edg/i)) {
|
|
10
|
+
browseInfo.version = userAgent.match(/Edg\/(\d+)/)?.[1] || ''
|
|
11
|
+
browseInfo.type = 'edg'
|
|
12
|
+
} else if (userAgent.match(/firefox|fxios/i)) {
|
|
13
|
+
browseInfo.version = userAgent.match(/Firefox\/(\d+)/)?.[1] || ''
|
|
14
|
+
browseInfo.type = 'firefox'
|
|
15
|
+
} else if (userAgent.match(/chrome|chromium|crios/i)) {
|
|
16
|
+
browseInfo.version = userAgent.match(/Chrome\/(\d+)/)?.[1] || ''
|
|
17
|
+
browseInfo.type = 'chrome'
|
|
18
|
+
} else if (userAgent.match(/safari/i)) {
|
|
19
|
+
browseInfo.version = userAgent.match(/Safari\/(\d+)/)?.[1] || ''
|
|
20
|
+
browseInfo.type = 'safari'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return browseInfo
|
|
24
|
+
}
|