@@ -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