From 476b28a1a28cfbd692c1ccd06f69097cc553e2ef Mon Sep 17 00:00:00 2001
From: Filipa Lacerda <filipa@gitlab.com>
Date: Mon, 13 Nov 2017 19:51:14 +0000
Subject: Formats bytes to human reabale number in registry table

---
 app/assets/javascripts/registry/components/table_registry.vue | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'app/assets/javascripts/registry/components/table_registry.vue')

diff --git a/app/assets/javascripts/registry/components/table_registry.vue b/app/assets/javascripts/registry/components/table_registry.vue
index e917279947e..14d43e135fe 100644
--- a/app/assets/javascripts/registry/components/table_registry.vue
+++ b/app/assets/javascripts/registry/components/table_registry.vue
@@ -8,6 +8,7 @@
   import tooltip from '../../vue_shared/directives/tooltip';
   import timeagoMixin from '../../vue_shared/mixins/timeago';
   import { errorMessages, errorMessagesTypes } from '../constants';
+  import { numberToHumanSize } from '../../lib/utils/number_utils';
 
   export default {
     props: {
@@ -41,6 +42,10 @@
         return item.layers ? n__('%d layer', '%d layers', item.layers) : '';
       },
 
+      formatSize(size) {
+        return numberToHumanSize(size);
+      },
+
       handleDeleteRegistry(registry) {
         this.deleteRegistry(registry)
           .then(() => this.fetchList({ repo: this.repo }))
@@ -97,7 +102,7 @@
             </span>
         </td>
         <td>
-          {{item.size}}
+          {{formatSize(item.size)}}
           <template v-if="item.size && item.layers">
             &middot;
           </template>
-- 
cgit v1.2.1

