Browse Source

HDFS-16988. Improve NameServices info at JournalNode web UI (#5584). Contributed by Zhaohui Wang.

Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
wangzhaohui 2 years ago
parent
commit
51dcbd1d61
1 changed files with 3 additions and 1 deletions
  1. 3 1
      hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/journal/jn.js

+ 3 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/journal/jn.js

@@ -61,7 +61,9 @@
 
     function workaround(journals) {
         for (var i in journals){
-            journals[i]['NameService']= journals[i]['modelerType'].split("-")[1];
+            var str= journals[i]['modelerType'];
+            var index= str.indexOf("-");
+            journals[i]['NameService']= str.substr(index + 1);
         }
 
         return journals;