diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html
index 366c80fcc13..df6e4e8797f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html
@@ -23,6 +23,11 @@
Namenode information
+
@@ -315,9 +320,11 @@
+DataNode State
+ State |
Node |
Http Address |
Last contact |
@@ -330,6 +337,7 @@
{#LiveNodes}
+ {state} |
{name} ({xferaddr}) |
{dnWebAddress} |
{lastContact}s |
@@ -350,6 +358,7 @@
{/LiveNodes}
{#DeadNodes}
+ {state} |
{name} ({xferaddr}) |
|
{#helper_relative_time value="{lastContact}"/} |
@@ -357,6 +366,7 @@
|
|
|
+ |
{/DeadNodes}
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js
index 4e8b362d9ae..d12a9fbb203 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js
@@ -333,7 +333,11 @@
$('#tab-datanode').html(out);
$('#table-datanodes').dataTable( {
'lengthMenu': [ [25, 50, 100, -1], [25, 50, 100, "All"] ],
+ 'columnDefs': [
+ { 'targets': [ 0 ], 'visible': false, 'searchable': false }
+ ],
'columns': [
+ { 'orderDataType': 'ng-value', 'searchable': true , "defaultContent": "" },
{ 'orderDataType': 'ng-value', 'searchable': true , "defaultContent": "" },
{ 'orderDataType': 'ng-value', 'searchable': true , "defaultContent": ""},
{ 'orderDataType': 'ng-value', 'type': 'num' , "defaultContent": 0},
@@ -342,7 +346,22 @@
{ 'type': 'num' , "defaultContent": 0},
{ 'orderDataType': 'ng-value', 'type': 'num' , "defaultContent": 0},
{ 'type': 'string' , "defaultContent": ""}
- ]});
+ ],
+ initComplete: function () {
+ var column = this.api().column([0]);
+ var select = $('')
+ .appendTo('#datanodefilter')
+ .on('change', function () {
+ var val = $.fn.dataTable.util.escapeRegex(
+ $(this).val());
+ column.search(val ? '^' + val + '$' : '', true, false).draw();
+ });
+ console.log(select);
+ column.data().unique().sort().each(function (d, j) {
+ select.append('');
+ });
+ }
+ });
renderHistogram(data);
$('#ui-tabs a[href="#tab-datanode"]').tab('show');
});
@@ -469,4 +488,4 @@ function open_hostip_list(x0, x1) {
function close_hostip_list() {
$("#datanode_ips").remove();
$("#close_ips").remove();
-}
\ No newline at end of file
+}
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
index b3e79e2d507..e7a264c7453 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/hadoop.css
@@ -314,6 +314,13 @@ header.bs-docs-nav, header.bs-docs-nav .navbar-brand {
left: 75px;
}
+.datanodestatus{
+ width:75px;
+ height:30px;
+ color: #555;
+ display: inline-block;
+}
+
.bar rect {
fill: #5FA33F;
}