@@ -13,7 +13,7 @@ interface EnvironmentsTableProps {
13
13
}
14
14
15
15
/**
16
- * Modern card-based layout for displaying environments
16
+ * Clean card-based layout for displaying environments consistent with app design
17
17
*/
18
18
const EnvironmentsTable : React . FC < EnvironmentsTableProps > = ( {
19
19
environments,
@@ -34,17 +34,16 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
34
34
35
35
// Generate background color for environment avatar
36
36
const getAvatarColor = ( name : string ) => {
37
- let hash = 0 ;
38
- for ( let i = 0 ; i < name . length ; i ++ ) {
39
- hash = name . charCodeAt ( i ) + ( ( hash << 5 ) - hash ) ;
40
- }
41
-
42
37
const type = name . toUpperCase ( ) ;
43
38
if ( type === 'PROD' ) return '#f5222d' ;
44
39
if ( type === 'PREPROD' ) return '#fa8c16' ;
45
40
if ( type === 'TEST' ) return '#722ed1' ;
46
41
if ( type === 'DEV' ) return '#1890ff' ;
47
42
43
+ let hash = 0 ;
44
+ for ( let i = 0 ; i < name . length ; i ++ ) {
45
+ hash = name . charCodeAt ( i ) + ( ( hash << 5 ) - hash ) ;
46
+ }
48
47
const hue = Math . abs ( hash % 360 ) ;
49
48
return `hsl(${ hue } , 70%, 50%)` ;
50
49
} ;
@@ -90,7 +89,6 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
90
89
}
91
90
} ;
92
91
93
- // For card display, we'll use a custom layout instead of Table
94
92
if ( environments . length === 0 ) {
95
93
return null ;
96
94
}
@@ -107,16 +105,14 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
107
105
< Card
108
106
hoverable
109
107
style = { {
110
- borderRadius : '8px' ,
111
- overflow : 'hidden' ,
108
+ borderRadius : '4px' ,
112
109
height : '100%' ,
113
110
cursor : 'pointer' ,
114
- transition : 'all 0.3s ease' ,
115
- boxShadow : '0 1px 3px rgba(0,0,0,0.02)' ,
111
+ transition : 'all 0.2s ease' ,
116
112
border : '1px solid #f0f0f0' ,
117
113
position : 'relative'
118
114
} }
119
- bodyStyle = { { padding : '20px ' } }
115
+ bodyStyle = { { padding : '16px ' } }
120
116
onClick = { ( ) => handleRowClick ( env ) }
121
117
>
122
118
{ /* Subtle overlay for unlicensed environments */ }
@@ -127,7 +123,7 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
127
123
left : 0 ,
128
124
right : 0 ,
129
125
bottom : 0 ,
130
- background : 'rgba(255, 255, 255, 0.7 )' ,
126
+ background : 'rgba(255, 255, 255, 0.8 )' ,
131
127
zIndex : 1 ,
132
128
display : 'flex' ,
133
129
alignItems : 'flex-start' ,
@@ -138,14 +134,13 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
138
134
< div style = { {
139
135
background : licenseDisplay . color ,
140
136
color : 'white' ,
141
- padding : '6px 12px ' ,
142
- borderRadius : '16px ' ,
137
+ padding : '4px 8px ' ,
138
+ borderRadius : '4px ' ,
143
139
fontSize : '12px' ,
144
- fontWeight : 600 ,
140
+ fontWeight : 500 ,
145
141
display : 'flex' ,
146
142
alignItems : 'center' ,
147
- gap : '6px' ,
148
- boxShadow : '0 2px 6px rgba(0,0,0,0.15)'
143
+ gap : '4px'
149
144
} } >
150
145
{ licenseDisplay . icon }
151
146
{ licenseDisplay . text }
@@ -160,25 +155,24 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
160
155
backgroundColor : getAvatarColor ( env . environmentType ) ,
161
156
display : 'flex' ,
162
157
alignItems : 'center' ,
163
- justifyContent : 'center' ,
164
- fontSize : '20px'
158
+ justifyContent : 'center'
165
159
} }
166
- size = { 48 }
160
+ size = { 40 }
167
161
icon = { < CloudServerOutlined /> }
168
162
/>
169
163
< div >
170
- < Title level = { 5 } style = { { margin : 0 , marginBottom : '4px' } } >
164
+ < Title level = { 5 } style = { { margin : 0 , marginBottom : '4px' , fontSize : '14px' } } >
171
165
{ env . environmentName || 'Unnamed Environment' }
172
166
{ env . isMaster && (
173
167
< Tooltip title = "Master Environment" >
174
- < StarFilled style = { { color : '#faad14' , marginLeft : '8px ' , fontSize : '14px ' } } />
168
+ < StarFilled style = { { color : '#faad14' , marginLeft : '6px ' , fontSize : '12px ' } } />
175
169
</ Tooltip >
176
170
) }
177
171
</ Title >
178
172
< Space size = "small" >
179
173
< Tag
180
174
color = { getEnvironmentTagColor ( env . environmentType ) }
181
- style = { { borderRadius : '12px ' } }
175
+ style = { { fontSize : '11px' , borderRadius : '4px ' } }
182
176
>
183
177
{ formatEnvironmentType ( env . environmentType ) }
184
178
</ Tag >
@@ -187,7 +181,7 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
187
181
color = { licenseDisplay . status === 'success' ? 'green' :
188
182
licenseDisplay . status === 'error' ? 'red' :
189
183
licenseDisplay . status === 'warning' ? 'orange' : 'blue' }
190
- style = { { borderRadius : '12px ' } }
184
+ style = { { fontSize : '11px' , borderRadius : '4px ' } }
191
185
>
192
186
{ licenseDisplay . text }
193
187
</ Tag >
@@ -204,69 +198,71 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
204
198
onClick = { ( e ) => openAuditPage ( env . environmentId , e ) }
205
199
size = "small"
206
200
style = { {
207
- borderRadius : '50%' ,
208
- width : '32px' ,
209
- height : '32px'
201
+ width : '28px' ,
202
+ height : '28px' ,
203
+ display : 'flex' ,
204
+ alignItems : 'center' ,
205
+ justifyContent : 'center'
210
206
} }
211
207
/>
212
208
</ Tooltip >
213
209
</ div >
214
210
) }
215
211
</ div >
216
212
217
- < div style = { { padding : '12px 0' , borderTop : '1px solid #f5f5f5' , marginTop : '4px ' } } >
218
- < div style = { { display : 'flex' , flexDirection : 'column' , gap : '8px ' } } >
219
- < div style = { { display : 'flex' , justifyContent : 'space-between' } } >
220
- < Text type = "secondary" style = { { fontSize : '13px ' } } > ID:</ Text >
213
+ < div style = { { padding : '8px 0' , borderTop : '1px solid #f5f5f5' } } >
214
+ < div style = { { display : 'flex' , flexDirection : 'column' , gap : '6px ' } } >
215
+ < div style = { { display : 'flex' , justifyContent : 'space-between' , alignItems : 'center' } } >
216
+ < Text type = "secondary" style = { { fontSize : '12px ' } } > ID:</ Text >
221
217
{ isAccessible ? (
222
- < Text style = { { fontSize : '13px ' , fontFamily : 'monospace' } } copyable = { { tooltips : [ 'Copy ID' , 'Copied!' ] } } >
218
+ < Text style = { { fontSize : '12px ' , fontFamily : 'monospace' } } copyable = { { tooltips : [ 'Copy ID' , 'Copied!' ] } } >
223
219
{ env . environmentId }
224
220
</ Text >
225
221
) : (
226
- < Text style = { { fontSize : '13px ' , fontFamily : 'monospace' } } >
222
+ < Text style = { { fontSize : '12px ' , fontFamily : 'monospace' } } >
227
223
{ env . environmentId }
228
224
</ Text >
229
225
) }
230
226
</ div >
231
227
232
- < div style = { { display : 'flex' , justifyContent : 'space-between' } } >
233
- < Text type = "secondary" style = { { fontSize : '13px ' } } > Domain:</ Text >
228
+ < div style = { { display : 'flex' , justifyContent : 'space-between' , alignItems : 'center' } } >
229
+ < Text type = "secondary" style = { { fontSize : '12px ' } } > Domain:</ Text >
234
230
{ env . environmentFrontendUrl ? (
235
231
isAccessible ? (
236
232
< a
237
233
href = { env . environmentFrontendUrl }
238
234
target = "_blank"
239
235
rel = "noopener noreferrer"
240
236
onClick = { ( e ) => e . stopPropagation ( ) }
241
- style = { { fontSize : '13px ' } }
237
+ style = { { fontSize : '12px ' } }
242
238
>
243
239
{ env . environmentFrontendUrl . replace ( / ^ h t t p s ? : \/ \/ / , '' ) }
244
- < LinkOutlined style = { { marginLeft : 4 , fontSize : '12px ' } } />
240
+ < LinkOutlined style = { { marginLeft : 4 , fontSize : '10px ' } } />
245
241
</ a >
246
242
) : (
247
- < Text style = { { fontSize : '13px ' } } >
243
+ < Text style = { { fontSize : '12px ' } } >
248
244
{ env . environmentFrontendUrl . replace ( / ^ h t t p s ? : \/ \/ / , '' ) }
249
245
</ Text >
250
246
)
251
247
) : (
252
- < Text style = { { fontSize : '13px ' } } > —</ Text >
248
+ < Text style = { { fontSize : '12px ' } } > —</ Text >
253
249
) }
254
250
</ div >
255
251
256
- < div style = { { display : 'flex' , justifyContent : 'space-between' } } >
257
- < Text type = "secondary" style = { { fontSize : '13px ' } } > Master:</ Text >
258
- < Text style = { { fontSize : '13px ' } } >
252
+ < div style = { { display : 'flex' , justifyContent : 'space-between' , alignItems : 'center' } } >
253
+ < Text type = "secondary" style = { { fontSize : '12px ' } } > Master:</ Text >
254
+ < Text style = { { fontSize : '12px ' } } >
259
255
{ env . isMaster ? 'Yes' : 'No' }
260
256
</ Text >
261
257
</ div >
262
258
263
- < div style = { { display : 'flex' , justifyContent : 'space-between' } } >
264
- < Text type = "secondary" style = { { fontSize : '13px ' } } > License:</ Text >
259
+ < div style = { { display : 'flex' , justifyContent : 'space-between' , alignItems : 'center' } } >
260
+ < Text type = "secondary" style = { { fontSize : '12px ' } } > License:</ Text >
265
261
< div style = { { display : 'flex' , alignItems : 'center' , gap : '4px' } } >
266
- < span style = { { color : licenseDisplay . color , fontSize : '13px ' } } >
262
+ < span style = { { color : licenseDisplay . color , fontSize : '12px ' } } >
267
263
{ licenseDisplay . icon }
268
264
</ span >
269
- < Text style = { { fontSize : '13px ' , color : licenseDisplay . color } } >
265
+ < Text style = { { fontSize : '12px ' , color : licenseDisplay . color } } >
270
266
{ licenseDisplay . text }
271
267
</ Text >
272
268
</ div >
@@ -280,8 +276,8 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
280
276
</ Row >
281
277
282
278
{ environments . length > 10 && (
283
- < div style = { { textAlign : 'center' , margin : '20px 0' } } >
284
- < Text type = "secondary" >
279
+ < div style = { { textAlign : 'center' , margin : '16px 0' } } >
280
+ < Text type = "secondary" style = { { fontSize : '13px' } } >
285
281
Showing all { environments . length } environments
286
282
</ Text >
287
283
</ div >
0 commit comments