devabhishekpal commented on code in PR #7017:
URL: https://github.com/apache/ozone/pull/7017#discussion_r1705324244


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/storageBar/storageBar.tsx:
##########
@@ -0,0 +1,93 @@
+/*
+ * 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 { Progress } from 'antd';
+import filesize from 'filesize';
+import Icon from '@ant-design/icons';
+import { withRouter } from 'react-router-dom';
+import Tooltip from 'antd/lib/tooltip';
+
+import { FilledIcon } from '@/utils/themeIcons';
+import { getCapacityPercent } from '@/utils/common';
+import type { StorageReport } from '@/v2/types/overview.types';
+
+const size = filesize.partial({
+  standard: 'iec',
+  round: 1
+});
+
+type StorageReportProps = {
+  showMeta: boolean;
+} & StorageReport
+
+
+const StorageBar = (props: StorageReportProps = {
+  capacity: 0,
+  used: 0,
+  remaining: 0,
+  committed: 0,
+  showMeta: true,
+}) => {
+  const { capacity, used, remaining, committed, showMeta } = props;
+
+  const nonOzoneUsed = capacity - remaining - used;
+  const totalUsed = capacity - remaining;
+  const tooltip = (
+    <>
+      <div>
+        <Icon component={FilledIcon} className='ozone-used-bg' />
+        Ozone Used ({size(used)})
+      </div>
+      <div>
+        <Icon component={FilledIcon} className='non-ozone-used-bg' />
+        Non Ozone Used ({size(nonOzoneUsed)})
+      </div>
+      <div>
+        <Icon component={FilledIcon} className='remaining-bg' />
+        Remaining ({size(remaining)})
+      </div>
+      <div>
+        <Icon component={FilledIcon} className='committed-bg' />
+        Container Pre-allocated ({size(committed)})
+      </div>
+    </>
+  );
+  const metaElement = (showMeta) ? (
+    <div>
+      {size(used + nonOzoneUsed)} / {size(capacity)}
+    </div>
+  ) : <></>;
+
+
+  return (
+    <div className='storage-cell-container'>
+      <Tooltip title={tooltip} placement='bottomLeft'>

Review Comment:
   Currently this file is not being used in the existing code.
   This would be used in the datanodes page.
   Hence tooltip is not there as we are using ECharts instead



-- 
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: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to