Skip to content

Commit 10d58ba

Browse files
fix: use Storage on all pages
1 parent cda056c commit 10d58ba

File tree

12 files changed

+50
-335
lines changed

12 files changed

+50
-335
lines changed

src/containers/PDiskPage/PDiskGroups/PDiskGroups.tsx

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/containers/PDiskPage/PDiskGroups/utils.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/containers/PDiskPage/PDiskPage.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import {valueIsDefined} from '../../utils';
2424
import {cn} from '../../utils/cn';
2525
import {getPDiskId, getSeverityColor} from '../../utils/disks/helpers';
2626
import {useAutoRefreshInterval, useTypedDispatch, useTypedSelector} from '../../utils/hooks';
27+
import {Storage} from '../Storage/Storage';
2728

2829
import {DecommissionButton} from './DecommissionButton/DecommissionButton';
2930
import {DecommissionLabel} from './DecommissionLabel/DecommissionLabel';
30-
import {PDiskGroups} from './PDiskGroups/PDiskGroups';
3131
import {PDiskSpaceDistribution} from './PDiskSpaceDistribution/PDiskSpaceDistribution';
3232
import {pDiskPageKeyset} from './i18n';
3333

@@ -37,7 +37,7 @@ const pdiskPageCn = cn('ydb-pdisk-page');
3737

3838
const PDISK_TABS_IDS = {
3939
diskDistribution: 'diskDistribution',
40-
groups: 'groups',
40+
storage: 'storage',
4141
} as const;
4242

4343
const PDISK_PAGE_TABS = [
@@ -48,9 +48,9 @@ const PDISK_PAGE_TABS = [
4848
},
4949
},
5050
{
51-
id: PDISK_TABS_IDS.groups,
51+
id: PDISK_TABS_IDS.storage,
5252
get title() {
53-
return pDiskPageKeyset('groups');
53+
return pDiskPageKeyset('storage');
5454
},
5555
},
5656
];
@@ -237,10 +237,8 @@ export function PDiskPage() {
237237
</div>
238238
) : null;
239239
}
240-
case 'groups': {
241-
return pDiskParamsDefined ? (
242-
<PDiskGroups nodeId={nodeId} pDiskId={pDiskId} />
243-
) : null;
240+
case 'storage': {
241+
return pDiskParamsDefined ? <Storage nodeId={nodeId} pDiskId={pDiskId} /> : null;
244242
}
245243
default:
246244
return null;

src/containers/PDiskPage/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"pdisk": "PDisk",
44
"node": "Node",
55

6-
"groups": "Groups",
6+
"storage": "Storage",
77
"disk-distribution": "Disk distribution",
88

99
"empty-slot": "Empty slot",

src/containers/Storage/Storage.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ const UsageFilterParam = withDefault(
6060
interface StorageProps {
6161
database?: string;
6262
nodeId?: string | number;
63+
groupId?: string | number;
64+
pDiskId?: string | number;
6365
}
6466

65-
export const Storage = ({database, nodeId}: StorageProps) => {
67+
export const Storage = ({database, nodeId, groupId, pDiskId}: StorageProps) => {
6668
const {balancer} = useClusterBaseInfo();
6769
const additionalNodesProps = useAdditionalNodeProps({balancer});
6870

@@ -115,14 +117,21 @@ export const Storage = ({database, nodeId}: StorageProps) => {
115117
} = useStorageGroupsSelectedColumns(visibleEntities);
116118

117119
const nodesQuery = storageApi.useGetStorageNodesInfoQuery(
118-
{database, with: visibleEntities, node_id: nodeId},
120+
{database, with: visibleEntities, node_id: nodeId, group_id: groupId},
119121
{
120122
skip: !isNodes,
121123
pollingInterval: autoRefreshInterval,
122124
},
123125
);
124126
const groupsQuery = storageApi.useGetStorageGroupsInfoQuery(
125-
{database, with: visibleEntities, nodeId, shouldUseGroupsHandler: groupsHandlerAvailable},
127+
{
128+
database,
129+
with: visibleEntities,
130+
nodeId,
131+
groupId,
132+
pDiskId,
133+
shouldUseGroupsHandler: groupsHandlerAvailable,
134+
},
126135
{
127136
skip: !isGroups || !capabilitiesLoaded,
128137
pollingInterval: autoRefreshInterval,

src/containers/StorageGroupPage/StorageGroupPage.scss

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
&__meta,
1212
&__title,
1313
&__info,
14-
&__tabs {
14+
&__storage-title {
1515
position: sticky;
1616
left: 0;
1717

@@ -26,15 +26,12 @@
2626
margin-bottom: 60px;
2727
}
2828

29-
&__tabs {
29+
&__storage-title {
3030
margin-bottom: 0;
31+
@include header-1-typography();
3132
}
3233

3334
&__info {
3435
margin-top: var(--g-spacing-10);
3536
}
36-
37-
&__tabs {
38-
@include tabs-wrapper-styles();
39-
}
4037
}

0 commit comments

Comments
 (0)