Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions ui/src/views/storage/ResizeVolume.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ export default {
},
data () {
return {
offerings: [],
customDiskOffering: false,
loading: false,
customDiskOfferingIops: false
}
Expand All @@ -105,14 +103,23 @@ export default {
},
fetchData () {
this.loading = true
if (this.resource.size != null) {
this.form.size = Math.round(this.resource.size / (1024 * 1024 * 1024))

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use % instead Math round

}
if (!this.resource.diskofferingid) {
this.loading = false
return
}
getAPI('listDiskOfferings', {
zoneid: this.resource.zoneid,
listall: true
id: this.resource.diskofferingid,
state: 'all'
}).then(json => {
this.offerings = json.listdiskofferingsresponse.diskoffering || []
this.form.diskofferingid = this.offerings[0].id || ''
this.customDiskOffering = this.offerings[0].iscustomized || false
this.customDiskOfferingIops = this.offerings[0].iscustomizediops || false
const currentOffering = (json.listdiskofferingsresponse.diskoffering || [])[0]
this.customDiskOfferingIops = currentOffering?.iscustomizediops || false
if (this.customDiskOfferingIops) {
this.form.miniops = this.resource.miniops
this.form.maxiops = this.resource.maxiops
}
}).finally(() => {
this.loading = false
})
Expand Down
Loading