@@ -11,7 +11,11 @@ import {cn} from '../../../utils/cn';
1111import { USE_CLUSTER_BALANCER_AS_BACKEND_KEY } from '../../../utils/constants' ;
1212import { useSetting } from '../../../utils/hooks' ;
1313import { useAdditionalNodesProps } from '../../../utils/hooks/useAdditionalNodesProps' ;
14- import type { GetMonitoringClusterLink , GetMonitoringLink } from '../../../utils/monitoring' ;
14+ import type {
15+ GetLogsLink ,
16+ GetMonitoringClusterLink ,
17+ GetMonitoringLink ,
18+ } from '../../../utils/monitoring' ;
1519import { getCleanBalancerValue , removeViewerPathname } from '../../../utils/parseBalancer' ;
1620import { getBackendFromNodeHost , getBackendFromRawNodeData } from '../../../utils/prepareBackend' ;
1721import type { Cluster } from '../../Cluster/Cluster' ;
@@ -63,6 +67,7 @@ const getAdditionalTenantsProps = (
6367 balancer : string | undefined ,
6468 useClusterBalancerAsBackend : boolean | undefined ,
6569 getMonitoringLink ?: GetMonitoringLink ,
70+ getLogsLink ?: GetLogsLink ,
6671) => {
6772 const additionalTenantsProps : AdditionalTenantsProps = { } ;
6873
@@ -99,18 +104,34 @@ const getAdditionalTenantsProps = (
99104 } ;
100105 }
101106
107+ if ( monitoring && getLogsLink ) {
108+ additionalTenantsProps . getLogsLink = ( dbName ?: string ) => {
109+ if ( dbName ) {
110+ return getLogsLink ( {
111+ dbName,
112+ clusterName,
113+ monitoring,
114+ } ) ;
115+ }
116+
117+ return null ;
118+ } ;
119+ }
120+
102121 return additionalTenantsProps ;
103122} ;
104123
105124interface ExtendedClusterProps {
106125 component : typeof Cluster ;
107126 getMonitoringLink ?: GetMonitoringLink ;
108127 getMonitoringClusterLink ?: GetMonitoringClusterLink ;
128+ getLogsLink ?: GetLogsLink ;
109129}
110130export function ExtendedCluster ( {
111131 component : ClusterComponent ,
112132 getMonitoringLink,
113133 getMonitoringClusterLink,
134+ getLogsLink,
114135} : ExtendedClusterProps ) {
115136 const additionalNodesProps = useAdditionalNodesProps ( ) ;
116137 const { name, balancer, monitoring} = useClusterBaseInfo ( ) ;
@@ -132,6 +153,7 @@ export function ExtendedCluster({
132153 balancer ,
133154 useClusterBalancerAsBackend ,
134155 getMonitoringLink ,
156+ getLogsLink ,
135157 ) }
136158 additionalNodesProps = { additionalNodesProps }
137159 />
0 commit comments