@@ -38,12 +38,19 @@ const getAdditionalBalancerInfo = (balancer: string) => {
38
38
} ;
39
39
} ;
40
40
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 ) => {
47
54
const additionalClusterProps : AdditionalClusterProps = { } ;
48
55
49
56
if ( monitoring && getMonitoringClusterLink ) {
@@ -61,14 +68,25 @@ const getAdditionalClusterProps = (
61
68
return additionalClusterProps ;
62
69
} ;
63
70
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 ) => {
72
90
const additionalTenantsProps : AdditionalTenantsProps = { } ;
73
91
74
92
additionalTenantsProps . prepareTenantBackend = (
@@ -104,12 +122,12 @@ const getAdditionalTenantsProps = (
104
122
} ;
105
123
}
106
124
107
- if ( clusterName && getLogsLink ) {
125
+ if ( logging && getLogsLink ) {
108
126
additionalTenantsProps . getLogsLink = ( dbName ?: string ) => {
109
127
if ( dbName ) {
110
128
return getLogsLink ( {
111
129
dbName,
112
- clusterName ,
130
+ logging ,
113
131
} ) ;
114
132
}
115
133
@@ -133,27 +151,28 @@ export function ExtendedCluster({
133
151
getLogsLink,
134
152
} : ExtendedClusterProps ) {
135
153
const additionalNodesProps = useAdditionalNodesProps ( ) ;
136
- const { name, balancer, monitoring} = useClusterBaseInfo ( ) ;
154
+ const { name, balancer, monitoring, logging } = useClusterBaseInfo ( ) ;
137
155
138
156
const [ useClusterBalancerAsBackend ] = useSetting < boolean > ( USE_CLUSTER_BALANCER_AS_BACKEND_KEY ) ;
139
157
140
158
return (
141
159
< div className = { b ( ) } >
142
160
< ClusterComponent
143
- additionalClusterProps = { getAdditionalClusterProps (
144
- name ,
161
+ additionalClusterProps = { getAdditionalClusterProps ( {
162
+ clusterName : name ,
145
163
monitoring,
146
164
balancer,
147
165
getMonitoringClusterLink,
148
- ) }
149
- additionalTenantsProps = { getAdditionalTenantsProps (
150
- name ,
166
+ } ) }
167
+ additionalTenantsProps = { getAdditionalTenantsProps ( {
168
+ clusterName : name ,
151
169
monitoring,
152
170
balancer,
171
+ logging,
153
172
useClusterBalancerAsBackend,
154
173
getMonitoringLink,
155
174
getLogsLink,
156
- ) }
175
+ } ) }
157
176
additionalNodesProps = { additionalNodesProps }
158
177
/>
159
178
</ div >
0 commit comments