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.
- package/components/common/backup/storage/actions/delete/Delete.vue +1 -1
- package/components/common/modals/confirmation/ConfirmationNew.vue +1 -1
- package/components/common/pages/backups/lib/models/interfaces.ts +13 -1
- package/components/common/pages/backups/lib/models/types.ts +3 -3
- package/components/common/{backup → pages/backups}/lib/utils/getBackupOrBackupStorageId.ts +0 -4
- package/components/common/pages/backups/modals/Modals.vue +16 -37
- package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +15 -33
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/MaxBandwidth.vue +3 -2
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +2 -2
- package/components/common/pages/backups/modals/createBackup/configuration/strategy/Strategy.vue +2 -3
- package/components/common/pages/backups/modals/createBackup/datastores/Datastores.vue +5 -4
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/TableView.vue +95 -94
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/lib/config/table.ts +119 -117
- package/components/common/pages/backups/modals/createBackup/disks/tableView/lib/config/table.ts +117 -117
- package/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions.ts +2 -2
- package/components/common/pages/backups/modals/deleteBackup/DeleteBackup.vue +12 -5
- package/components/common/pages/backups/modals/lib/models/interfaces.ts +185 -164
- package/components/common/pages/backups/modals/restore/Restore.vue +74 -45
- package/components/common/pages/backups/modals/restore/disks/Disks.vue +4 -5
- package/components/common/pages/backups/modals/restore/disks/tableView/TableView.vue +9 -8
- package/components/common/pages/backups/modals/restore/disks/tableView/lib/config/table.ts +117 -114
- package/components/common/pages/backups/modals/restore/lib/config/restoreCodes.ts +5 -0
- package/components/common/pages/backups/modals/restore/lib/config/steps.ts +108 -92
- package/components/common/pages/backups/modals/restore/name/Name.vue +160 -159
- package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -0
- package/components/common/pages/backups/modals/restore/networks/Networks.vue +67 -67
- package/components/common/pages/backups/modals/restore/networks/table/Table.vue +3 -5
- package/components/common/pages/backups/modals/restore/networks/table/lib/config/networkTable.ts +1 -8
- package/components/common/pages/backups/modals/restore/types/Types.vue +10 -11
- package/components/common/pages/backups/modals/restore/types/lib/config/typeOptions.ts +25 -24
- package/components/common/pages/backups/tools/lib/config/tabs.ts +7 -7
- package/package.json +1 -1
- package/components/common/pages/backups/modals/createBackup/lib/config/createBackup.ts +0 -14
- package/components/common/pages/backups/modals/restore/disks/tableView/lib/models/interfaces.ts +0 -4
@@ -1,159 +1,160 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="select-name">
|
3
|
-
<atoms-alert
|
4
|
-
v-show="errors.length"
|
5
|
-
:items="errors"
|
6
|
-
status="alert-danger"
|
7
|
-
test-id="name-alert"
|
8
|
-
@remove="onRemoveValidationErrors"
|
9
|
-
/>
|
10
|
-
|
11
|
-
<form
|
12
|
-
id="virtual-machine-form"
|
13
|
-
class="flex items-center pt-5"
|
14
|
-
@submit.prevent
|
15
|
-
>
|
16
|
-
<label for="virtual-machine-name"
|
17
|
-
>{{ localization.common.virtualMachineName }}:</label
|
18
|
-
>
|
19
|
-
<input
|
20
|
-
id="virtual-machine-name"
|
21
|
-
v-model.trim="model.pvm.name"
|
22
|
-
data-id="virtual-machine-name-input"
|
23
|
-
type="text"
|
24
|
-
maxlength="54"
|
25
|
-
/>
|
26
|
-
</form>
|
27
|
-
</div>
|
28
|
-
</template>
|
29
|
-
|
30
|
-
<script setup lang="ts">
|
31
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
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
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
}
|
101
|
-
|
102
|
-
|
103
|
-
const
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
(
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
}
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
}
|
159
|
-
|
1
|
+
<template>
|
2
|
+
<div class="select-name">
|
3
|
+
<atoms-alert
|
4
|
+
v-show="errors.length"
|
5
|
+
:items="errors"
|
6
|
+
status="alert-danger"
|
7
|
+
test-id="name-alert"
|
8
|
+
@remove="onRemoveValidationErrors"
|
9
|
+
/>
|
10
|
+
|
11
|
+
<form
|
12
|
+
id="virtual-machine-form"
|
13
|
+
class="flex items-center pt-5"
|
14
|
+
@submit.prevent
|
15
|
+
>
|
16
|
+
<label for="virtual-machine-name"
|
17
|
+
>{{ localization.common.virtualMachineName }}:</label
|
18
|
+
>
|
19
|
+
<input
|
20
|
+
id="virtual-machine-name"
|
21
|
+
v-model.trim="model.pvm.name"
|
22
|
+
data-id="virtual-machine-name-input"
|
23
|
+
type="text"
|
24
|
+
maxlength="54"
|
25
|
+
/>
|
26
|
+
</form>
|
27
|
+
</div>
|
28
|
+
</template>
|
29
|
+
|
30
|
+
<script setup lang="ts">
|
31
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
32
|
+
import type { UI_I_NameCheck } from '~/components/common/pages/backups/modals/restore/name/lib/models/interfaces'
|
33
|
+
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
34
|
+
|
35
|
+
const model = defineModel<UI_I_RestoreForm>({ required: true })
|
36
|
+
|
37
|
+
const props = defineProps<{
|
38
|
+
show: boolean
|
39
|
+
nameFormSubmit: null | Function
|
40
|
+
}>()
|
41
|
+
const emits = defineEmits<{
|
42
|
+
(event: 'check-name', value: UI_I_NameCheck): void
|
43
|
+
}>()
|
44
|
+
|
45
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
46
|
+
|
47
|
+
watch(
|
48
|
+
() => props.nameFormSubmit,
|
49
|
+
(newValue) => {
|
50
|
+
newValue && submit(newValue)
|
51
|
+
}
|
52
|
+
)
|
53
|
+
|
54
|
+
const submit = async (cb: Function): Promise<void> => {
|
55
|
+
const name = model.value.pvm.name
|
56
|
+
|
57
|
+
if (name !== '') {
|
58
|
+
const isNameValid = await checkNameIsValid(name)
|
59
|
+
if (!isNameValid) {
|
60
|
+
// @ts-ignore
|
61
|
+
cb(false)
|
62
|
+
return
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
onRemoveValidationErrors()
|
67
|
+
// @ts-ignore
|
68
|
+
cb(true)
|
69
|
+
}
|
70
|
+
const checkNameIsValid = async (name: string): Promise<boolean> => {
|
71
|
+
return new Promise((resolve) => {
|
72
|
+
emits('check-name', {
|
73
|
+
name,
|
74
|
+
cb: (error): void => {
|
75
|
+
const status = error?.statusCode || 200
|
76
|
+
switch (status) {
|
77
|
+
case 405: // Invalid kind
|
78
|
+
showValidationErrors([
|
79
|
+
localization.value.common.kindValidationDescription,
|
80
|
+
])
|
81
|
+
resolve(false)
|
82
|
+
break
|
83
|
+
case 406: // Invalid name
|
84
|
+
showValidationErrors([
|
85
|
+
localization.value.common.vmNameValidationDescription,
|
86
|
+
])
|
87
|
+
resolve(false)
|
88
|
+
break
|
89
|
+
case 409: // Name exist
|
90
|
+
showValidationErrors([
|
91
|
+
localization.value.common.vmNameExistInSelectedLocation,
|
92
|
+
])
|
93
|
+
resolve(false)
|
94
|
+
break
|
95
|
+
}
|
96
|
+
|
97
|
+
resolve(true)
|
98
|
+
},
|
99
|
+
})
|
100
|
+
})
|
101
|
+
}
|
102
|
+
|
103
|
+
const errors = ref<string[]>([])
|
104
|
+
const showValidationErrors = (data: string[]): void => {
|
105
|
+
errors.value = data
|
106
|
+
}
|
107
|
+
const onRemoveValidationErrors = (): void => {
|
108
|
+
errors.value = []
|
109
|
+
}
|
110
|
+
|
111
|
+
watch(
|
112
|
+
() => props.show,
|
113
|
+
(newValue) => {
|
114
|
+
if (!newValue) return
|
115
|
+
|
116
|
+
const input = document.getElementById('virtual-machine-name')
|
117
|
+
if (!input) return
|
118
|
+
|
119
|
+
setTimeout(() => {
|
120
|
+
input.focus()
|
121
|
+
}, 0)
|
122
|
+
}
|
123
|
+
)
|
124
|
+
</script>
|
125
|
+
|
126
|
+
<style scoped lang="scss">
|
127
|
+
.select-name {
|
128
|
+
form {
|
129
|
+
label {
|
130
|
+
width: 216px;
|
131
|
+
}
|
132
|
+
input {
|
133
|
+
width: 345px;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
.tree-view-wrap {
|
138
|
+
position: relative;
|
139
|
+
border: 1px solid #000;
|
140
|
+
padding: 5px;
|
141
|
+
max-height: 300px;
|
142
|
+
min-height: 200px;
|
143
|
+
overflow: auto;
|
144
|
+
margin-bottom: 10px;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
.content-signpost {
|
148
|
+
.icon-show-help {
|
149
|
+
cursor: pointer;
|
150
|
+
}
|
151
|
+
|
152
|
+
.help-title {
|
153
|
+
font-size: 22px;
|
154
|
+
margin-bottom: 24px;
|
155
|
+
}
|
156
|
+
.signpost {
|
157
|
+
max-width: 360px;
|
158
|
+
}
|
159
|
+
}
|
160
|
+
</style>
|
@@ -1,67 +1,67 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="select-network h-full flex flex-col">
|
3
|
-
<atoms-alert
|
4
|
-
v-if="props.alertMessages.length"
|
5
|
-
:items="props.alertMessages"
|
6
|
-
status="alert-danger"
|
7
|
-
test-id="import-vms-select-networks-errors"
|
8
|
-
@remove="onHideAlert"
|
9
|
-
/>
|
10
|
-
|
11
|
-
<common-pages-backups-modals-restore-networks-table
|
12
|
-
v-model="model"
|
13
|
-
:networks-table="model.pvm.network_devices"
|
14
|
-
:source-networks="props.networks"
|
15
|
-
:loading="networkTableLoading"
|
16
|
-
@hide-alert="onHideAlert"
|
17
|
-
/>
|
18
|
-
|
19
|
-
<common-wizards-vm-common-validation-compatibility
|
20
|
-
:loading="!model.pvm.network_devices.length"
|
21
|
-
status="Success"
|
22
|
-
text="compatibilityChecksSucceeded"
|
23
|
-
/>
|
24
|
-
</div>
|
25
|
-
</template>
|
26
|
-
|
27
|
-
<script lang="ts" setup>
|
28
|
-
import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
|
29
|
-
|
30
|
-
|
31
|
-
const model = defineModel<
|
32
|
-
const props = defineProps<{
|
33
|
-
alertMessages: string[]
|
34
|
-
networks: UI_I_NetworkTableItem[]
|
35
|
-
}>()
|
36
|
-
const emits = defineEmits<{
|
37
|
-
(event: 'get-networks', value: string): void
|
38
|
-
(event: 'hide-alert'
|
39
|
-
}>()
|
40
|
-
|
41
|
-
const networkTableLoading = ref<boolean>(false)
|
42
|
-
const getNetworks = async (): Promise<void> => {
|
43
|
-
networkTableLoading.value = true
|
44
|
-
emits('get-networks', model.value.pvm.host_id)
|
45
|
-
networkTableLoading.value = false
|
46
|
-
}
|
47
|
-
getNetworks()
|
48
|
-
|
49
|
-
const onHideAlert = (): void => {
|
50
|
-
emits('hide-alert'
|
51
|
-
}
|
52
|
-
</script>
|
53
|
-
|
54
|
-
<style lang="scss" scoped>
|
55
|
-
.select-network {
|
56
|
-
margin-top: 10px;
|
57
|
-
&__text {
|
58
|
-
font-size: 12px;
|
59
|
-
}
|
60
|
-
&__matcher-details {
|
61
|
-
margin-top: 10px;
|
62
|
-
}
|
63
|
-
.vm-migrate-advanced-view-button {
|
64
|
-
text-align: end;
|
65
|
-
}
|
66
|
-
}
|
67
|
-
</style>
|
1
|
+
<template>
|
2
|
+
<div class="select-network h-full flex flex-col">
|
3
|
+
<atoms-alert
|
4
|
+
v-if="props.alertMessages.length"
|
5
|
+
:items="props.alertMessages"
|
6
|
+
status="alert-danger"
|
7
|
+
test-id="import-vms-select-networks-errors"
|
8
|
+
@remove="onHideAlert"
|
9
|
+
/>
|
10
|
+
|
11
|
+
<common-pages-backups-modals-restore-networks-table
|
12
|
+
v-model="model"
|
13
|
+
:networks-table="model.pvm.network_devices"
|
14
|
+
:source-networks="props.networks"
|
15
|
+
:loading="networkTableLoading"
|
16
|
+
@hide-alert="onHideAlert"
|
17
|
+
/>
|
18
|
+
|
19
|
+
<common-wizards-vm-common-validation-compatibility
|
20
|
+
:loading="!model.pvm.network_devices.length"
|
21
|
+
status="Success"
|
22
|
+
text="compatibilityChecksSucceeded"
|
23
|
+
/>
|
24
|
+
</div>
|
25
|
+
</template>
|
26
|
+
|
27
|
+
<script lang="ts" setup>
|
28
|
+
import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
|
29
|
+
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
30
|
+
|
31
|
+
const model = defineModel<UI_I_RestoreForm>({ required: true })
|
32
|
+
const props = defineProps<{
|
33
|
+
alertMessages: string[]
|
34
|
+
networks: UI_I_NetworkTableItem[]
|
35
|
+
}>()
|
36
|
+
const emits = defineEmits<{
|
37
|
+
(event: 'get-networks', value: string): void
|
38
|
+
(event: 'hide-alert'): void
|
39
|
+
}>()
|
40
|
+
|
41
|
+
const networkTableLoading = ref<boolean>(false)
|
42
|
+
const getNetworks = async (): Promise<void> => {
|
43
|
+
networkTableLoading.value = true
|
44
|
+
emits('get-networks', model.value.pvm.host_id || '')
|
45
|
+
networkTableLoading.value = false
|
46
|
+
}
|
47
|
+
getNetworks()
|
48
|
+
|
49
|
+
const onHideAlert = (): void => {
|
50
|
+
emits('hide-alert')
|
51
|
+
}
|
52
|
+
</script>
|
53
|
+
|
54
|
+
<style lang="scss" scoped>
|
55
|
+
.select-network {
|
56
|
+
margin-top: 10px;
|
57
|
+
&__text {
|
58
|
+
font-size: 12px;
|
59
|
+
}
|
60
|
+
&__matcher-details {
|
61
|
+
margin-top: 10px;
|
62
|
+
}
|
63
|
+
.vm-migrate-advanced-view-button {
|
64
|
+
text-align: end;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
</style>
|
@@ -65,14 +65,12 @@ import type {
|
|
65
65
|
UI_I_HeadItem,
|
66
66
|
UI_I_BodyItem,
|
67
67
|
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
68
|
-
import type {
|
69
|
-
// import type { I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
70
|
-
// import type { I_Pvm } from '~/store/modules/inventory/modules/backup/lib/models/interfaces'
|
68
|
+
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
71
69
|
import * as table from '~/components/common/pages/backups/modals/restore/networks/table/lib/config/networkTable'
|
72
70
|
|
73
|
-
const model = defineModel<
|
71
|
+
const model = defineModel<UI_I_RestoreForm>({ required: true })
|
74
72
|
const props = defineProps<{
|
75
|
-
networksTable:
|
73
|
+
networksTable: UI_I_RestoreForm['pvm']['network_devices']
|
76
74
|
sourceNetworks: UI_I_NetworkTableItem[]
|
77
75
|
loading: boolean
|
78
76
|
}>()
|
package/components/common/pages/backups/modals/restore/networks/table/lib/config/networkTable.ts
CHANGED
@@ -4,14 +4,7 @@ import type {
|
|
4
4
|
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
5
5
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
6
6
|
import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
|
7
|
-
|
8
|
-
// TODO fix
|
9
|
-
export const networkTableItemKeys = [
|
10
|
-
'import_source_id',
|
11
|
-
'mac',
|
12
|
-
'target',
|
13
|
-
'network',
|
14
|
-
]
|
7
|
+
import { networkTableItemKeys } from '~/components/common/pages/backups/modals/restore/networks/table/lib/config/tableKeys'
|
15
8
|
|
16
9
|
const getItems = (
|
17
10
|
localization: UI_I_Localization
|
@@ -14,11 +14,11 @@
|
|
14
14
|
<script lang="ts" setup>
|
15
15
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
16
16
|
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
17
|
-
|
17
|
+
import type {UI_I_RestoreForm} from "~/components/common/pages/backups/modals/lib/models/interfaces";
|
18
18
|
import { backupsTypesFunc } from '~/components/common/pages/backups/modals/restore/types/lib/config/typeOptions'
|
19
19
|
import { descriptionsFunc } from '~/components/common/pages/backups/modals/restore/types/lib/config/descriptions'
|
20
20
|
|
21
|
-
const model = defineModel<
|
21
|
+
const model = defineModel<UI_I_RestoreForm>({ required: true })
|
22
22
|
|
23
23
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
24
24
|
|
@@ -29,6 +29,14 @@ const description = computed<string[]>(
|
|
29
29
|
)
|
30
30
|
</script>
|
31
31
|
|
32
|
+
<style>
|
33
|
+
:root {
|
34
|
+
--type-list-border-color: #ccc;
|
35
|
+
}
|
36
|
+
:root.dark-theme {
|
37
|
+
--type-list-border-color: #000;
|
38
|
+
}
|
39
|
+
</style>
|
32
40
|
<style scoped lang="scss">
|
33
41
|
.select-restore-type {
|
34
42
|
padding-top: 12px;
|
@@ -50,12 +58,3 @@ const description = computed<string[]>(
|
|
50
58
|
}
|
51
59
|
}
|
52
60
|
</style>
|
53
|
-
|
54
|
-
<style>
|
55
|
-
:root {
|
56
|
-
--type-list-border-color: #ccc;
|
57
|
-
}
|
58
|
-
:root.dark-theme {
|
59
|
-
--type-list-border-color: #000;
|
60
|
-
}
|
61
|
-
</style>
|
@@ -1,24 +1,25 @@
|
|
1
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
2
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
2
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
3
|
+
import { restoreCodes } from '~/components/common/pages/backups/modals/restore/lib/config/restoreCodes'
|
4
|
+
|
5
|
+
export const backupsTypesFunc = (
|
6
|
+
localization: UI_I_Localization
|
7
|
+
): UI_I_OptionItem[] => {
|
8
|
+
return [
|
9
|
+
{
|
10
|
+
text: localization.common.restoreExisting,
|
11
|
+
value: restoreCodes.existing,
|
12
|
+
testId: 'backup-type-restore-existing',
|
13
|
+
},
|
14
|
+
{
|
15
|
+
text: localization.common.restoreAsNew,
|
16
|
+
value: restoreCodes.asNew,
|
17
|
+
testId: 'backup-type-restore-as-new',
|
18
|
+
},
|
19
|
+
{
|
20
|
+
text: localization.common.restoreDiskOnly,
|
21
|
+
value: restoreCodes.diskOnly,
|
22
|
+
testId: 'backup-type-restore-disk-only',
|
23
|
+
},
|
24
|
+
]
|
25
|
+
}
|
@@ -6,31 +6,31 @@ import type { UI_T_Project } from '~/lib/models/types'
|
|
6
6
|
export const backupsTabsFunc = (
|
7
7
|
localization: UI_I_Localization,
|
8
8
|
isDisabled: boolean,
|
9
|
-
|
9
|
+
backupsCount: number,
|
10
10
|
selectedNode: UI_I_BackupsTreeNode | null,
|
11
11
|
project: UI_T_Project
|
12
12
|
): UI_I_CollapseNavItem[] => {
|
13
13
|
return [
|
14
14
|
{
|
15
15
|
text: localization.common.restore.toUpperCase(),
|
16
|
-
value: '
|
16
|
+
value: 'restoreBackup',
|
17
17
|
disabled: isDisabled || selectedNode?.type !== 'backup',
|
18
18
|
testId: 'restore-backup',
|
19
|
-
permission: project ? 'VirtualMachines.RestoreBackup' : '',
|
19
|
+
permission: project === 'sphere' ? 'VirtualMachines.RestoreBackup' : '',
|
20
20
|
},
|
21
21
|
{
|
22
22
|
text: localization.common.delete.toUpperCase(),
|
23
23
|
value: 'deleteBackup',
|
24
24
|
disabled: isDisabled || selectedNode?.type !== 'backup',
|
25
25
|
testId: 'delete-backup',
|
26
|
-
permission: project ? 'VirtualMachines.DeleteBackup' : '',
|
26
|
+
permission: project === 'sphere' ? 'VirtualMachines.DeleteBackup' : '',
|
27
27
|
},
|
28
28
|
{
|
29
29
|
text: localization.common.deleteAll.toUpperCase(),
|
30
|
-
value: '
|
31
|
-
disabled: isDisabled || !
|
30
|
+
value: 'deleteBackupAll',
|
31
|
+
disabled: isDisabled || !backupsCount,
|
32
32
|
testId: 'delete-all-backups',
|
33
|
-
permission: project ? 'VirtualMachines.DeleteBackups' : '',
|
33
|
+
permission: project === 'sphere' ? 'VirtualMachines.DeleteBackups' : '',
|
34
34
|
},
|
35
35
|
]
|
36
36
|
}
|
package/package.json
CHANGED
@@ -1,14 +0,0 @@
|
|
1
|
-
import type { UI_I_CreateBackupForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
2
|
-
|
3
|
-
export const backupDefaultFormFunc = (): UI_I_CreateBackupForm => {
|
4
|
-
return {
|
5
|
-
target: '',
|
6
|
-
name: '',
|
7
|
-
description: '',
|
8
|
-
disk_devices: [],
|
9
|
-
backup_storage: '',
|
10
|
-
strategy: 0,
|
11
|
-
// start_window_min: 60,
|
12
|
-
bandwidth_limit: 1_024 * 1_024,
|
13
|
-
}
|
14
|
-
}
|