|
22 | 22 | <p class="modal-form__label">{{ $t('storagePool') }}</p> |
23 | 23 | <a-select v-model="selectedStoragePool" style="width: 100%;"> |
24 | 24 | <a-select-option v-for="(storagePool, index) in storagePools" :value="storagePool.id" :key="index"> |
25 | | - {{ storagePool.name }} |
| 25 | + {{ storagePool.name }} <span v-if="resource.virtualmachineid">{{ storagePool.suitableformigration ? '(Suitable)' : '(Not Suitable)'}}</span> |
26 | 26 | </a-select-option> |
27 | 27 | </a-select> |
28 | 28 | <template v-if="this.resource.virtualmachineid"> |
@@ -78,24 +78,39 @@ export default { |
78 | 78 | selectedDiskOffering: null |
79 | 79 | } |
80 | 80 | }, |
81 | | - created () { |
| 81 | + mounted () { |
82 | 82 | this.fetchStoragePools() |
83 | 83 | this.resource.virtualmachineid && this.fetchDiskOfferings() |
84 | 84 | }, |
85 | 85 | methods: { |
86 | 86 | fetchStoragePools () { |
87 | | - api('listStoragePools', { |
88 | | - zoneid: this.resource.zoneid |
89 | | - }).then(response => { |
90 | | - this.storagePools = response.liststoragepoolsresponse.storagepool |
91 | | - this.selectedStoragePool = this.storagePools[0].id |
92 | | - }).catch(error => { |
93 | | - this.$notification.error({ |
94 | | - message: `Error ${error.response.status}`, |
95 | | - description: error.response.data.errorresponse.errortext |
| 87 | + if (this.resource.virtualmachineid) { |
| 88 | + api('findStoragePoolsForMigration', { |
| 89 | + id: this.resource.id |
| 90 | + }).then(response => { |
| 91 | + this.storagePools = response.findstoragepoolsformigrationresponse.storagepool || [] |
| 92 | + this.selectedStoragePool = this.storagePools[0].id || '' |
| 93 | + }).catch(error => { |
| 94 | + this.$notification.error({ |
| 95 | + message: `Error ${error.response.status}`, |
| 96 | + description: error.response.data.errorresponse.errortext |
| 97 | + }) |
| 98 | + this.closeModal() |
96 | 99 | }) |
97 | | - this.closeModal() |
98 | | - }) |
| 100 | + } else { |
| 101 | + api('listStoragePools', { |
| 102 | + zoneid: this.resource.zoneid |
| 103 | + }).then(response => { |
| 104 | + this.storagePools = response.liststoragepoolsresponse.storagepool || [] |
| 105 | + this.selectedStoragePool = this.storagePools[0].id || '' |
| 106 | + }).catch(error => { |
| 107 | + this.$notification.error({ |
| 108 | + message: `Error ${error.response.status}`, |
| 109 | + description: error.response.data.errorresponse.errortext |
| 110 | + }) |
| 111 | + this.closeModal() |
| 112 | + }) |
| 113 | + } |
99 | 114 | }, |
100 | 115 | fetchDiskOfferings () { |
101 | 116 | api('listDiskOfferings', { |
@@ -180,7 +195,6 @@ export default { |
180 | 195 | margin-top: -20px; |
181 | 196 |
|
182 | 197 | &__label { |
183 | | - font-weight: bold; |
184 | 198 | margin-top: 10px; |
185 | 199 | margin-bottom: 5px; |
186 | 200 | } |
|
0 commit comments