@@ -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,33 @@ const getAdditionalTenantsProps = (
99104 } ;
100105 }
101106
107+ if ( clusterName && getLogsLink ) {
108+ additionalTenantsProps . getLogsLink = ( dbName ?: string ) => {
109+ if ( dbName ) {
110+ return getLogsLink ( {
111+ dbName,
112+ clusterName,
113+ } ) ;
114+ }
115+
116+ return null ;
117+ } ;
118+ }
119+
102120 return additionalTenantsProps ;
103121} ;
104122
105123interface ExtendedClusterProps {
106124 component : typeof Cluster ;
107125 getMonitoringLink ?: GetMonitoringLink ;
108126 getMonitoringClusterLink ?: GetMonitoringClusterLink ;
127+ getLogsLink ?: GetLogsLink ;
109128}
110129export function ExtendedCluster ( {
111130 component : ClusterComponent ,
112131 getMonitoringLink,
113132 getMonitoringClusterLink,
133+ getLogsLink,
114134} : ExtendedClusterProps ) {
115135 const additionalNodesProps = useAdditionalNodesProps ( ) ;
116136 const { name, balancer, monitoring} = useClusterBaseInfo ( ) ;
@@ -132,6 +152,7 @@ export function ExtendedCluster({
132152 balancer ,
133153 useClusterBalancerAsBackend ,
134154 getMonitoringLink ,
155+ getLogsLink ,
135156 ) }
136157 additionalNodesProps = { additionalNodesProps }
137158 />
0 commit comments