Skip to content

Commit

Permalink
Fix display of properties related to backup size (apache#8845)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardodemarco authored Apr 16, 2024
1 parent 075b413 commit 7721133
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions ui/src/components/view/DetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@
{{ service.name }} : {{ service.provider[0].name }}
</div>
</div>
<div v-else-if="$route.meta.name === 'backup' && (item === 'size' || item === 'virtualsize')">
{{ $bytesToHumanReadableSize(dataResource[item]) }}
<a-tooltip placement="right">
<template #title>
{{ dataResource[item] }} bytes
</template>
<QuestionCircleOutlined />
</a-tooltip>
</div>
<div v-else-if="$route.meta.name === 'backup' && item === 'volumes'">
<div v-for="(volume, idx) in JSON.parse(dataResource[item])" :key="idx">
<router-link :to="{ path: '/volume/' + volume.uuid }">{{ volume.type }} - {{ volume.path }}</router-link> ({{ parseFloat(volume.size / (1024.0 * 1024.0 * 1024.0)).toFixed(1) }} GB)
Expand Down
12 changes: 11 additions & 1 deletion ui/src/components/view/InfoCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,20 @@
</div>
</div>
<div class="resource-detail-item" v-if="resource.volumes || resource.sizegb">
<div class="resource-detail-item__label">{{ $t('label.disksize') }}</div>
<div class="resource-detail-item__label" v-if="$route.meta.name === 'backup'">{{ $t('label.size') }}</div>
<div class="resource-detail-item__label" v-else>{{ $t('label.disksize') }}</div>
<div class="resource-detail-item__details">
<hdd-outlined />
<span style="width: 100%;" v-if="$route.meta.name === 'vm' && resource.volumes">{{ (resource.volumes.reduce((total, item) => total += item.size, 0) / (1024 * 1024 * 1024.0)).toFixed(2) }} GB Storage</span>
<span style="width: 100%;" v-else-if="$route.meta.name === 'backup'">
{{ $bytesToHumanReadableSize(resource.size) }}
<a-tooltip placement="right">
<template #title>
{{ resource.size }} bytes
</template>
<QuestionCircleOutlined />
</a-tooltip>
</span>
<span style="width: 100%;" v-else-if="resource.sizegb || resource.size">{{ resource.sizegb || (resource.size/1024.0) }}</span>
</div>
<div style="margin-left: 25px; margin-top: 5px" v-if="resource.diskkbsread && resource.diskkbswrite && resource.diskioread && resource.diskiowrite">
Expand Down

0 comments on commit 7721133

Please sign in to comment.