mirror of
				https://github.com/scinote-eln/scinote-web.git
				synced 2025-10-25 13:37:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
| <template>
 | |
|   <div class="storage-usage">
 | |
|     <div class="progress-container">
 | |
|       <div class="progress-bar" :style="`width:${storagePrecentage}%`"></div>
 | |
|     </div>
 | |
|     <span class="progress-message" v-if="this.parent.attributes.storage_limit.total > 0">
 | |
|       {{ i18n.t('protocols.steps.space_used_label', {
 | |
|                   used: this.parent.attributes.storage_limit.used_human,
 | |
|                   limit: this.parent.attributes.storage_limit.total_human
 | |
|       }) }}
 | |
|     </span>
 | |
|     <span class="progress-message" v-else>
 | |
|       {{ i18n.t('protocols.steps.space_used_label_unlimited', {used: this.parent.attributes.storage_limit.used_human}) }}
 | |
|     </span>
 | |
|   </div>
 | |
| </template>
 | |
| <script>
 | |
|   export default {
 | |
|     name: 'StorageUsage',
 | |
|     props: {
 | |
|       parent: {
 | |
|         type: Object,
 | |
|         required: true,
 | |
|       },
 | |
|     },
 | |
|     computed: {
 | |
|       storagePrecentage() {
 | |
|         let used = this.parent.attributes.storage_limit.used;
 | |
|         let total = this.parent.attributes.storage_limit.total;
 | |
|         return ((used / total) * 100);
 | |
|       }
 | |
|     }
 | |
|   }
 | |
| </script>
 |