File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
containers/Tenant/Diagnostics Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,8 @@ import {
1010 useFeatureFlagsAvailable ,
1111 useTopicDataAvailable ,
1212} from '../../../store/reducers/capabilities/hooks' ;
13- import { useClusterBaseInfo } from '../../../store/reducers/cluster/cluster' ;
1413import { TENANT_DIAGNOSTICS_TABS_IDS } from '../../../store/reducers/tenant/constants' ;
15- import { setDiagnosticsTab } from '../../../store/reducers/tenant/tenant' ;
14+ import { setDiagnosticsTab , useTenantBaseInfo } from '../../../store/reducers/tenant/tenant' ;
1615import type { AdditionalNodesProps , AdditionalTenantsProps } from '../../../types/additionalProps' ;
1716import { uiFactory } from '../../../uiFactory/uiFactory' ;
1817import { cn } from '../../../utils/cn' ;
@@ -51,7 +50,7 @@ const b = cn('kv-tenant-diagnostics');
5150
5251function Diagnostics ( props : DiagnosticsProps ) {
5352 const { path, database, type, subType} = useCurrentSchema ( ) ;
54- const { control_plane : controlPlane } = useClusterBaseInfo ( ) ;
53+ const { controlPlane} = useTenantBaseInfo ( path ) ;
5554 const containerRef = React . useRef < HTMLDivElement > ( null ) ;
5655 const dispatch = useTypedDispatch ( ) ;
5756 const { diagnosticsTab = TENANT_DIAGNOSTICS_TABS_IDS . overview } = useTypedSelector (
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import type {PayloadAction} from '@reduxjs/toolkit';
44import { DEFAULT_USER_SETTINGS , settingsManager } from '../../../services/settings' ;
55import type { TTenantInfo } from '../../../types/api/tenant' ;
66import { TENANT_INITIAL_PAGE_KEY } from '../../../utils/constants' ;
7+ import { useClusterNameFromQuery } from '../../../utils/hooks/useDatabaseFromQuery' ;
78import { api } from '../api' ;
89
910import { TENANT_DIAGNOSTICS_TABS_IDS , TENANT_METRICS_TABS_IDS } from './constants' ;
@@ -100,3 +101,18 @@ export const tenantApi = api.injectEndpoints({
100101 } ) ,
101102 overrideExisting : 'throw' ,
102103} ) ;
104+
105+ export function useTenantBaseInfo ( path : string ) {
106+ const clusterNameFromQuery = useClusterNameFromQuery ( ) ;
107+
108+ const { currentData} = tenantApi . useGetTenantInfoQuery ( {
109+ path,
110+ clusterName : clusterNameFromQuery ,
111+ } ) ;
112+
113+ const { ControlPlane} = currentData || { } ;
114+
115+ return {
116+ controlPlane : ControlPlane ,
117+ } ;
118+ }
You can’t perform that action at this time.
0 commit comments