You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by we...@apache.org on 2019/08/09 22:42:10 UTC
[hadoop] branch trunk updated: HDFS-14623. In NameNode Web UI,
for Head the file (first 32K) old data is showing. Contributed by
hemanthboyina.
This is an automated email from the ASF dual-hosted git repository.
weichiu pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new ce3c5a3 HDFS-14623. In NameNode Web UI, for Head the file (first 32K) old data is showing. Contributed by hemanthboyina.
ce3c5a3 is described below
commit ce3c5a3e3bf6acac514de6d9c1d5555d6786520a
Author: Wei-Chiu Chuang <we...@apache.org>
AuthorDate: Fri Aug 9 15:41:37 2019 -0700
HDFS-14623. In NameNode Web UI, for Head the file (first 32K) old data is showing. Contributed by hemanthboyina.
---
.../hadoop-hdfs/src/main/webapps/hdfs/explorer.js | 25 ++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
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 de9916e..4a8eb23 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
@@ -195,20 +195,28 @@
var processPreview = function(url) {
url += "&noredirect=true";
- $.ajax({
+ if(request && request.readyState != 4){
+ request.abort();
+ }
+ request = $.ajax({
+ cache: false,
type: 'GET',
url: url,
+ async: false,
processData: false,
crossDomain: true
- }).done(function(data) {
+ }).done(function(data, textStatus, jqXHR) {
+
url = data.Location;
$.ajax({
+ cache: false,
type: 'GET',
url: url,
+ async: false,
processData: false,
crossDomain: true
- }).always(function(data) {
- $('#file-info-preview-body').val(data);
+ }).always(function(data, textStatus, jqXHR) {
+ $('#file-info-preview-body').val(jqXHR.responseText);
$('#file-info-tail').show();
}).fail(function(jqXHR, textStatus, errorThrown) {
show_err_msg("Couldn't preview the file. " + errorThrown);
@@ -218,12 +226,17 @@
});
}
- $('#file-info-preview-tail').click(function() {
+ var request = null;
+ $('#file-info-preview-tail')
+ .off('click')
+ .on('click', function() {
var offset = d.fileLength - TAIL_CHUNK_SIZE;
var url = offset > 0 ? download_url + '&offset=' + offset : download_url;
processPreview(url);
});
- $('#file-info-preview-head').click(function() {
+ $('#file-info-preview-head')
+ .off('click')
+ .on('click', function() {
var url = d.fileLength > TAIL_CHUNK_SIZE ? download_url + '&length=' + TAIL_CHUNK_SIZE : download_url;
processPreview(url);
});
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org