You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by vi...@apache.org on 2020/07/27 20:02:39 UTC

[hadoop-ozone] branch master updated: HDDS-4030. Remember the selected columns and make the X-axis scrollable in recon datanodes UI (#1259)

This is an automated email from the ASF dual-hosted git repository.

vivekratnavel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 0869cce  HDDS-4030. Remember the selected columns and make the X-axis scrollable in recon datanodes UI (#1259)
0869cce is described below

commit 0869ccead6c39e313b2aebdecc775c706e926549
Author: HuangTao <th...@163.com>
AuthorDate: Tue Jul 28 04:02:23 2020 +0800

    HDDS-4030. Remember the selected columns and make the X-axis scrollable in recon datanodes UI (#1259)
---
 .../src/views/datanodes/datanodes.less             |  1 +
 .../src/views/datanodes/datanodes.tsx              | 44 ++++++++++++----------
 2 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.less b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.less
index 10ec907..644437d 100644
--- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.less
+++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.less
@@ -35,5 +35,6 @@
     margin-right: 5px;
     display: inline-block;
     min-width: 200px;
+    z-index: 99;
   }
 }
diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx
index 856ab65..91b6a45 100644
--- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx
+++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx
@@ -107,16 +107,8 @@ const COLUMNS = [
     filters: DatanodeStatusList.map(status => ({text: status, value: status})),
     onFilter: (value: DatanodeStatus, record: IDatanode) => record.state === value,
     render: (text: DatanodeStatus) => renderDatanodeStatus(text),
-    sorter: (a: IDatanode, b: IDatanode) => a.state.localeCompare(b.state)
-  },
-  {
-    title: 'Uuid',
-    dataIndex: 'uuid',
-    key: 'uuid',
-    isVisible: true,
-    isSearchable: true,
-    sorter: (a: IDatanode, b: IDatanode) => a.uuid.localeCompare(b.uuid),
-    defaultSortOrder: 'ascend' as const
+    sorter: (a: IDatanode, b: IDatanode) => a.state.localeCompare(b.state),
+    fixed: 'left'
   },
   {
     title: 'Hostname',
@@ -125,6 +117,16 @@ const COLUMNS = [
     isVisible: true,
     isSearchable: true,
     sorter: (a: IDatanode, b: IDatanode) => a.hostname.localeCompare(b.hostname),
+    defaultSortOrder: 'ascend' as const,
+    fixed: 'left'
+  },
+  {
+    title: 'Uuid',
+    dataIndex: 'uuid',
+    key: 'uuid',
+    isVisible: true,
+    isSearchable: true,
+    sorter: (a: IDatanode, b: IDatanode) => a.uuid.localeCompare(b.uuid),
     defaultSortOrder: 'ascend' as const
   },
   {
@@ -266,10 +268,19 @@ export class Datanodes extends React.Component<Record<string, object>, IDatanode
     });
   };
 
+  _getSelectedColumns = (selected: IOption[]) => {
+    const selectedColumns = selected.length > 0 ? selected : COLUMNS.filter(column => column.isVisible).map(column => ({
+      label: column.key,
+      value: column.key
+    }));
+    return selectedColumns;
+  };
+
   _loadData = () => {
-    this.setState({
-      loading: true
-    });
+    this.setState(prevState => ({
+      loading: true,
+      selectedColumns: this._getSelectedColumns(prevState.selectedColumns)
+    }));
     axios.get('/api/v1/datanodes').then(response => {
       const datanodesResponse: IDatanodesResponse = response.data;
       const totalCount = datanodesResponse.totalCount;
@@ -292,18 +303,12 @@ export class Datanodes extends React.Component<Record<string, object>, IDatanode
           buildDate: datanode.buildDate
         };
       });
-      const selectedColumns: IOption[] = COLUMNS.filter(column => column.isVisible).map(column => ({
-        label: column.key,
-        value: column.key
-      }));
 
       this.setState({
         loading: false,
         dataSource,
         totalCount,
         lastUpdated: Number(moment())
-      }, () => {
-        this._handleColumnChange(selectedColumns, {action: 'select-option'});
       });
     }).catch(error => {
       this.setState({
@@ -381,6 +386,7 @@ export class Datanodes extends React.Component<Record<string, object>, IDatanode
             loading={loading}
             pagination={paginationConfig}
             rowKey='hostname'
+            scroll={{x: true, y: false, scrollToFirstRowOnChange: true}}
           />
         </div>
       </div>


---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-commits-help@hadoop.apache.org