@@ -38,12 +38,19 @@ const getAdditionalBalancerInfo = (balancer: string) => {
3838 } ;
3939} ;
4040
41- const getAdditionalClusterProps = (
42- clusterName : string | undefined ,
43- monitoring : string | undefined ,
44- balancer : string | undefined ,
45- getMonitoringClusterLink ?: GetMonitoringClusterLink ,
46- ) => {
41+ interface GetAdditionalClusterProps {
42+ clusterName : string | undefined ;
43+ monitoring : string | undefined ;
44+ balancer : string | undefined ;
45+ getMonitoringClusterLink ?: GetMonitoringClusterLink ;
46+ }
47+
48+ const getAdditionalClusterProps = ( {
49+ clusterName,
50+ monitoring,
51+ balancer,
52+ getMonitoringClusterLink,
53+ } : GetAdditionalClusterProps ) => {
4754 const additionalClusterProps : AdditionalClusterProps = { } ;
4855
4956 if ( monitoring && getMonitoringClusterLink ) {
@@ -61,14 +68,25 @@ const getAdditionalClusterProps = (
6168 return additionalClusterProps ;
6269} ;
6370
64- const getAdditionalTenantsProps = (
65- clusterName : string | undefined ,
66- monitoring : string | undefined ,
67- balancer : string | undefined ,
68- useClusterBalancerAsBackend : boolean | undefined ,
69- getMonitoringLink ?: GetMonitoringLink ,
70- getLogsLink ?: GetLogsLink ,
71- ) => {
71+ interface GetAdditionalTenantsProps {
72+ clusterName : string | undefined ;
73+ monitoring : string | undefined ;
74+ balancer : string | undefined ;
75+ logging : string | undefined ;
76+ useClusterBalancerAsBackend : boolean | undefined ;
77+ getMonitoringLink ?: GetMonitoringLink ;
78+ getLogsLink ?: GetLogsLink ;
79+ }
80+
81+ const getAdditionalTenantsProps = ( {
82+ clusterName,
83+ monitoring,
84+ balancer,
85+ logging,
86+ useClusterBalancerAsBackend,
87+ getMonitoringLink,
88+ getLogsLink,
89+ } : GetAdditionalTenantsProps ) => {
7290 const additionalTenantsProps : AdditionalTenantsProps = { } ;
7391
7492 additionalTenantsProps . prepareTenantBackend = (
@@ -104,12 +122,12 @@ const getAdditionalTenantsProps = (
104122 } ;
105123 }
106124
107- if ( clusterName && getLogsLink ) {
125+ if ( logging && getLogsLink ) {
108126 additionalTenantsProps . getLogsLink = ( dbName ?: string ) => {
109127 if ( dbName ) {
110128 return getLogsLink ( {
111129 dbName,
112- clusterName ,
130+ logging ,
113131 } ) ;
114132 }
115133
@@ -133,27 +151,28 @@ export function ExtendedCluster({
133151 getLogsLink,
134152} : ExtendedClusterProps ) {
135153 const additionalNodesProps = useAdditionalNodesProps ( ) ;
136- const { name, balancer, monitoring} = useClusterBaseInfo ( ) ;
154+ const { name, balancer, monitoring, logging } = useClusterBaseInfo ( ) ;
137155
138156 const [ useClusterBalancerAsBackend ] = useSetting < boolean > ( USE_CLUSTER_BALANCER_AS_BACKEND_KEY ) ;
139157
140158 return (
141159 < div className = { b ( ) } >
142160 < ClusterComponent
143- additionalClusterProps = { getAdditionalClusterProps (
144- name ,
161+ additionalClusterProps = { getAdditionalClusterProps ( {
162+ clusterName : name ,
145163 monitoring,
146164 balancer,
147165 getMonitoringClusterLink,
148- ) }
149- additionalTenantsProps = { getAdditionalTenantsProps (
150- name ,
166+ } ) }
167+ additionalTenantsProps = { getAdditionalTenantsProps ( {
168+ clusterName : name ,
151169 monitoring,
152170 balancer,
171+ logging,
153172 useClusterBalancerAsBackend,
154173 getMonitoringLink,
155174 getLogsLink,
156- ) }
175+ } ) }
157176 additionalNodesProps = { additionalNodesProps }
158177 />
159178 </ div >
0 commit comments