devmadhuu commented on code in PR #4940:
URL: https://github.com/apache/ozone/pull/4940#discussion_r1243556971


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/om/om.less:
##########
@@ -0,0 +1,11 @@
+.ant-pagination-disabled a, .ant-pagination-disabled:hover a, 
.ant-pagination-disabled:focus a, .ant-pagination-disabled 
.ant-pagination-item-link, .ant-pagination-disabled:hover 
.ant-pagination-item-link, .ant-pagination-disabled:focus 
.ant-pagination-item-link {
+    color: rgba(0, 0, 0, 0.65);
+    //border-color: #d9d9d9;
+    cursor: pointer !important;
+  }
+  
+  .ant-pagination-disabled, .ant-pagination-disabled:hover, 
.ant-pagination-disabled:focus {
+    color: rgba(0, 0, 0, 0.65);
+    //border-color: #d9d9d9;

Review Comment:
   @smitajoshi12 pls remove commented code.



##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/om/om.tsx:
##########
@@ -0,0 +1,1010 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import React from 'react';
+import axios from 'axios';
+import { Table, Tabs, Menu, Dropdown, Icon, Tooltip } from 'antd';
+import { PaginationConfig } from 'antd/lib/pagination';
+import filesize from 'filesize';
+import moment from 'moment';
+import { showDataFetchError, byteToSize } from 'utils/common';
+import './om.less';
+import { ColumnSearch } from 'utils/columnSearch';
+import { Link } from 'react-router-dom';
+
+
+const size = filesize.partial({ standard: 'iec' });
+const { TabPane } = Tabs;
+//Previous Key Need to store respective Lastkey of each API
+let mismatchPrevKeyList = [0];
+let openPrevKeyList =[""];
+let keysPendingPrevList =[""];
+let deletedKeysPrevList =[0];
+interface IContainerResponse {
+  containerId: number;
+  mismatchMissingState: string;
+  OMContainerState: string;
+  SCMContainerState: string;
+  existsAt: string;
+  pipelines: string[];
+  numberOfKeys: number;
+}
+
+interface IKeyLevelResponse {
+  path: string;
+  keyState: string;
+  inStateSince: number;
+  size: number;
+  replicatedSize: number;
+  unreplicatedSize: number;
+  replicationType: string;
+}
+
+interface IDeleteKeyResponse {
+  objectID: number;
+  updateID: number;
+  parentObjectID: number;
+  volumeName: string;
+  bucketName: string;
+  keyName: string;
+  dataSize: number;
+  path: string;
+  replicatedTotal: number;
+  unreplicatedTotal: number;
+  omKeyInfoList: IDeleteKeyResponse[];
+}
+
+interface IContainersResponse {
+  containers: IContainerResponse[];
+}
+
+interface IKeysResponse {
+  entities: IKeyLevelResponse[];
+}
+interface IDeleteKeysResponse {
+  deletedkeyinfo: IDeleteKeyResponse[];
+}
+
+interface IKeyResponse {
+  Volume: string;
+  Bucket: string;
+  Key: string;
+  DataSize: number;
+  Versions: number[];
+  Blocks: object;
+  CreationTime: string;
+  ModificationTime: string;
+}
+
+interface IContainerKeysResponse {
+  totalCount: number;
+  keys: IKeyResponse[];
+}
+
+const KEY_TABLE_COLUMNS = [
+  {
+    title: 'Volume',
+    dataIndex: 'Volume',
+    key: 'Volume'
+  },
+  {
+    title: 'Bucket',
+    dataIndex: 'Bucket',
+    key: 'Bucket'
+  },
+  {
+    title: 'Key',
+    dataIndex: 'Key',
+    key: 'Key'
+  },
+  {
+    title: 'Size',
+    dataIndex: 'DataSize',
+    key: 'DataSize',
+    render: (dataSize: number) => <div>{size(dataSize)}</div>
+  },
+  {
+    title: 'Date Created',
+    dataIndex: 'CreationTime',
+    key: 'CreationTime',
+    render: (date: string) => moment(date).format('lll')
+  },
+  {
+    title: 'Date Modified',
+    dataIndex: 'ModificationTime',
+    key: 'ModificationTime',
+    render: (date: string) => moment(date).format('lll')
+  }
+];
+
+const MISMATCH_TAB_COLUMNS = [
+  {
+    title: 'Container ID',
+    dataIndex: 'containerId',
+    key: 'containerId',
+    width: '20%',
+    isSearchable: true,
+
+  },
+  {
+    title: 'Count Of Keys',
+    dataIndex: 'numberOfKeys',
+    key: 'numberOfKeys',
+    sorter: (a: IContainerResponse, b: IContainerResponse) => a.numberOfKeys - 
b.numberOfKeys
+  },
+  {
+    title: 'Pipelines',
+    dataIndex: 'pipelines',
+    key: 'pipelines',
+    render: (pipelines: any) => (
+      <div>
+        {pipelines && pipelines.map(pipeline => (
+          <div key={pipeline.id.id}>
+            {pipeline.id.id}
+          </div>
+        ))}
+      </div>
+    )
+  }
+];
+
+const OPEN_KEY_TAB_COLUMNS = [
+  {
+    title: 'Path',
+    dataIndex: 'path',
+    key: 'path',
+    isSearchable: true,
+  },
+  {
+    title: 'Amount of data',
+    dataIndex: 'size',
+    key: 'size',
+    render: (size :any) => size = byteToSize(size,1)
+  },
+  {
+    title: 'Key',
+    dataIndex: 'key',
+    key: 'key',
+    width: '270px'
+  },
+  {
+    title: 'In state since',
+    dataIndex: 'inStateSince',
+    key: 'inStateSince',
+    render: (inStateSince: number) => {
+      return inStateSince > 0 ? moment(inStateSince).format('ll LTS') : 'NA';
+    }
+  },
+  {
+    title: 'Replication Factor',
+    dataIndex: 'replicationInfo',
+    key: 'replicationfactor',
+    render: (replicationInfo: any) => (
+      <div>
+        {
+          <div >
+            {Object.values(replicationInfo)[0]}
+          </div>
+        }
+      </div>
+    )
+  },
+  {
+    title: 'Replication Type',
+    dataIndex: 'replicationInfo',
+    key: 'replicationtype',
+    render: (replicationInfo: any) => (
+      <div>
+        {
+          <div >
+            {Object.values(replicationInfo)[2]}
+          </div>
+        }
+      </div>
+    )
+  }
+
+];
+
+const PENDING_TAB_COLUMNS = [
+  {
+    title: 'Key Name',
+    dataIndex: 'fileName',
+    key: 'fileName'
+  },
+  {
+    title: 'Path',
+    dataIndex: 'keyName',
+    key: 'keyName',
+    isSearchable: true,
+  },
+  {
+    title: 'Total Data Size',
+    dataIndex: 'dataSize',
+    key: 'dataSize',
+    render: (dataSize :any) => dataSize = byteToSize(dataSize,1)
+  },
+  {
+    title: 'Total Key Count',
+    dataIndex: 'keyCount',
+    key: 'keyCount',
+  }
+];
+
+const DELETED_TAB_COLUMNS = [
+  {
+    title: 'Container ID',
+    dataIndex: 'containerId',
+    key: 'containerId',
+    width: '20%',
+    isSearchable: true
+  },
+  {
+    title: 'Count Of Keys',
+    dataIndex: 'numberOfKeys',
+    key: 'numberOfKeys',
+    sorter: (a: IContainerResponse, b: IContainerResponse) => a.numberOfKeys - 
b.numberOfKeys
+  },
+  {
+    title: 'Pipelines',
+    dataIndex: 'pipelines',
+    key: 'pipelines',
+    render: (pipelines: any) => (
+      <div>
+        {pipelines && pipelines.map((pipeline:any) => (
+          <div key={pipeline.id.id}>
+            {pipeline.id.id}
+          </div>
+        ))}
+      </div>
+    )
+  }
+];
+
+interface IExpandedRow {
+  [key: number]: IExpandedRowState;
+}
+
+interface IExpandedRowState {
+  containerId: number;
+  loading: boolean;
+  dataSource: IKeyResponse[];
+  totalCount: number;
+}
+
+interface IOmdbInsightsState {
+  loading: boolean;
+  mismatchDataSource: IContainerResponse[];
+  openKeysDataSource: IKeyLevelResponse[];
+  pendingDeleteKeyDataSource: any[];
+  expandedRowData: IExpandedRow;
+  deletedContainerKeysDataSource: [];
+  prevKeyMismatch: number;
+  mismatchMissingState: any;
+  prevKeyOpen: string;
+  prevKeyDeleted: number;
+  prevKeyDeletePending: string;
+  activeTab: string;
+  DEFAULT_LIMIT: number,
+  clickable: boolean;
+  includeFso: boolean;
+  includeNonFso: boolean;
+  prevClickable :boolean
+}
+
+export class Om extends React.Component<Record<string, object>, 
IOmdbInsightsState> {
+
+  constructor(props = {}) {
+    super(props);
+    this.addexistAtColumn();
+    this.addfsoNonfsoKeyColumn();
+    this.state = {
+      loading: false,
+      mismatchDataSource: [],
+      openKeysDataSource: [],
+      pendingDeleteKeyDataSource: [],
+      deletedContainerKeysDataSource: [],
+      prevKeyMismatch: 0,
+      mismatchMissingState: 'SCM',
+      prevKeyOpen: "",
+      prevKeyDeletePending: "",
+      prevKeyDeleted: 0,
+      expandedRowData: {},
+      activeTab: '1',
+      DEFAULT_LIMIT: 10,
+      clickable: true,
+      includeFso: true,
+      includeNonFso: false,
+      prevClickable:false
+    };
+  }
+
+  addexistAtColumn = () => {
+    // Inside the class component to access the React internal state
+    const existsAtColumn = {
+      title: <span>
+        <Dropdown overlay={this.existAtScmOmMenu} >
+          <label> Exists at&nbsp;&nbsp;
+            <Icon type="funnel-plot" theme="filled" />
+          </label>
+        </Dropdown></span>,
+      dataIndex: 'existsAt',
+      key: 'existsAt',
+      isVisible: true,
+      render: (existsAt: any) => {
+        return (
+          <div key={existsAt}>
+            {existsAt}
+          </div>
+
+        );
+      }
+    }
+    if (MISMATCH_TAB_COLUMNS.length > 0 && 
MISMATCH_TAB_COLUMNS[MISMATCH_TAB_COLUMNS.length - 1].key !== 'existsAt') {
+      MISMATCH_TAB_COLUMNS.push(existsAtColumn);
+    }
+  };
+
+  existAtScmOmMenu = () => (
+    <Menu
+      // defaultSelectedKeys={this.state.mismatchMissingState}

Review Comment:
   @smitajoshi12  pls remove commented code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to