From 508fd55c7922ee6dcec3822436510fb76f49f479 Mon Sep 17 00:00:00 2001 From: Inigo Goiri Date: Mon, 17 Sep 2018 14:37:25 -0700 Subject: [PATCH] HDFS-13844. Fix the fmt_bytes function in the dfs-dust.js. Contributed by yanghuafeng. (cherry picked from commit a9c1c55cafc0338bb35d2991f217d4157463f1d3) --- .../hadoop-hdfs/src/main/webapps/static/dfs-dust.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dfs-dust.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dfs-dust.js index a572282ea47..316a9947ca9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dfs-dust.js +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dfs-dust.js @@ -20,7 +20,7 @@ var filters = { 'fmt_bytes': function (v) { - var UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'ZB']; + var UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB']; var prev = 0, i = 0; while (Math.floor(v) > 0 && i < UNITS.length) { prev = v; @@ -28,7 +28,7 @@ i += 1; } - if (i > 0 && i < UNITS.length) { + if (i > 0) { v = prev; i -= 1; }