Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ public class VolumeResponse extends BaseResponseWithTagInformation implements Co
@Param(description = "Max IOPS of the disk volume")
private Long maxIops;

@SerializedName("iscustomizediops")
@Param(description = "True if the volume's disk offering uses custom IOPS, false otherwise")
private Boolean customizedIops;

@SerializedName(ApiConstants.CREATED)
@Param(description = "The date the disk volume was created")
private Date created;
Expand Down Expand Up @@ -410,6 +414,10 @@ public void setMaxIops(Long maxIops) {
this.maxIops = maxIops;
}

public void setCustomizedIops(Boolean customizedIops) {
this.customizedIops = customizedIops;
}

public void setCreated(Date created) {
this.created = created;
}
Expand Down Expand Up @@ -712,6 +720,10 @@ public Long getMaxIops() {
return maxIops;
}

public Boolean isCustomizedIops() {
return customizedIops;
}

public Date getCreated() {
return created;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ public VolumeResponse newVolumeResponse(ResponseView view, VolumeJoinVO volume)
volResponse.setDiskOfferingName(volume.getDiskOfferingName());
volResponse.setDiskOfferingDisplayText(volume.getDiskOfferingDisplayText());
}
DiskOffering diskOffering = computeOnlyDiskOffering != null
? computeOnlyDiskOffering
: ApiDBUtils.findDiskOfferingById(volume.getDiskOfferingId());
if (diskOffering != null) {
volResponse.setCustomizedIops(diskOffering.isCustomizedIops());
}

if (view == ResponseView.Full) {
volResponse.setStorageType(volume.isUseLocalStorage() ? ServiceOffering.StorageType.local.toString() : ServiceOffering.StorageType.shared.toString());
Expand Down
23 changes: 5 additions & 18 deletions ui/src/views/storage/ResizeVolume.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</template>
<script>
import { ref, reactive, toRaw } from 'vue'
import { getAPI, postAPI } from '@/api'
import { postAPI } from '@/api'
import { mixinForm } from '@/utils/mixin'
import TooltipLabel from '@/components/widgets/TooltipLabel'

Expand Down Expand Up @@ -102,27 +102,14 @@ export default {
})
},
fetchData () {
this.loading = true
if (this.resource.size != null) {
this.form.size = this.resource.size / (1024 * 1024 * 1024)
}
if (!this.resource.diskofferingid) {
this.loading = false
return
this.customDiskOfferingIops = this.resource.iscustomizediops
if (this.customDiskOfferingIops) {
this.form.miniops = this.resource.miniops
this.form.maxiops = this.resource.maxiops
}
getAPI('listDiskOfferings', {
id: this.resource.diskofferingid,
state: 'all'
}).then(json => {
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
})
},
handleSubmit (e) {
if (this.loading) return
Expand Down
Loading