@@ -26,14 +26,17 @@ const pulsingAnimation = `
2626
2727const getStatusStyle = ( status ?: ModelConnectStatus ) : React . CSSProperties => {
2828 const baseStyle : React . CSSProperties = {
29- width : '12px' , // 扩大尺寸
30- height : '12px' , // 扩大尺寸
29+ width : 'clamp(8px, 1.5vw, 12px)' , // 响应式尺寸,最小8px,最大12px
30+ height : 'clamp(8px, 1.5vw, 12px)' , // 与宽度保持一致
31+ aspectRatio : '1/1' , // 强制保持1:1比例
3132 borderRadius : '50%' ,
3233 display : 'inline-block' ,
3334 marginRight : '4px' ,
34- cursor : 'pointer' , // 添加指针样式表明可点击
35- transition : 'all 0.2s ease' , // 添加过渡效果
36- position : 'relative' , // 用于伪元素定位
35+ cursor : 'pointer' ,
36+ transition : 'all 0.2s ease' ,
37+ position : 'relative' ,
38+ flexShrink : 0 , // 防止被压缩
39+ flexGrow : 0 , // 防止被拉伸
3740 } ;
3841
3942 if ( status === "检测中" ) {
@@ -307,45 +310,47 @@ export const ModelListCard = ({
307310 < Select . OptGroup label = "自定义模型" >
308311 { modelsBySource . custom . map ( ( model ) => (
309312 < Option key = { `${ type } -${ model . displayName || model . name } -custom` } value = { model . displayName || model . name } >
310- < div className = "flex items-center justify-between" >
311- < div className = "font-medium truncate" title = { model . displayName || model . name } >
313+ < div className = "flex items-center justify-between" style = { { minWidth : 0 } } >
314+ < div className = "font-medium truncate" style = { { flex : '1 1 auto' , minWidth : 0 } } title = { model . displayName || model . name } >
312315 { model . displayName || model . name }
313316 </ div >
314- < Tooltip title = "点击可验证连通性" >
315- < span
316- onClick = { ( e ) => handleStatusClick ( e , model . displayName || model . name ) }
317- onMouseDown = { ( e : React . MouseEvent ) => {
318- e . stopPropagation ( ) ;
319- e . preventDefault ( ) ;
320- if ( onVerifyModel ) {
321- updateLocalModelStatus ( model . displayName || model . name , "检测中" ) ;
322- onVerifyModel ( model . displayName || model . name , type ) ;
323- }
324- return false ;
325- } }
326- style = { {
327- ...getStatusStyle ( model . connect_status ) ,
328- backgroundColor : model . connect_status === "检测中"
329- ? "#2980b9"
330- : getConnectStatusColor ( model . connect_status ) ,
331- boxShadow : model . connect_status === "检测中"
332- ? "0 0 3px #2980b9"
333- : `0 0 3px ${ getConnectStatusColor ( model . connect_status ) } `
334- } }
335- className = "status-indicator"
336- onMouseEnter = { ( e ) => {
337- const target = e . currentTarget as HTMLElement ;
338- Object . assign ( target . style , getHoverStyle ) ;
339- } }
340- onMouseLeave = { ( e ) => {
341- const target = e . currentTarget as HTMLElement ;
342- target . style . transform = '' ;
343- target . style . boxShadow = model . connect_status === "检测中"
344- ? "0 0 3px #2980b9"
345- : `0 0 3px ${ getConnectStatusColor ( model . connect_status ) } ` ;
346- } }
347- />
348- </ Tooltip >
317+ < div style = { { flex : '0 0 auto' , display : 'flex' , alignItems : 'center' , marginLeft : '8px' } } >
318+ < Tooltip title = "点击可验证连通性" >
319+ < span
320+ onClick = { ( e ) => handleStatusClick ( e , model . displayName || model . name ) }
321+ onMouseDown = { ( e : React . MouseEvent ) => {
322+ e . stopPropagation ( ) ;
323+ e . preventDefault ( ) ;
324+ if ( onVerifyModel ) {
325+ updateLocalModelStatus ( model . displayName || model . name , "检测中" ) ;
326+ onVerifyModel ( model . displayName || model . name , type ) ;
327+ }
328+ return false ;
329+ } }
330+ style = { {
331+ ...getStatusStyle ( model . connect_status ) ,
332+ backgroundColor : model . connect_status === "检测中"
333+ ? "#2980b9"
334+ : getConnectStatusColor ( model . connect_status ) ,
335+ boxShadow : model . connect_status === "检测中"
336+ ? "0 0 3px #2980b9"
337+ : `0 0 3px ${ getConnectStatusColor ( model . connect_status ) } `
338+ } }
339+ className = "status-indicator"
340+ onMouseEnter = { ( e ) => {
341+ const target = e . currentTarget as HTMLElement ;
342+ Object . assign ( target . style , getHoverStyle ) ;
343+ } }
344+ onMouseLeave = { ( e ) => {
345+ const target = e . currentTarget as HTMLElement ;
346+ target . style . transform = '' ;
347+ target . style . boxShadow = model . connect_status === "检测中"
348+ ? "0 0 3px #2980b9"
349+ : `0 0 3px ${ getConnectStatusColor ( model . connect_status ) } ` ;
350+ } }
351+ />
352+ </ Tooltip >
353+ </ div >
349354 </ div >
350355 </ Option >
351356 ) ) }
0 commit comments