From 166eecf687765f369cd5bf210cc6d7bf493121ea Mon Sep 17 00:00:00 2001 From: Vinayakumar B Date: Thu, 26 Feb 2015 14:36:09 +0530 Subject: [PATCH] HDFS-7832. Show 'Last Modified' in Namenode's 'Browse Filesystem' (Contributed by Vinayakumar B) --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop-hdfs/src/main/webapps/hdfs/explorer.html | 2 ++ .../hadoop-hdfs/src/main/webapps/hdfs/explorer.js | 9 ++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 4523bf40bd..e09714f8cb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -676,6 +676,9 @@ Release 2.7.0 - UNRELEASED HDFS-7537. Add "UNDER MIN REPL'D BLOCKS" count to fsck. (GAO Rui via szetszwo) + HDFS-7832. Show 'Last Modified' in Namenode's 'Browse Filesystem' + (vinayakumarb) + OPTIMIZATIONS HDFS-7454. Reduce memory footprint for AclEntries in NameNode. 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 e1fdfa341e..7b340441b5 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 @@ -112,6 +112,7 @@

Browse Directory

Owner Group Size + Last Modified Replication Block Size Name @@ -124,6 +125,7 @@

Browse Directory

{owner} {group} {length|fmt_bytes} + {#helper_date_tostring value="{modificationTime}"/} {replication} {blockSize|fmt_bytes} {pathSuffix} 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 87d47fad9e..0a53dcd65a 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 @@ -143,6 +143,12 @@ } function browse_directory(dir) { + var HELPERS = { + 'helper_date_tostring' : function (chunk, ctx, bodies, params) { + var value = dust.helpers.tap(params.value, chunk, ctx); + return chunk.write('' + new Date(Number(value)).toLocaleString()); + } + }; var url = '/webhdfs/v1' + dir + '?op=LISTSTATUS'; $.get(url, function(data) { var d = get_response(data, "FileStatuses"); @@ -154,7 +160,8 @@ current_directory = dir; $('#directory').val(dir); window.location.hash = dir; - dust.render('explorer', d, function(err, out) { + var base = dust.makeBase(HELPERS); + dust.render('explorer', base.push(d), function(err, out) { $('#panel').html(out); $('.explorer-browse-links').click(function() {