@@ -10,6 +10,10 @@ import {ResponseError} from '../../components/Errors/ResponseError';
1010import { FullNodeViewer } from '../../components/FullNodeViewer/FullNodeViewer' ;
1111import { Loader } from '../../components/Loader' ;
1212import routes , { createHref , parseQuery } from '../../routes' ;
13+ import {
14+ useCapabilitiesLoaded ,
15+ useDiskPagesAvailable ,
16+ } from '../../store/reducers/capabilities/hooks' ;
1317import { setHeaderBreadcrumbs } from '../../store/reducers/header/header' ;
1418import { nodeApi } from '../../store/reducers/node/node' ;
1519import type { AdditionalNodesProps } from '../../types/additionalProps' ;
@@ -18,7 +22,8 @@ import {useAutoRefreshInterval, useTypedDispatch} from '../../utils/hooks';
1822import { StorageWrapper } from '../Storage/StorageWrapper' ;
1923import { Tablets } from '../Tablets' ;
2024
21- import { NODE_PAGES , OVERVIEW , STORAGE , TABLETS } from './NodePages' ;
25+ import { NODE_PAGES , OVERVIEW , STORAGE , STRUCTURE , TABLETS } from './NodePages' ;
26+ import NodeStructure from './NodeStructure/NodeStructure' ;
2227
2328import './Node.scss' ;
2429
@@ -50,11 +55,16 @@ export function Node(props: NodeProps) {
5055 ) ;
5156 const loading = isFetching && currentData === undefined ;
5257 const node = currentData ;
58+ const capabilitiesLoaded = useCapabilitiesLoaded ( ) ;
59+ const isDiskPagesAvailable = useDiskPagesAvailable ( ) ;
5360
5461 const { activeTabVerified, nodeTabs} = React . useMemo ( ( ) => {
5562 const hasStorage = node ?. Roles ?. find ( ( el ) => el === STORAGE_ROLE ) ;
5663
57- const nodePages = hasStorage ? NODE_PAGES : NODE_PAGES . filter ( ( el ) => el . id !== STORAGE ) ;
64+ let nodePages = hasStorage ? NODE_PAGES : NODE_PAGES . filter ( ( el ) => el . id !== STORAGE ) ;
65+ if ( isDiskPagesAvailable ) {
66+ nodePages = nodePages . filter ( ( el ) => el . id !== STRUCTURE ) ;
67+ }
5868
5969 const actualNodeTabs = nodePages . map ( ( page ) => {
6070 return {
@@ -69,7 +79,7 @@ export function Node(props: NodeProps) {
6979 }
7080
7181 return { activeTabVerified : actualActiveTab , nodeTabs : actualNodeTabs } ;
72- } , [ activeTab , node ] ) ;
82+ } , [ activeTab , node , isDiskPagesAvailable ] ) ;
7383
7484 const tenantName = node ?. Tenants ?. [ 0 ] || tenantNameFromQuery ?. toString ( ) ;
7585
@@ -131,6 +141,9 @@ export function Node(props: NodeProps) {
131141 ) ;
132142 }
133143
144+ case STRUCTURE : {
145+ return < NodeStructure className = { b ( 'node-page-wrapper' ) } nodeId = { nodeId } /> ;
146+ }
134147 case OVERVIEW : {
135148 return < FullNodeViewer node = { node } className = { b ( 'overview-wrapper' ) } /> ;
136149 }
@@ -140,7 +153,7 @@ export function Node(props: NodeProps) {
140153 }
141154 } ;
142155
143- if ( loading ) {
156+ if ( loading || ! capabilitiesLoaded ) {
144157 return < Loader size = "l" /> ;
145158 }
146159
0 commit comments