Skip to content

Commit 827c773

Browse files
author
Daniel Augusto Veronezi Salvador
committed
Merge branch 'fix-storage-option-when-migrating-vm-with-volume' into '4.20.0.0-scclouds'
Remoção do _storage pool_ atual da listagem da UI quando migrando VM com volume Closes apache#520 See merge request scclouds/scclouds!1175
2 parents a99d2c9 + 2491143 commit 827c773

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

ui/src/components/view/StoragePoolSelectView.vue

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,25 @@ export default {
186186
methods: {
187187
fetchStoragePools () {
188188
this.loading = true
189+
api('findStoragePoolsForMigration', {
190+
id: this.resource.id,
191+
keyword: this.searchQuery,
192+
page: this.page,
193+
pagesize: this.pageSize
194+
}).then(response => {
195+
this.storagePools = response.findstoragepoolsformigrationresponse.storagepool || []
196+
this.totalCount = response.findstoragepoolsformigrationresponse.count
197+
if (Array.isArray(this.storagePools) && this.storagePools.length) {
198+
this.selectedStoragePool = this.storagePools[0].id || ''
199+
}
200+
this.fetchStoragePoolsMetrics()
201+
}).catch(error => {
202+
this.$notifyError(error)
203+
}).finally(() => {
204+
this.handleStoragePoolsFetchComplete()
205+
})
206+
},
207+
fetchStoragePoolsMetrics () {
189208
const params = {
190209
zoneid: this.resource.zoneid,
191210
keyword: this.searchQuery,
@@ -198,25 +217,8 @@ export default {
198217
api('listStoragePoolsMetrics', params).then(response => {
199218
this.storagePoolsMetrics = response.liststoragepoolsmetricsresponse.storagepool || []
200219
this.totalCount = response.liststoragepoolsmetricsresponse.count
201-
if (this.suitabilityEnabled) {
202-
api('findStoragePoolsForMigration', {
203-
id: this.resource.id,
204-
keyword: this.searchQuery,
205-
page: this.page,
206-
pagesize: this.pageSize
207-
}).then(response => {
208-
this.storagePools = response.findstoragepoolsformigrationresponse.storagepool || []
209-
this.totalCount = response.findstoragepoolsformigrationresponse.count
210-
}).catch(error => {
211-
this.$notifyError(error)
212-
})
213-
} else {
214-
this.storagePools = this.storagePoolsMetrics
215-
}
216220
}).catch(error => {
217221
this.$notifyError(error)
218-
}).finally(() => {
219-
this.handleStoragePoolsFetchComplete()
220222
})
221223
},
222224
handleStoragePoolsFetchComplete () {

0 commit comments

Comments
 (0)