Selaa lähdekoodia

RBF: Add search box in Router's tab-mounttable web page (#3968)

Neil 3 vuotta sitten
vanhempi
commit
390967f1f0

+ 4 - 4
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/webapps/router/federationhealth.html

@@ -458,7 +458,7 @@ No nodes are decommissioning.
   </ul>
 </div>
 <small>
-<table class="table">
+<table class="table" id="table-mounttable">
   <thead>
     <tr>
       <th>Global path</th>
@@ -478,9 +478,9 @@ No nodes are decommissioning.
   <tbody>
     {#MountTable}
     <tr>
-      <td>{sourcePath}</td>
-      <td>{nameserviceId}</td>
-      <td>{path}</td>
+      <td ng-value="{sourcePath}">{sourcePath}</td>
+      <td ng-value="{nameserviceId}">{nameserviceId}</td>
+      <td ng-value="{path}">{path}</td>
       <td>{order}</td>
       <td align="center" class="federationhealth-mounttable-icon federationhealth-mounttable-{readonly}" title="{status}"/>
       <td align="center" class="mount-table-icon mount-table-fault-tolerant-{faulttolerant}" title="{ftStatus}"></td>

+ 16 - 0
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/webapps/router/federationhealth.js

@@ -475,6 +475,22 @@
         var base = dust.makeBase(HELPERS);
         dust.render('mounttable', base.push(data), function(err, out) {
           $('#tab-mounttable').html(out);
+          $('#table-mounttable').dataTable( {
+            'lengthMenu': [ [25, 50, 100, -1], [25, 50, 100, "All"] ],
+            'columns': [
+              { 'orderDataType': 'ng-value', 'searchable': true },
+              { 'orderDataType': 'ng-value', 'searchable': true },
+              { 'orderDataType': 'ng-value', 'searchable': true },
+              { 'type': 'string' , "defaultContent": "" },
+              { 'type': 'string' , "defaultContent": "" },
+              { 'type': 'string' , "defaultContent": "" },
+              { 'type': 'string' , "defaultContent": "" },
+              { 'type': 'string' , "defaultContent": "" },
+              { 'type': 'string' , "defaultContent": "" },
+              { 'type': 'string' , "defaultContent": "" },
+              { 'type': 'string' , "defaultContent": "" },
+              { 'type': 'string' , "defaultContent": "" }
+            ]});
           $('#ui-tabs a[href="#tab-mounttable"]').tab('show');
         });
       })).fail(ajax_error_handler);