bfg-common 1.5.537 → 1.5.539
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 +1 -1
- package/assets/localization/local_en.json +1 -1
- package/assets/localization/local_hy.json +1 -1
- package/assets/localization/local_kk.json +1 -1
- package/assets/localization/local_ru.json +1 -1
- package/assets/localization/local_zh.json +1 -1
- package/assets/scss/clarity/local_ar.json +1 -1
- package/components/common/pages/backups/modals/restore/networks/Networks.vue +1 -1
- package/components/common/vm/actions/add/Add.vue +3 -2
- package/components/common/vm/actions/add/New.vue +3 -2
- package/components/common/vm/actions/add/Old.vue +5 -3
- package/components/common/vm/actions/clone/Clone.vue +3 -2
- package/components/common/vm/actions/clone/new/New.vue +50 -47
- package/components/common/vm/actions/clone/old/Old.vue +3 -3
- package/components/common/vm/actions/common/select/storage/Old.vue +125 -132
- package/components/common/vm/actions/common/select/storage/Storage.vue +178 -167
- package/components/common/vm/actions/common/select/storage/new/New.vue +311 -330
- package/components/common/vm/actions/register/Register.vue +5 -5
- package/components/common/wizards/common/{steps/computeResource/compatibility → compatibility}/Compatibility.vue +7 -3
- package/components/common/wizards/common/{steps/computeResource/compatibility → compatibility}/New.vue +2 -1
- package/components/common/wizards/common/{steps/computeResource/compatibility → compatibility}/Old.vue +4 -5
- package/components/common/wizards/common/{steps/computeResource/compatibility → compatibility}/lib/models/enums.ts +1 -1
- package/components/common/wizards/common/compatibility/lib/models/types.ts +1 -0
- package/components/common/wizards/common/steps/computeResource/ComputeResource.vue +2 -1
- package/components/common/wizards/common/steps/computeResource/New.vue +3 -2
- package/components/common/wizards/common/steps/computeResource/Old.vue +3 -2
- package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +205 -195
- package/components/common/wizards/vm/migrate/select/network/Network.vue +1 -1
- package/components/common/wizards/vm/migrate/select/storage/Storage.vue +1 -1
- package/package.json +1 -1
|
@@ -1,167 +1,178 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<common-vm-actions-common-select-storage-new
|
|
3
|
-
v-if="isNewView"
|
|
4
|
-
v-model:selected-row="selectedRow"
|
|
5
|
-
v-model:pagination="pagination"
|
|
6
|
-
:datastore="props.datastore"
|
|
7
|
-
:is-datastore-loading="props.isDatastoreLoading"
|
|
8
|
-
:errors="errors"
|
|
9
|
-
:selected-storage="selectedStorage"
|
|
10
|
-
:hide-compatibility="props.hideCompatibility"
|
|
11
|
-
:hide-alert="props.hideAlert"
|
|
12
|
-
:is-in-wizard="props.isInWizard"
|
|
13
|
-
:table-options="props.tableOptions"
|
|
14
|
-
|
|
15
|
-
@
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
v-
|
|
20
|
-
v-model:
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
(event: '
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<common-vm-actions-common-select-storage-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
v-model:selected-row="selectedRow"
|
|
5
|
+
v-model:pagination="pagination"
|
|
6
|
+
:datastore="props.datastore"
|
|
7
|
+
:is-datastore-loading="props.isDatastoreLoading"
|
|
8
|
+
:errors="errors"
|
|
9
|
+
:selected-storage="selectedStorage"
|
|
10
|
+
:hide-compatibility="props.hideCompatibility"
|
|
11
|
+
:hide-alert="props.hideAlert"
|
|
12
|
+
:is-in-wizard="props.isInWizard"
|
|
13
|
+
:table-options="props.tableOptions"
|
|
14
|
+
:compatibility="compatibility"
|
|
15
|
+
@remove-error="onRemoveValidationErrors"
|
|
16
|
+
@change-storage="changeStorage"
|
|
17
|
+
/>
|
|
18
|
+
<common-vm-actions-common-select-storage-old
|
|
19
|
+
v-else
|
|
20
|
+
v-model:selected-row="selectedRow"
|
|
21
|
+
v-model:pagination="pagination"
|
|
22
|
+
:datastore="props.datastore"
|
|
23
|
+
:is-datastore-loading="props.isDatastoreLoading"
|
|
24
|
+
:errors="errors"
|
|
25
|
+
:selected-storage="selectedStorage"
|
|
26
|
+
:hide-compatibility="props.hideCompatibility"
|
|
27
|
+
:compatibility="compatibility"
|
|
28
|
+
@remove-error="onRemoveValidationErrors"
|
|
29
|
+
@change-storage="changeStorage"
|
|
30
|
+
/>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup lang="ts">
|
|
34
|
+
import type { UI_I_DataTableOptions } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
|
|
35
|
+
import type {
|
|
36
|
+
UI_I_Pagination,
|
|
37
|
+
UI_I_TablePayload,
|
|
38
|
+
} from '~/lib/models/table/interfaces'
|
|
39
|
+
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
40
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
41
|
+
import type { UI_T_CompatibilityStatus } from '~/components/common/wizards/common/compatibility/lib/models/types'
|
|
42
|
+
|
|
43
|
+
const props = withDefaults(
|
|
44
|
+
defineProps<{
|
|
45
|
+
storageSubmit: null | Function
|
|
46
|
+
datastore: UI_I_DatastoreTableItem[]
|
|
47
|
+
isDatastoreLoading: boolean
|
|
48
|
+
getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
|
|
49
|
+
storage?: UI_I_DatastoreTableItem
|
|
50
|
+
hideCompatibility?: boolean
|
|
51
|
+
hideAlert?: boolean
|
|
52
|
+
isInWizard?: boolean
|
|
53
|
+
tableOptions?: UI_I_DataTableOptions
|
|
54
|
+
}>(),
|
|
55
|
+
{
|
|
56
|
+
storage: undefined,
|
|
57
|
+
hideCompatibility: undefined,
|
|
58
|
+
hideAlert: undefined,
|
|
59
|
+
isInWizard: undefined,
|
|
60
|
+
tableOptions: undefined,
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
const emits = defineEmits<{
|
|
64
|
+
(event: 'submit', value: UI_I_DatastoreTableItem): void
|
|
65
|
+
(event: 'change-storage', value: UI_I_DatastoreTableItem): void
|
|
66
|
+
(event: 'is-selected-row', value: boolean): void
|
|
67
|
+
(event: 'has-errors', value: boolean): void
|
|
68
|
+
}>()
|
|
69
|
+
|
|
70
|
+
const { $store }: any = useNuxtApp()
|
|
71
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
72
|
+
|
|
73
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
74
|
+
|
|
75
|
+
const pagination = ref<UI_I_Pagination>({
|
|
76
|
+
page: 1,
|
|
77
|
+
pageSize: 100,
|
|
78
|
+
})
|
|
79
|
+
const getStorage = async (): Promise<void> => {
|
|
80
|
+
const payload: UI_I_TablePayload = {
|
|
81
|
+
pagination: pagination.value,
|
|
82
|
+
sortBy: null,
|
|
83
|
+
type: 'datastore',
|
|
84
|
+
schema: 'full',
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
props.getDatastoreTableFunc(payload).then(() => {
|
|
88
|
+
selectedRow.value = null
|
|
89
|
+
setStorageFromProps()
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
getStorage()
|
|
93
|
+
|
|
94
|
+
const selectedStorage = ref<UI_I_DatastoreTableItem | null>(null)
|
|
95
|
+
const selectedRow = ref<number | null>(null)
|
|
96
|
+
const changeStorage = (index: number): void => {
|
|
97
|
+
if (!props.datastore) return
|
|
98
|
+
selectedStorage.value = props.datastore[index]
|
|
99
|
+
selectedRow.value = index
|
|
100
|
+
emits('change-storage', selectedStorage.value)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const setStorageFromProps = (): void => {
|
|
104
|
+
if (!props.storage) return
|
|
105
|
+
props.datastore.forEach((item, index) => {
|
|
106
|
+
if (item.id === props.storage.id) changeStorage(index)
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
watch(
|
|
110
|
+
() => props.storage,
|
|
111
|
+
() => {
|
|
112
|
+
setStorageFromProps()
|
|
113
|
+
},
|
|
114
|
+
{ immediate: true }
|
|
115
|
+
)
|
|
116
|
+
watch(
|
|
117
|
+
() => props.datastore,
|
|
118
|
+
(newValue) => {
|
|
119
|
+
const hasSelectedRow: boolean = !!newValue.filter?.(
|
|
120
|
+
(item) => item.id === selectedStorage.value?.id
|
|
121
|
+
).length
|
|
122
|
+
if (!hasSelectedRow) {
|
|
123
|
+
selectedRow.value = null
|
|
124
|
+
selectedStorage.value = null
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
{ immediate: true }
|
|
128
|
+
)
|
|
129
|
+
watch(
|
|
130
|
+
selectedRow,
|
|
131
|
+
(newValue) => {
|
|
132
|
+
emits('is-selected-row', typeof newValue === 'number')
|
|
133
|
+
},
|
|
134
|
+
{ immediate: true }
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
watch(
|
|
138
|
+
() => props.storageSubmit,
|
|
139
|
+
(newValue) => {
|
|
140
|
+
newValue && submit(newValue)
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
const submit = (cb: Function): void => {
|
|
144
|
+
if (!selectedStorage.value) {
|
|
145
|
+
showValidationErrors([
|
|
146
|
+
localization.value.common.selectValidDestinationStorage,
|
|
147
|
+
])
|
|
148
|
+
cb(false)
|
|
149
|
+
return
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
emits('submit', selectedStorage.value)
|
|
153
|
+
cb(true)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const compatibility = computed<[UI_T_CompatibilityStatus, string]>(() => {
|
|
157
|
+
if (!selectedStorage.value)
|
|
158
|
+
return ['none', localization.value.vmWizard.noStorageSelected]
|
|
159
|
+
return ['success', localization.value.common.compatibilityChecksSucceeded]
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
const errors = ref<string[]>([])
|
|
163
|
+
const showValidationErrors = (arr: string[]): void => {
|
|
164
|
+
errors.value = arr
|
|
165
|
+
}
|
|
166
|
+
const onRemoveValidationErrors = (): void => {
|
|
167
|
+
errors.value = []
|
|
168
|
+
}
|
|
169
|
+
watch(
|
|
170
|
+
errors,
|
|
171
|
+
(newValue) => {
|
|
172
|
+
emits('has-errors', !newValue.length)
|
|
173
|
+
},
|
|
174
|
+
{ immediate: true, deep: true }
|
|
175
|
+
)
|
|
176
|
+
</script>
|
|
177
|
+
|
|
178
|
+
<style scoped lang="scss"></style>
|