@@ -11,7 +11,11 @@ import {cn} from '../../../utils/cn';
11
11
import { USE_CLUSTER_BALANCER_AS_BACKEND_KEY } from '../../../utils/constants' ;
12
12
import { useSetting } from '../../../utils/hooks' ;
13
13
import { 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' ;
15
19
import { getCleanBalancerValue , removeViewerPathname } from '../../../utils/parseBalancer' ;
16
20
import { getBackendFromNodeHost , getBackendFromRawNodeData } from '../../../utils/prepareBackend' ;
17
21
import type { Cluster } from '../../Cluster/Cluster' ;
@@ -63,6 +67,7 @@ const getAdditionalTenantsProps = (
63
67
balancer : string | undefined ,
64
68
useClusterBalancerAsBackend : boolean | undefined ,
65
69
getMonitoringLink ?: GetMonitoringLink ,
70
+ getLogsLink ?: GetLogsLink ,
66
71
) => {
67
72
const additionalTenantsProps : AdditionalTenantsProps = { } ;
68
73
@@ -99,18 +104,33 @@ const getAdditionalTenantsProps = (
99
104
} ;
100
105
}
101
106
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
+
102
120
return additionalTenantsProps ;
103
121
} ;
104
122
105
123
interface ExtendedClusterProps {
106
124
component : typeof Cluster ;
107
125
getMonitoringLink ?: GetMonitoringLink ;
108
126
getMonitoringClusterLink ?: GetMonitoringClusterLink ;
127
+ getLogsLink ?: GetLogsLink ;
109
128
}
110
129
export function ExtendedCluster ( {
111
130
component : ClusterComponent ,
112
131
getMonitoringLink,
113
132
getMonitoringClusterLink,
133
+ getLogsLink,
114
134
} : ExtendedClusterProps ) {
115
135
const additionalNodesProps = useAdditionalNodesProps ( ) ;
116
136
const { name, balancer, monitoring} = useClusterBaseInfo ( ) ;
@@ -132,6 +152,7 @@ export function ExtendedCluster({
132
152
balancer ,
133
153
useClusterBalancerAsBackend ,
134
154
getMonitoringLink ,
155
+ getLogsLink ,
135
156
) }
136
157
additionalNodesProps = { additionalNodesProps }
137
158
/>
0 commit comments