@@ -16,11 +16,9 @@ import {PageMetaWithAutorefresh} from '../../components/PageMeta/PageMeta';
16
16
import { getTabletPagePath } from '../../routes' ;
17
17
import { selectIsUserAllowedToMakeChanges } from '../../store/reducers/authentication/authentication' ;
18
18
import { setHeaderBreadcrumbs } from '../../store/reducers/header/header' ;
19
- import { nodeApi } from '../../store/reducers/node/node' ;
20
19
import { tabletApi } from '../../store/reducers/tablet' ;
21
20
import { EFlag } from '../../types/api/enums' ;
22
21
import type { TTabletStateInfo } from '../../types/api/tablet' ;
23
- import { EType } from '../../types/api/tablet' ;
24
22
import type { ITabletPreparedHistoryItem } from '../../types/store/tablet' ;
25
23
import { cn } from '../../utils/cn' ;
26
24
import { CLUSTER_DEFAULT_TITLE } from '../../utils/constants' ;
@@ -59,12 +57,9 @@ const TABLET_PAGE_TABS = [
59
57
] ;
60
58
61
59
const tabletTabSchema = z . nativeEnum ( TABLET_TABS_IDS ) . catch ( TABLET_TABS_IDS . history ) ;
62
- const eTypeSchema = z . nativeEnum ( EType ) . or ( z . undefined ( ) ) . catch ( undefined ) ;
63
60
64
61
const tabletQueryParams = {
65
- nodeId : StringParam ,
66
62
tenantName : StringParam ,
67
- type : StringParam ,
68
63
clusterName : StringParam ,
69
64
activeTab : StringParam ,
70
65
} ;
@@ -74,18 +69,12 @@ export function Tablet() {
74
69
75
70
const { id} = useParams < { id : string } > ( ) ;
76
71
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 ) ;
85
74
86
75
const [ autoRefreshInterval ] = useAutoRefreshInterval ( ) ;
87
76
const { currentData, isFetching, error} = tabletApi . useGetTabletQuery (
88
- { id, database : queryDatabase ?? undefined , nodeId : queryNodeId ?? undefined } ,
77
+ { id, database : queryDatabase ?? undefined } ,
89
78
{ pollingInterval : autoRefreshInterval } ,
90
79
) ;
91
80
@@ -96,24 +85,19 @@ export function Tablet() {
96
85
tablet . TenantId ? { tenantId : tablet . TenantId } : skipToken ,
97
86
) ;
98
87
99
- const nodeId = tablet . NodeId ?? queryNodeId ?? undefined ;
100
88
const database = ( tenantPath || queryDatabase ) ?? undefined ;
101
89
102
- const nodeRole = useNodeRole ( nodeId ?. toString ( ) ) ;
103
-
104
- const tabletType = tablet . Type || eTypeSchema . parse ( queryTabletType ) ;
90
+ const tabletType = tablet . Type ;
105
91
106
92
React . useEffect ( ( ) => {
107
93
dispatch (
108
94
setHeaderBreadcrumbs ( 'tablet' , {
109
- nodeId,
110
- nodeRole,
111
95
tenantName : queryDatabase ?? undefined ,
112
96
tabletId : id ,
113
97
tabletType,
114
98
} ) ,
115
99
) ;
116
- } , [ dispatch , queryDatabase , id , nodeId , nodeRole , tabletType ] ) ;
100
+ } , [ dispatch , queryDatabase , id , tabletType ] ) ;
117
101
118
102
const { Leader, Type} = tablet ;
119
103
const metaItems : string [ ] = [ ] ;
@@ -246,17 +230,3 @@ function Channels({id, hiveId}: {id: string; hiveId: string}) {
246
230
</ LoaderWrapper >
247
231
) ;
248
232
}
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