From 3ef9adb5aa8709ca054de908ddd5f0f59a363bbf Mon Sep 17 00:00:00 2001 From: mufazalov Date: Mon, 12 Aug 2024 13:40:53 +0300 Subject: [PATCH] fix: remove tablets from some api handlers --- src/containers/Nodes/getNodes.ts | 3 ++- .../TenantOverview/TenantMemory/TopNodesByMemory.tsx | 2 +- src/services/api.ts | 8 ++++---- src/store/reducers/nodes/nodes.ts | 1 + src/store/reducers/storage/storage.ts | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/containers/Nodes/getNodes.ts b/src/containers/Nodes/getNodes.ts index e3b0e4101..832d37d76 100644 --- a/src/containers/Nodes/getNodes.ts +++ b/src/containers/Nodes/getNodes.ts @@ -8,12 +8,13 @@ const getConcurrentId = (limit?: number, offset?: number) => { export const getNodes = async ({ type = 'any', storage = false, + tablets = true, limit, offset, ...params }: NodesApiRequestParams) => { const response = await window.api.getNodes( - {type, storage, limit, offset, ...params}, + {type, storage, tablets, limit, offset, ...params}, {concurrentId: getConcurrentId(limit, offset)}, ); const preparedResponse = prepareNodesData(response); diff --git a/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.tsx b/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.tsx index a452db0c5..270a9087d 100644 --- a/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.tsx +++ b/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.tsx @@ -25,7 +25,7 @@ export function TopNodesByMemory({tenantName, additionalNodesProps}: TopNodesByM }); const {currentData, isFetching, error} = topNodesApi.useGetTopNodesQuery( - {tenant: tenantName, sortValue: 'Memory'}, + {tenant: tenantName, sortValue: 'Memory', tablets: true}, {pollingInterval: autoRefreshInterval}, ); diff --git a/src/services/api.ts b/src/services/api.ts index 48e94f409..664788027 100644 --- a/src/services/api.ts +++ b/src/services/api.ts @@ -121,8 +121,8 @@ export class YdbEmbeddedAPI extends AxiosWrapper { return this.get( this.getPath('/viewer/json/tenantinfo'), { - tablets: 0, - storage: 1, + tablets: false, + storage: true, cluster_name: clusterName, }, {concurrentId, requestConfig: {signal}}, @@ -137,7 +137,7 @@ export class YdbEmbeddedAPI extends AxiosWrapper { { database, path, - tablets: true, + tablets: false, storage: true, }, {concurrentId, requestConfig: {signal}}, @@ -147,7 +147,7 @@ export class YdbEmbeddedAPI extends AxiosWrapper { { visibleEntities, type = 'any', - tablets = true, + tablets = false, sortOrder, sortValue, ...params diff --git a/src/store/reducers/nodes/nodes.ts b/src/store/reducers/nodes/nodes.ts index 7918454c6..1b938ed99 100644 --- a/src/store/reducers/nodes/nodes.ts +++ b/src/store/reducers/nodes/nodes.ts @@ -13,6 +13,7 @@ export const nodesApi = api.injectEndpoints({ { type: 'any', storage: false, + tablets: true, ...params, }, {signal}, diff --git a/src/store/reducers/storage/storage.ts b/src/store/reducers/storage/storage.ts index 9514bfbd0..b8cb34d4b 100644 --- a/src/store/reducers/storage/storage.ts +++ b/src/store/reducers/storage/storage.ts @@ -11,7 +11,7 @@ export const storageApi = api.injectEndpoints({ queryFn: async (params: Omit, {signal}) => { try { const result = await window.api.getNodes( - {storage: true, type: 'static', tablets: false, ...params}, + {storage: true, type: 'static', ...params}, {signal}, ); return {data: prepareStorageNodesResponse(result)};