From f7a94ec0a443711cf48c8ab146c5b365e358f0b3 Mon Sep 17 00:00:00 2001 From: Inigo Goiri Date: Sun, 29 Mar 2020 08:17:02 -0700 Subject: [PATCH] HDFS-15239. Add button to go to the parent directory in the explorer. Contributed by hemanthboyina. --- .../hadoop-hdfs-rbf/src/main/webapps/router/explorer.html | 8 ++++++-- .../hadoop-hdfs-rbf/src/main/webapps/router/explorer.js | 7 +++++++ .../hadoop-hdfs/src/main/webapps/hdfs/explorer.html | 8 ++++++-- .../hadoop-hdfs/src/main/webapps/hdfs/explorer.js | 7 +++++++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/webapps/router/explorer.html b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/webapps/router/explorer.html index 3a5956d9e6..1f45f4d16c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/webapps/router/explorer.html +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/webapps/router/explorer.html @@ -172,7 +172,7 @@
-
+
@@ -182,7 +182,7 @@
-
+
diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/webapps/router/explorer.js b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/webapps/router/explorer.js index 59a4b8a428..d2f372920a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/webapps/router/explorer.js +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/webapps/router/explorer.js @@ -377,6 +377,13 @@ } + $('#parentDir').click(function () { + var current = current_directory; + var lastIndex = current.lastIndexOf('/'); + var parent = current.substr(0, lastIndex); + browse_directory(parent); + }) + function init() { dust.loadSource(dust.compile($('#tmpl-explorer').html(), 'explorer')); dust.loadSource(dust.compile($('#tmpl-block-info').html(), 'block-info')); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html index bcca5ba8ea..7b5f355c5c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.html @@ -172,7 +172,7 @@
-
+
@@ -182,7 +182,7 @@
-
+
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js index 4a8eb23efa..f1a5f4a48c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/explorer.js @@ -376,6 +376,13 @@ }).fail(network_error_handler(url)); } + $('#parentDir').click(function () { + var current = current_directory; + var lastIndex = current.lastIndexOf('/'); + var parent = current.substr(0, lastIndex); + browse_directory(parent); + }) + function init() { dust.loadSource(dust.compile($('#tmpl-explorer').html(), 'explorer'));