import {TENANT_DIAGNOSTICS_TABS_IDS} from '../../../store/reducers/tenant/constants'; import type {TenantDiagnosticsTab} from '../../../store/reducers/tenant/types'; import type {AdditionalTenantsProps} from '../../../types/additionalProps'; import type {EPathSubType, EPathType} from '../../../types/api/schema'; import {uiFactory} from '../../../uiFactory/uiFactory'; import {Configs} from '../../Configs/Configs'; import {Heatmap} from '../../Heatmap/Heatmap'; import {Nodes} from '../../Nodes/Nodes'; import {Operations} from '../../Operations/Operations'; import {PaginatedStorage} from '../../Storage/PaginatedStorage'; import {Tablets} from '../../Tablets/Tablets'; import {SchemaViewer} from '../Schema/SchemaViewer/SchemaViewer'; import {AccessRights} from './AccessRights/AccessRights'; import {Consumers} from './Consumers/Consumers'; import Describe from './Describe/Describe'; import DetailedOverview from './DetailedOverview/DetailedOverview'; import {HotKeys} from './HotKeys/HotKeys'; import {NetworkWrapper} from './Network/NetworkWrapper'; import {Partitions} from './Partitions/Partitions'; import {StorageUsage} from './StorageUsage/StorageUsage'; import {StreamingQueryGraph} from './StreamingQueryGraph'; import {TenantOverview} from './TenantOverview/TenantOverview'; import {TopQueries} from './TopQueries/TopQueries'; import {TopShards} from './TopShards/TopShards'; import {TopicData} from './TopicData/TopicData'; import i18n from './i18n'; import {b} from './shared'; interface DiagnosticsTabContentOptions { activeTabId: TenantDiagnosticsTab; type?: EPathType; subType?: EPathSubType; database: string; path: string; databaseFullPath: string; additionalTenantProps?: AdditionalTenantsProps; scrollContainerRef: React.RefObject; } type DiagnosticsTabRenderer = ( options: Omit, ) => React.ReactNode; const diagnosticsTabRenderers: Record = { [TENANT_DIAGNOSTICS_TABS_IDS.database]: ({ database, databaseFullPath, additionalTenantProps, }) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.overview]: ({ type, database, path, databaseFullPath, additionalTenantProps, }) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.schema]: ({path, database, databaseFullPath, type}) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.topQueries]: ({database}) => , [TENANT_DIAGNOSTICS_TABS_IDS.topShards]: ({database, path, databaseFullPath}) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.nodes]: ({ path, databaseFullPath, database, scrollContainerRef, }) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.access]: () => , [TENANT_DIAGNOSTICS_TABS_IDS.tablets]: ({ scrollContainerRef, path, databaseFullPath, database, }) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.storageUsage]: ({path, database, databaseFullPath}) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.storage]: ({database, scrollContainerRef}) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.network]: ({ path, databaseFullPath, database, scrollContainerRef, }) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.describe]: ({ path, databaseFullPath, database, scrollContainerRef, }) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.hotKeys]: ({path, databaseFullPath, database}) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.graph]: ({path, databaseFullPath, database}) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.consumers]: ({path, databaseFullPath, database, type}) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.partitions]: ({path, databaseFullPath, database}) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.topicData]: ({ path, databaseFullPath, database, scrollContainerRef, }) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.configs]: ({database, scrollContainerRef}) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.operations]: ({database, scrollContainerRef}) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.backups]: ({database, scrollContainerRef}) => uiFactory.renderBackups?.({ database, scrollContainerRef, }), [TENANT_DIAGNOSTICS_TABS_IDS.computationGraph]: ({database, path}) => ( ), [TENANT_DIAGNOSTICS_TABS_IDS.monitoring]: ({database, databaseFullPath}) => { const content = uiFactory.renderMonitoring?.({database, databaseFullPath}); return content === null || content === undefined ? ( content ) : (
{content}
); }, }; export function renderDiagnosticsTabContent({ activeTabId, ...options }: DiagnosticsTabContentOptions) { const renderTabContent = diagnosticsTabRenderers[activeTabId]; return renderTabContent?.(options) ??
{i18n('no-data')}
; }