feat(ui): Improve model testing button layout and styling
This commit is contained in:
@@ -450,13 +450,6 @@ const ChannelsTable = () => {
|
|||||||
dataIndex: 'operate',
|
dataIndex: 'operate',
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
if (record.children === undefined) {
|
if (record.children === undefined) {
|
||||||
// 构建模型测试菜单
|
|
||||||
const modelMenuItems = record.models.split(',').map(model => ({
|
|
||||||
node: 'item',
|
|
||||||
name: model,
|
|
||||||
onClick: () => testChannel(record, model)
|
|
||||||
}));
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<SplitButtonGroup
|
<SplitButtonGroup
|
||||||
@@ -1566,8 +1559,9 @@ const ChannelsTable = () => {
|
|||||||
|
|
||||||
<div style={{
|
<div style={{
|
||||||
display: 'grid',
|
display: 'grid',
|
||||||
gridTemplateColumns: 'repeat(auto-fill, minmax(180px, 1fr))',
|
gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',
|
||||||
gap: '10px'
|
gap: '12px',
|
||||||
|
marginBottom: '16px'
|
||||||
}}>
|
}}>
|
||||||
{currentTestChannel.models.split(',')
|
{currentTestChannel.models.split(',')
|
||||||
.filter(model => model.toLowerCase().includes(modelSearchKeyword.toLowerCase()))
|
.filter(model => model.toLowerCase().includes(modelSearchKeyword.toLowerCase()))
|
||||||
@@ -1575,27 +1569,31 @@ const ChannelsTable = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
key={index}
|
theme="light"
|
||||||
theme="light"
|
type="tertiary"
|
||||||
type="tertiary"
|
style={{
|
||||||
style={{
|
height: 'auto',
|
||||||
height: 'auto',
|
padding: '10px 12px',
|
||||||
padding: '8px 12px',
|
textAlign: 'center',
|
||||||
textAlign: 'center',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
overflow: 'hidden',
|
||||||
onClick={() => {
|
textOverflow: 'ellipsis',
|
||||||
testChannel(currentTestChannel, model);
|
width: '100%',
|
||||||
}}
|
borderRadius: '6px'
|
||||||
>
|
}}
|
||||||
{model}
|
onClick={() => {
|
||||||
</Button>
|
testChannel(currentTestChannel, model);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{model}
|
||||||
|
</Button>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 显示搜索结果数量 */}
|
{/* 显示搜索结果数量 */}
|
||||||
{modelSearchKeyword && (
|
{modelSearchKeyword && (
|
||||||
<Typography.Text type="secondary" style={{ marginTop: '16px', display: 'block' }}>
|
<Typography.Text type="secondary" style={{ display: 'block' }}>
|
||||||
{t('找到')} {currentTestChannel.models.split(',').filter(model =>
|
{t('找到')} {currentTestChannel.models.split(',').filter(model =>
|
||||||
model.toLowerCase().includes(modelSearchKeyword.toLowerCase())
|
model.toLowerCase().includes(modelSearchKeyword.toLowerCase())
|
||||||
).length} {t('个模型')}
|
).length} {t('个模型')}
|
||||||
|
|||||||
Reference in New Issue
Block a user