@@ -16,11 +16,9 @@ import {PageMetaWithAutorefresh} from '../../components/PageMeta/PageMeta';
1616import { getTabletPagePath } from '../../routes' ;
1717import { selectIsUserAllowedToMakeChanges } from '../../store/reducers/authentication/authentication' ;
1818import { setHeaderBreadcrumbs } from '../../store/reducers/header/header' ;
19- import { nodeApi } from '../../store/reducers/node/node' ;
2019import { tabletApi } from '../../store/reducers/tablet' ;
2120import { EFlag } from '../../types/api/enums' ;
2221import type { TTabletStateInfo } from '../../types/api/tablet' ;
23- import { EType } from '../../types/api/tablet' ;
2422import type { ITabletPreparedHistoryItem } from '../../types/store/tablet' ;
2523import { cn } from '../../utils/cn' ;
2624import { CLUSTER_DEFAULT_TITLE } from '../../utils/constants' ;
@@ -59,12 +57,9 @@ const TABLET_PAGE_TABS = [
5957] ;
6058
6159const tabletTabSchema = z . nativeEnum ( TABLET_TABS_IDS ) . catch ( TABLET_TABS_IDS . history ) ;
62- const eTypeSchema = z . nativeEnum ( EType ) . or ( z . undefined ( ) ) . catch ( undefined ) ;
6360
6461const tabletQueryParams = {
65- nodeId : StringParam ,
6662 tenantName : StringParam ,
67- type : StringParam ,
6863 clusterName : StringParam ,
6964 activeTab : StringParam ,
7065} ;
@@ -74,18 +69,12 @@ export function Tablet() {
7469
7570 const { id} = useParams < { id : string } > ( ) ;
7671
77- const [
78- {
79- nodeId : queryNodeId ,
80- tenantName : queryDatabase ,
81- type : queryTabletType ,
82- clusterName : queryClusterName ,
83- } ,
84- ] = useQueryParams ( tabletQueryParams ) ;
72+ const [ { tenantName : queryDatabase , clusterName : queryClusterName } ] =
73+ useQueryParams ( tabletQueryParams ) ;
8574
8675 const [ autoRefreshInterval ] = useAutoRefreshInterval ( ) ;
8776 const { currentData, isFetching, error} = tabletApi . useGetTabletQuery (
88- { id, database : queryDatabase ?? undefined , nodeId : queryNodeId ?? undefined } ,
77+ { id, database : queryDatabase ?? undefined } ,
8978 { pollingInterval : autoRefreshInterval } ,
9079 ) ;
9180
@@ -96,24 +85,19 @@ export function Tablet() {
9685 tablet . TenantId ? { tenantId : tablet . TenantId } : skipToken ,
9786 ) ;
9887
99- const nodeId = tablet . NodeId ?? queryNodeId ?? undefined ;
10088 const database = ( tenantPath || queryDatabase ) ?? undefined ;
10189
102- const nodeRole = useNodeRole ( nodeId ?. toString ( ) ) ;
103-
104- const tabletType = tablet . Type || eTypeSchema . parse ( queryTabletType ) ;
90+ const tabletType = tablet . Type ;
10591
10692 React . useEffect ( ( ) => {
10793 dispatch (
10894 setHeaderBreadcrumbs ( 'tablet' , {
109- nodeId,
110- nodeRole,
11195 tenantName : queryDatabase ?? undefined ,
11296 tabletId : id ,
11397 tabletType,
11498 } ) ,
11599 ) ;
116- } , [ dispatch , queryDatabase , id , nodeId , nodeRole , tabletType ] ) ;
100+ } , [ dispatch , queryDatabase , id , tabletType ] ) ;
117101
118102 const { Leader, Type} = tablet ;
119103 const metaItems : string [ ] = [ ] ;
@@ -246,17 +230,3 @@ function Channels({id, hiveId}: {id: string; hiveId: string}) {
246230 </ LoaderWrapper >
247231 ) ;
248232}
249-
250- function useNodeRole ( nodeId : string | undefined ) {
251- const { currentData : node } = nodeApi . useGetNodeInfoQuery ( nodeId ? { nodeId} : skipToken ) ;
252-
253- let nodeRole : 'Storage' | 'Compute' | undefined ;
254-
255- if ( node ) {
256- // Compute nodes have tenantName, storage nodes doesn't
257- const isStorage = ! node ?. Tenants ?. [ 0 ] ;
258- nodeRole = isStorage ? 'Storage' : 'Compute' ;
259- }
260-
261- return nodeRole ;
262- }
0 commit comments