bfg-common 1.5.514 → 1.5.516
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 -3
- package/assets/localization/local_en.json +6 -4
- package/assets/localization/local_hy.json +5 -3
- package/assets/localization/local_kk.json +5 -3
- package/assets/localization/local_ru.json +5 -3
- package/assets/localization/local_zh.json +5 -3
- package/components/atoms/sortableView/SortableView.vue +2 -2
- package/components/common/browse/blocks/lib/models/types.ts +1 -1
- package/components/common/browse/lib/models/interfaces.ts +5 -5
- package/components/common/diagramMain/modals/lib/config/portModal.ts +251 -251
- package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
- package/components/common/diagramMain/network/Contents.vue +497 -497
- package/components/common/diagramMain/port/Port.vue +580 -580
- package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +196 -379
- package/components/common/pages/backups/modals/createBackup/New.vue +267 -0
- package/components/common/pages/backups/modals/createBackup/Old.vue +142 -0
- package/components/common/pages/backups/modals/createBackup/configuration/Configuration.vue +29 -29
- package/components/common/pages/backups/modals/createBackup/configuration/ConfigurationNew.vue +218 -0
- package/components/common/pages/backups/modals/createBackup/configuration/ConfigurationOld.vue +29 -0
- package/components/common/pages/backups/modals/createBackup/configuration/backupWindow/BackupWindow.vue +29 -29
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/MaxBandwidth.vue +69 -69
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
- package/components/common/pages/backups/modals/createBackup/configuration/strategy/Strategy.vue +38 -38
- package/components/common/pages/backups/modals/createBackup/datastores/Datastores.vue +34 -59
- package/components/common/pages/backups/modals/createBackup/datastores/DatastoresNew.vue +23 -0
- package/components/common/pages/backups/modals/createBackup/datastores/DatastoresOld.vue +33 -0
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/TableView.vue +134 -0
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/lib/config/table.ts +219 -0
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/lib/models/enums.ts +15 -0
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/lib/models/interfaces.ts +5 -0
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/{TableView.vue → old/TableView.vue} +95 -95
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/{lib → old/lib}/config/keys.ts +14 -14
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/{lib → old/lib}/config/table.ts +127 -127
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/{lib → old/lib}/models/types.ts +10 -10
- package/components/common/pages/backups/modals/createBackup/disks/Disks.vue +34 -28
- package/components/common/pages/backups/modals/createBackup/disks/DisksNew.vue +22 -0
- package/components/common/pages/backups/modals/createBackup/disks/DisksOld.vue +28 -0
- package/components/common/pages/backups/modals/createBackup/disks/tableView/new/TableView.vue +131 -0
- package/components/common/pages/backups/modals/createBackup/disks/tableView/new/lib/config/table.ts +178 -0
- package/components/common/pages/backups/modals/createBackup/disks/tableView/{TableView.vue → old/TableView.vue} +119 -108
- package/components/common/pages/backups/modals/createBackup/disks/tableView/{lib → old/lib}/config/keys.ts +12 -12
- package/components/common/pages/backups/modals/createBackup/disks/tableView/{lib → old/lib}/config/table.ts +125 -125
- package/components/common/pages/backups/modals/createBackup/disks/tableView/{lib → old/lib}/models/types.ts +10 -10
- package/components/common/pages/backups/modals/createBackup/general/General.vue +33 -141
- package/components/common/pages/backups/modals/createBackup/general/GeneralNew.vue +128 -0
- package/components/common/pages/backups/modals/createBackup/general/GeneralOld.vue +66 -0
- package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +59 -0
- package/components/common/pages/backups/modals/createBackup/lib/config/steps.ts +123 -117
- package/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions.ts +13 -12
- package/components/common/pages/backups/modals/createBackup/lib/models/interfaces.ts +8 -8
- package/components/common/pages/backups/modals/createBackup/lib/validation/validations.ts +145 -0
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
-
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
|
3
|
-
|
|
4
|
-
export const strategyOptionsFunc = (
|
|
5
|
-
localization: UI_I_Localization
|
|
6
|
-
): UI_I_SelectInputItem[] => {
|
|
7
|
-
return [
|
|
8
|
-
{ label: localization.common.fullBackup, value: 0 },
|
|
9
|
-
{ label: localization.common.incrementalBackup, value: 1 },
|
|
10
|
-
{ label: localization.common.differentialBackup, value: 2 },
|
|
11
|
-
]
|
|
12
|
-
}
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
|
3
|
+
|
|
4
|
+
export const strategyOptionsFunc = (
|
|
5
|
+
localization: UI_I_Localization
|
|
6
|
+
): UI_I_SelectInputItem[] => {
|
|
7
|
+
return [
|
|
8
|
+
{ label: localization.common.fullBackup, value: 0 },
|
|
9
|
+
{ label: localization.common.incrementalBackup, value: 1 },
|
|
10
|
+
{ label: localization.common.differentialBackup, value: 2 },
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface UI_I_DynamicSteps {
|
|
2
|
-
general: number
|
|
3
|
-
disks: number
|
|
4
|
-
datastores: number
|
|
5
|
-
configuration: number
|
|
6
|
-
readyComplete: number
|
|
7
|
-
schedulingOptions: number
|
|
8
|
-
}
|
|
1
|
+
export interface UI_I_DynamicSteps {
|
|
2
|
+
general: number
|
|
3
|
+
disks: number
|
|
4
|
+
datastores: number
|
|
5
|
+
configuration: number
|
|
6
|
+
readyComplete: number
|
|
7
|
+
schedulingOptions: number
|
|
8
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { UI_I_WizardStep, UI_I_ValidationReturn } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
2
|
+
import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
|
3
|
+
import type { UI_I_CreateBackupForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
4
|
+
import { dynamicSteps } from '~/components/common/pages/backups/modals/createBackup/lib/config/steps'
|
|
5
|
+
import type {UI_I_Localization} from "~/lib/models/interfaces";
|
|
6
|
+
import type {UI_I_NameCheck} from "~/components/common/pages/backups/modals/restore/name/lib/models/interfaces";
|
|
7
|
+
|
|
8
|
+
export const checkName = async (
|
|
9
|
+
value: UI_I_WizardStep[],
|
|
10
|
+
name: string,
|
|
11
|
+
wizard: Wizard,
|
|
12
|
+
localization: UI_I_Localization,
|
|
13
|
+
emits: (event: 'check-name', payload: UI_I_NameCheck) => void
|
|
14
|
+
): Promise<UI_I_ValidationReturn> => {
|
|
15
|
+
let stepHasError = false
|
|
16
|
+
let stepErrorMessage = ''
|
|
17
|
+
|
|
18
|
+
wizard.setLoader(true)
|
|
19
|
+
|
|
20
|
+
if (!name) {
|
|
21
|
+
stepHasError = wizard.setValidation(dynamicSteps.general, 'name', {
|
|
22
|
+
fieldMessage: localization.common.fieldRequired,
|
|
23
|
+
alertMessage: localization.common.fieldRequired
|
|
24
|
+
})
|
|
25
|
+
wizard.setLoader(false)
|
|
26
|
+
return {
|
|
27
|
+
stepHasError,
|
|
28
|
+
newValue: value
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Проверка имени на сервере
|
|
33
|
+
return new Promise((resolve) => {
|
|
34
|
+
emits('check-name', {
|
|
35
|
+
name,
|
|
36
|
+
cb: (error): void => {
|
|
37
|
+
const status = error?.data?.statusCode || 200
|
|
38
|
+
|
|
39
|
+
switch (status) {
|
|
40
|
+
case 400:
|
|
41
|
+
stepErrorMessage = localization.common.emptyNameValidationDescription
|
|
42
|
+
break
|
|
43
|
+
case 405:
|
|
44
|
+
stepErrorMessage = localization.common.kindValidationDescription
|
|
45
|
+
break
|
|
46
|
+
case 406:
|
|
47
|
+
stepErrorMessage = localization.common.vmNameValidationDescription
|
|
48
|
+
break
|
|
49
|
+
case 409:
|
|
50
|
+
stepErrorMessage = localization.common.vmNameExistInSelectedLocation
|
|
51
|
+
break
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (stepErrorMessage) {
|
|
55
|
+
stepHasError = wizard.setValidation(dynamicSteps.general, 'name', {
|
|
56
|
+
fieldMessage: stepErrorMessage,
|
|
57
|
+
alertMessage: stepErrorMessage
|
|
58
|
+
})
|
|
59
|
+
} else if (wizard.hasMessage(dynamicSteps.general, 'name')) {
|
|
60
|
+
value = wizard.removeValidation(dynamicSteps.general, 'name', value)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
wizard.setLoader(false)
|
|
64
|
+
|
|
65
|
+
resolve({
|
|
66
|
+
stepHasError,
|
|
67
|
+
newValue: value
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const checkDisks = (
|
|
75
|
+
value: UI_I_WizardStep[],
|
|
76
|
+
backupForm: UI_I_CreateBackupForm,
|
|
77
|
+
wizard: Wizard,
|
|
78
|
+
localization: UI_I_Localization,
|
|
79
|
+
showValidationErrors: (data: string[]) => void,
|
|
80
|
+
onRemoveValidationErrors: () => void
|
|
81
|
+
): UI_I_ValidationReturn => {
|
|
82
|
+
let stepHasError = false
|
|
83
|
+
const isValidStores = !!backupForm?.disk_devices.length
|
|
84
|
+
|
|
85
|
+
if (!isValidStores) {
|
|
86
|
+
stepHasError = wizard.setValidation(dynamicSteps.disks, 'disk_devices', {
|
|
87
|
+
fieldMessage: localization.common.diskIsRequired,
|
|
88
|
+
alertMessage: localization.common.diskIsRequired
|
|
89
|
+
})
|
|
90
|
+
showValidationErrors([localization.common.diskIsRequired])
|
|
91
|
+
} else if (wizard.hasMessage(dynamicSteps.disks, 'disk_devices')) {
|
|
92
|
+
value = wizard.removeValidation(dynamicSteps.disks, 'disk_devices', value)
|
|
93
|
+
onRemoveValidationErrors()
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
stepHasError,
|
|
98
|
+
newValue: value
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const checkDatastore = (
|
|
103
|
+
value: UI_I_WizardStep[],
|
|
104
|
+
backupForm: UI_I_CreateBackupForm,
|
|
105
|
+
wizard: Wizard,
|
|
106
|
+
localization: UI_I_Localization,
|
|
107
|
+
showValidationErrors: (data: string[]) => void,
|
|
108
|
+
onRemoveValidationErrors: () => void
|
|
109
|
+
): UI_I_ValidationReturn => {
|
|
110
|
+
let stepHasError = false
|
|
111
|
+
const isValidStorage = !!backupForm?.backup_storage.length
|
|
112
|
+
|
|
113
|
+
if (!isValidStorage) {
|
|
114
|
+
stepHasError = wizard.setValidation(dynamicSteps.datastores, 'backup_storage', {
|
|
115
|
+
fieldMessage: localization.common.datastoreIsRequired,
|
|
116
|
+
alertMessage: localization.common.datastoreIsRequired
|
|
117
|
+
})
|
|
118
|
+
showValidationErrors([localization.common.datastoreIsRequired])
|
|
119
|
+
} else if (wizard.hasMessage(dynamicSteps.datastores, 'backup_storage')) {
|
|
120
|
+
value = wizard.removeValidation(dynamicSteps.datastores, 'backup_storage', value)
|
|
121
|
+
onRemoveValidationErrors()
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return { stepHasError, newValue: value }
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const checkConfiguration = (
|
|
128
|
+
value: UI_I_WizardStep[],
|
|
129
|
+
maxBandWidth: number | string,
|
|
130
|
+
wizard: Wizard,
|
|
131
|
+
localization: UI_I_Localization,
|
|
132
|
+
): UI_I_ValidationReturn => {
|
|
133
|
+
let stepHasError = false
|
|
134
|
+
const isValidBandWidth = maxBandWidth === ''
|
|
135
|
+
|
|
136
|
+
if (isValidBandWidth) {
|
|
137
|
+
stepHasError = wizard.setValidation(dynamicSteps.configuration, 'bandWidth', {
|
|
138
|
+
fieldMessage: localization.common.fieldRequired,
|
|
139
|
+
alertMessage: localization.common.fieldRequired
|
|
140
|
+
})
|
|
141
|
+
} else if (wizard.hasMessage(dynamicSteps.configuration, 'bandWidth')) {
|
|
142
|
+
value = wizard.removeValidation(dynamicSteps.configuration, 'bandWidth', value)
|
|
143
|
+
}
|
|
144
|
+
return { stepHasError, newValue: value }
|
|
145
|
+
}
|