Skip to content

Commit 3390310

Browse files
Address review comments
1 parent 3537795 commit 3390310

File tree

8 files changed

+27
-28
lines changed

8 files changed

+27
-28
lines changed

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/duBreadcrumbNav/duBreadcrumbNav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import React, { useState } from 'react';
2020

21-
import { DUSubpath } from '@/v2/types/diskUsage.types';
21+
import { DUSubpath } from '@/v2/types/namespaceUsage.types';
2222
import { Breadcrumb, Menu, Input } from 'antd';
2323
import { MenuProps } from 'antd/es/menu';
2424
import { CaretDownOutlined, HomeFilled } from '@ant-design/icons';

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/duMetadata/duMetadata.tsx renamed to hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/nuMetadata/nuMetadata.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ type MetadataState = {
121121

122122

123123
// ------------- Component -------------- //
124-
const DUMetadata: React.FC<MetadataProps> = ({
124+
const NUMetadata: React.FC<MetadataProps> = ({
125125
path = '/'
126126
}) => {
127127
const [loading, setLoading] = useState<boolean>(false);
@@ -380,4 +380,4 @@ const DUMetadata: React.FC<MetadataProps> = ({
380380
);
381381
}
382382

383-
export default DUMetadata;
383+
export default NUMetadata;

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/overviewCard/overviewStorageCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ const OverviewStorageCard: React.FC<OverviewStorageCardProps> = ({
239239

240240
return (
241241
<OverviewCardWrapper
242-
linkToUrl={'/DiskUsage'}
242+
linkToUrl={'/NamespaceUsage'}
243243
title='Report'
244244
children={cardChildren} />
245245
)

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/plots/duPieChart.tsx renamed to hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/plots/nuPieChart.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ import React from 'react';
2020

2121
import EChart from '@/v2/components/eChart/eChart';
2222
import { byteToSize } from '@/utils/common';
23-
import { DUSubpath } from '@/v2/types/diskUsage.types';
23+
import { NUSubpath } from '@/v2/types/namespaceUsage.types';
2424

2525
//-------Types--------//
2626
type PieChartProps = {
27-
path: string | null;
27+
path?: string | null;
2828
limit: number;
2929
size: number;
30-
subPaths: DUSubpath[];
30+
subPaths: NUSubpath[];
3131
subPathCount: number;
3232
sizeWithReplica: number;
3333
loading: boolean;
@@ -39,7 +39,7 @@ const MIN_BLOCK_SIZE = 0.05;
3939

4040

4141
//----------Component---------//
42-
const DUPieChart: React.FC<PieChartProps> = ({
42+
const NUPieChart: React.FC<PieChartProps> = ({
4343
path,
4444
limit,
4545
size,
@@ -50,7 +50,7 @@ const DUPieChart: React.FC<PieChartProps> = ({
5050
}) => {
5151
const [subpathSize, setSubpathSize] = React.useState<number>(0);
5252

53-
function getSubpathSize(subpaths: DUSubpath[]): number {
53+
function getSubpathSize(subpaths: NUSubpath[]): number {
5454
const subpathSize = subpaths
5555
.map((subpath) => subpath.size)
5656
.reduce((acc, curr) => acc + curr, 0);
@@ -69,7 +69,7 @@ const DUPieChart: React.FC<PieChartProps> = ({
6969
* but we can't check on that, as the response will always have
7070
* 30 subpaths, but from the total size and the subpaths size we can calculate it).
7171
*/
72-
let subpaths: DUSubpath[] = subPaths;
72+
let subpaths: NUSubpath[] = subPaths;
7373

7474
let pathLabels: string[] = [];
7575
let percentage: string[] = [];
@@ -120,7 +120,6 @@ const DUPieChart: React.FC<PieChartProps> = ({
120120
? val + MIN_BLOCK_SIZE
121121
: val
122122
);
123-
124123
percentage = values.map(value => (value * 100).toFixed(2));
125124
sizeStr = subpaths.map((subpath) => byteToSize(subpath.size, 1));
126125
}
@@ -207,4 +206,4 @@ const DUPieChart: React.FC<PieChartProps> = ({
207206
);
208207
}
209208

210-
export default DUPieChart;
209+
export default NUPieChart;

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/diskUsage/diskUsage.less renamed to hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/namespaceUsage/namespaceUsage.less

File renamed without changes.

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/diskUsage/diskUsage.tsx renamed to hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/namespaceUsage/namespaceUsage.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ import { Alert, Button, Tooltip } from 'antd';
2222
import { InfoCircleFilled, ReloadOutlined, } from '@ant-design/icons';
2323
import { ValueType } from 'react-select';
2424

25-
import DUMetadata from '@/v2/components/duMetadata/duMetadata';
26-
import DUPieChart from '@/v2/components/plots/duPieChart';
25+
import NUMetadata from '@/v2/components/nuMetadata/nuMetadata';
26+
import NUPieChart from '@/v2/components/plots/nuPieChart';
2727
import SingleSelect, { Option } from '@/v2/components/select/singleSelect';
2828
import DUBreadcrumbNav from '@/v2/components/duBreadcrumbNav/duBreadcrumbNav';
2929
import { showDataFetchError, showInfoNotification } from '@/utils/common';
3030
import { AxiosGetHelper, cancelRequests } from '@/utils/axiosRequestHelper';
3131

32-
import { DUResponse } from '@/v2/types/diskUsage.types';
32+
import { NUResponse } from '@/v2/types/namespaceUsage.types';
3333

34-
import './diskUsage.less';
34+
import './namespaceUsage.less';
3535

3636
const LIMIT_OPTIONS: Option[] = [
3737
{ label: '5', value: '5' },
@@ -41,10 +41,10 @@ const LIMIT_OPTIONS: Option[] = [
4141
{ label: '30', value: '30' }
4242
]
4343

44-
const DiskUsage: React.FC<{}> = () => {
44+
const NamespaceUsage: React.FC<{}> = () => {
4545
const [loading, setLoading] = useState<boolean>(false);
4646
const [limit, setLimit] = useState<Option>(LIMIT_OPTIONS[1]);
47-
const [duResponse, setDUResponse] = useState<DUResponse>({
47+
const [duResponse, setDUResponse] = useState<NUResponse>({
4848
status: '',
4949
path: '/',
5050
subPathCount: 0,
@@ -66,7 +66,7 @@ const DiskUsage: React.FC<{}> = () => {
6666
cancelPieSignal.current = controller;
6767

6868
request.then(response => {
69-
const duResponse: DUResponse = response.data;
69+
const duResponse: NUResponse = response.data;
7070
console.log(duResponse);
7171
const status = duResponse.status;
7272
if (status === 'PATH_NOT_FOUND') {
@@ -141,20 +141,20 @@ const DiskUsage: React.FC<{}> = () => {
141141
onChange={handleLimitChange} />
142142
</div>
143143
<div className='du-content'>
144-
<DUPieChart
144+
<NUPieChart
145145
loading={loading}
146146
limit={Number.parseInt(limit.value)}
147-
path={duResponse.path ?? '/'}
147+
path={duResponse.path}
148148
subPathCount={duResponse.subPathCount}
149149
subPaths={duResponse.subPaths}
150150
sizeWithReplica={duResponse.sizeWithReplica}
151151
size={duResponse.size} />
152-
<DUMetadata path={duResponse.path} />
152+
<NUMetadata path={duResponse.path} />
153153
</div>
154154
</div>
155155
</div>
156156
</>
157157
);
158158
}
159159

160-
export default DiskUsage;
160+
export default NamespaceUsage;

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/routes-v2.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Volumes = lazy(() => import('@/v2/pages/volumes/volumes'))
2222
const Buckets = lazy(() => import('@/v2/pages/buckets/buckets'));
2323
const Datanodes = lazy(() => import('@/v2/pages/datanodes/datanodes'));
2424
const Pipelines = lazy(() => import('@/v2/pages/pipelines/pipelines'));
25-
const DiskUsage = lazy(() => import('@/v2/pages/diskUsage/diskUsage'));
25+
const NamespaceUsage = lazy(() => import('@/v2/pages/namespaceUsage/namespaceUsage'));
2626
const Containers = lazy(() => import('@/v2/pages/containers/containers'));
2727
const Insights = lazy(() => import('@/v2/pages/insights/insights'));
2828
const OMDBInsights = lazy(() => import('@/v2/pages/insights/omInsights'));
@@ -52,7 +52,7 @@ export const routesV2 = [
5252
},
5353
{
5454
path: '/NamespaceUsage',
55-
component: DiskUsage
55+
component: NamespaceUsage
5656
},
5757
{
5858
path: '/Containers',

hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/types/diskUsage.types.ts renamed to hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/types/namespaceUsage.types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
* limitations under the License.
1717
*/
1818

19-
export type DUSubpath = {
19+
export type NUSubpath = {
2020
path: string;
2121
size: number;
2222
sizeWithReplica: number;
2323
isKey: boolean;
2424
}
2525

26-
export type DUResponse = {
26+
export type NUResponse = {
2727
status: string;
2828
path: string;
2929
subPathCount: number;
3030
size: number;
3131
sizeWithReplica: number;
32-
subPaths: DUSubpath[];
32+
subPaths: NUSubpath[];
3333
sizeDirectKey: number;
3434
}
3535

0 commit comments

Comments
 (0)