Browse Source

HDFS-13844. Fix the fmt_bytes function in the dfs-dust.js. Contributed by yanghuafeng.

(cherry picked from commit a9c1c55cafc0338bb35d2991f217d4157463f1d3)
Inigo Goiri 6 years ago
parent
commit
f0537b5161

+ 2 - 2
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;
       }