@@ -49,42 +49,46 @@ const ConnectionPopover: React.FC<{
49
49
50
50
const databaseRemarkDescription = useMemo ( ( ) => {
51
51
return (
52
- < div style = { { display : 'flex' } } >
53
- < span style = { { whiteSpace : 'nowrap' } } className = { styles . label } >
52
+ < div className = { styles . describe } >
53
+ < span className = { styles . label } >
54
54
{ formatMessage ( {
55
55
id : 'src.component.ConnectionPopover.7A11191E' ,
56
56
defaultMessage : '备注:' ,
57
57
} ) }
58
58
</ span >
59
- < div style = { { width : '260px' , wordBreak : 'break-word' } } > { database ?. remark ?? '-' } </ div >
59
+ < div className = { styles . content } > { database ?. remark ?? '-' } </ div >
60
60
</ div >
61
61
) ;
62
62
} , [ database ] ) ;
63
63
64
64
const dataSourceDescription = useMemo ( ( ) => {
65
65
return (
66
- < div style = { { display : 'flex' } } >
66
+ < div className = { styles . describe } >
67
67
< span className = { styles . label } >
68
68
{ formatMessage ( {
69
69
id : 'src.component.ConnectionPopover.2A18AD55' ,
70
70
defaultMessage : '数据源:' ,
71
71
} ) }
72
72
</ span >
73
- < div > { connection ?. name || database ?. dataSource ?. name || '-' } </ div >
73
+ < div className = { styles . content } >
74
+ { connection ?. name || database ?. dataSource ?. name || '-' }
75
+ </ div >
74
76
</ div >
75
77
) ;
76
78
} , [ connection , database ] ) ;
77
79
78
80
const projectDescription = useMemo ( ( ) => {
79
81
return (
80
- < div style = { { display : 'flex' } } >
82
+ < div className = { styles . describe } >
81
83
< span className = { styles . label } >
82
84
{ formatMessage ( {
83
85
id : 'src.component.ConnectionPopover.16ED170C' ,
84
86
defaultMessage : '项目:' ,
85
87
} ) }
86
88
</ span >
87
- < div > { database ?. project ?. name || connection ?. projectName || '-' } </ div >
89
+ < div className = { styles . content } >
90
+ { database ?. project ?. name || connection ?. projectName || '-' }
91
+ </ div >
88
92
</ div >
89
93
) ;
90
94
} , [ database , connection ] ) ;
@@ -95,7 +99,7 @@ const ConnectionPopover: React.FC<{
95
99
onClick = { ( e ) => {
96
100
e . stopPropagation ( ) ;
97
101
} }
98
- style = { { lineHeight : '20px' } }
102
+ style = { { lineHeight : '20px' , maxWidth : '280px' } }
99
103
>
100
104
< Space direction = "vertical" >
101
105
< Tooltip title = { connection ?. name } >
@@ -105,7 +109,7 @@ const ConnectionPopover: React.FC<{
105
109
fontFamily : 'PingFangSC-Semibold' ,
106
110
color : 'var(--text-color-primary)' ,
107
111
fontWeight : 'bold' ,
108
- width : '240px ' ,
112
+ width : '280px ' ,
109
113
overflow : 'hidden' ,
110
114
whiteSpace : 'nowrap' ,
111
115
textOverflow : 'ellipsis' ,
@@ -154,7 +158,7 @@ const ConnectionPopover: React.FC<{
154
158
onClick = { ( e ) => {
155
159
e . stopPropagation ( ) ;
156
160
} }
157
- style = { { lineHeight : '20px' } }
161
+ style = { { lineHeight : '20px' , maxWidth : '280px' } }
158
162
>
159
163
< Space direction = "vertical" >
160
164
< Tooltip >
@@ -164,7 +168,7 @@ const ConnectionPopover: React.FC<{
164
168
fontFamily : 'PingFangSC-Semibold' ,
165
169
color : 'var(--text-color-primary)' ,
166
170
fontWeight : 'bold' ,
167
- width : '240px ' ,
171
+ width : '280px ' ,
168
172
overflow : 'hidden' ,
169
173
whiteSpace : 'nowrap' ,
170
174
textOverflow : 'ellipsis' ,
@@ -221,7 +225,7 @@ const ConnectionPopover: React.FC<{
221
225
}
222
226
223
227
let clusterAndTenant = (
224
- < div >
228
+ < div className = { styles . describe } >
225
229
< span className = { styles . label } >
226
230
{
227
231
formatMessage ( {
@@ -232,39 +236,46 @@ const ConnectionPopover: React.FC<{
232
236
/*集群/租户:*/
233
237
}
234
238
</ span >
235
- { connection ?. clusterName || '- ' } /{ connection ?. tenantName || ' -' }
239
+ < span className = { styles . content } >
240
+ { connection ?. clusterName || '- ' } /{ connection ?. tenantName || ' -' }
241
+ </ span >
236
242
</ div >
237
243
) ;
238
244
239
245
if ( haveOCP ( ) ) {
240
246
const isTenantInstance = ! ! clusterStore . tenantListMap ?. [ connection ?. tenantName ] ;
241
247
if ( isTenantInstance ) {
242
248
clusterAndTenant = (
243
- < div >
244
- {
245
- formatMessage ( {
246
- id : 'odc.component.ConnectionPopover.InstanceId' ,
247
- defaultMessage : '实例 ID:' ,
248
- } )
249
+ < div className = { styles . describe } >
250
+ < span className = { styles . label } >
251
+ {
252
+ formatMessage ( {
253
+ id : 'odc.component.ConnectionPopover.InstanceId' ,
254
+ defaultMessage : '实例 ID:' ,
255
+ } )
249
256
250
- /*实例 ID:*/
251
- }
252
-
253
- { connection ?. tenantName }
257
+ /*实例 ID:*/
258
+ }
259
+ </ span >
260
+ < span className = { styles . content } > { connection ?. tenantName } </ span >
254
261
</ div >
255
262
) ;
256
263
} else {
257
264
clusterAndTenant = (
258
- < div >
259
- {
260
- formatMessage ( {
261
- id : 'odc.component.ConnectionPopover.InstanceIdTenantId' ,
262
- defaultMessage : '实例ID/租户ID:' ,
263
- } )
265
+ < div className = { styles . describe } >
266
+ < span className = { styles . label } >
267
+ {
268
+ formatMessage ( {
269
+ id : 'odc.component.ConnectionPopover.InstanceIdTenantId' ,
270
+ defaultMessage : '实例ID/租户ID:' ,
271
+ } )
264
272
265
- /*实例ID/租户ID:*/
266
- }
267
- { connection ?. clusterName } /{ connection ?. tenantName }
273
+ /*实例ID/租户ID:*/
274
+ }
275
+ </ span >
276
+ < span className = { styles . content } >
277
+ { connection ?. clusterName } /{ connection ?. tenantName }
278
+ </ span >
268
279
</ div >
269
280
) ;
270
281
}
@@ -299,7 +310,6 @@ const ConnectionPopover: React.FC<{
299
310
} }
300
311
style = { {
301
312
lineHeight : '20px' ,
302
- // padding: 12,
303
313
maxWidth : '280px' ,
304
314
} }
305
315
>
@@ -337,7 +347,7 @@ const ConnectionPopover: React.FC<{
337
347
{ projectDescription }
338
348
{ renderConnectionMode ( ) }
339
349
{ haveOCP ( ) ? null : (
340
- < div >
350
+ < div className = { styles . describe } >
341
351
< span className = { styles . label } >
342
352
{
343
353
formatMessage ( {
@@ -348,7 +358,9 @@ const ConnectionPopover: React.FC<{
348
358
/*主机名/端口:*/
349
359
}
350
360
</ span >
351
- { connection ?. host } :{ connection ?. port }
361
+ < span className = { styles . content } >
362
+ { connection ?. host } :{ connection ?. port }
363
+ </ span >
352
364
</ div >
353
365
) }
354
366
0 commit comments