2022-05-26 20:48:57 +08:00
|
|
|
<template>
|
|
|
|
<div class="storage-usage">
|
|
|
|
<div class="progress-container">
|
|
|
|
<div class="progress-bar" :style="`width:${storagePrecentage}%`"></div>
|
|
|
|
</div>
|
2023-07-24 19:28:44 +08:00
|
|
|
<span class="progress-message" v-if="this.parent.attributes.storage_limit.total > 0">
|
2022-05-26 21:01:52 +08:00
|
|
|
{{ i18n.t('protocols.steps.space_used_label', {
|
2023-07-24 19:28:44 +08:00
|
|
|
used: this.parent.attributes.storage_limit.used_human,
|
|
|
|
limit: this.parent.attributes.storage_limit.total_human
|
2022-05-26 21:01:52 +08:00
|
|
|
}) }}
|
2022-05-26 20:48:57 +08:00
|
|
|
</span>
|
2022-07-28 15:56:09 +08:00
|
|
|
<span class="progress-message" v-else>
|
2023-07-24 19:28:44 +08:00
|
|
|
{{ i18n.t('protocols.steps.space_used_label_unlimited', {used: this.parent.attributes.storage_limit.used_human}) }}
|
2022-05-26 20:48:57 +08:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'StorageUsage',
|
|
|
|
props: {
|
2023-07-24 19:28:44 +08:00
|
|
|
parent: {
|
2022-05-26 20:48:57 +08:00
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
storagePrecentage() {
|
2023-07-24 19:28:44 +08:00
|
|
|
let used = this.parent.attributes.storage_limit.used;
|
|
|
|
let total = this.parent.attributes.storage_limit.total;
|
2022-05-26 20:48:57 +08:00
|
|
|
return ((used / total) * 100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|