Skip to content

Commit 07560ed

Browse files
authored
feat(Node): enable nodes switch in storage tab on node page (#1277)
1 parent 45c0a1e commit 07560ed

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

src/containers/Node/Node.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ import {useAutoRefreshInterval, useTypedDispatch} from '../../utils/hooks';
1818
import {StorageWrapper} from '../Storage/StorageWrapper';
1919
import {Tablets} from '../Tablets';
2020

21-
import {NODE_PAGES, OVERVIEW, STORAGE, STRUCTURE, TABLETS} from './NodePages';
22-
import NodeStructure from './NodeStructure/NodeStructure';
21+
import {NODE_PAGES, OVERVIEW, STORAGE, TABLETS} from './NodePages';
2322

2423
import './Node.scss';
2524

@@ -136,9 +135,6 @@ export function Node(props: NodeProps) {
136135
return <FullNodeViewer node={node} className={b('overview-wrapper')} />;
137136
}
138137

139-
case STRUCTURE: {
140-
return <NodeStructure className={b('node-page-wrapper')} nodeId={nodeId} />;
141-
}
142138
default:
143139
return false;
144140
}

src/containers/Node/NodePages.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ export const NODE_PAGES = [
1717
id: STORAGE,
1818
name: 'Storage',
1919
},
20-
{
21-
id: STRUCTURE,
22-
name: 'Structure',
23-
},
20+
// TODO: remove Node Structure component
21+
// {
22+
// id: STRUCTURE,
23+
// name: 'Structure',
24+
// },
2425
{
2526
id: TABLETS,
2627
name: 'Tablets',

src/containers/Storage/Storage.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const Storage = ({additionalNodesProps, database, nodeId}: StorageProps)
7272
uptimeFilter: StringParam,
7373
usageFilter: UsageFilterParam,
7474
});
75-
const type = storageTypeSchema.parse(queryParams.type);
75+
const storageType = storageTypeSchema.parse(queryParams.type);
7676
const visibleEntities = visibleEntitiesSchema.parse(queryParams.visible);
7777
const filter = queryParams.search ?? '';
7878
const uptimeFilter = nodesUptimeFilterValuesSchema.parse(queryParams.uptimeFilter);
@@ -90,12 +90,8 @@ export const Storage = ({additionalNodesProps, database, nodeId}: StorageProps)
9090
});
9191
const groupsSortParams = groupSort.sortOrder ? groupSort : getDefaultSortGroup(visibleEntities);
9292

93-
// Do not display Nodes table for Node page (NodeId present)
94-
const isNodePage = nodeId !== undefined;
95-
const storageType = isNodePage ? STORAGE_TYPES.groups : type;
96-
9793
const nodesQuery = storageApi.useGetStorageNodesInfoQuery(
98-
{database, visibleEntities},
94+
{database, visibleEntities, node_id: nodeId},
9995
{
10096
skip: storageType !== STORAGE_TYPES.nodes,
10197
pollingInterval: autoRefreshInterval,
@@ -198,7 +194,7 @@ export const Storage = ({additionalNodesProps, database, nodeId}: StorageProps)
198194
<StorageControls
199195
searchValue={filter}
200196
handleSearchValueChange={handleTextFilterChange}
201-
withTypeSelector={!isNodePage}
197+
withTypeSelector
202198
storageType={storageType}
203199
handleStorageTypeChange={handleStorageTypeChange}
204200
visibleEntities={visibleEntities}

src/services/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
224224
// TODO: remove after remove tenant param
225225
database: params.database || params.tenant,
226226
tenant: params.tenant || params.database,
227+
node_id: params.node_id,
227228
},
228229
{concurrentId, requestConfig: {signal}},
229230
);

0 commit comments

Comments
 (0)