🔍 feat(edit-token): add search capability to model limit selector

Changes:
• `Form.Select` for “Model Limits” now supports in-dropdown searching (`filter` + `searchPosition='dropdown'`) enabling quick model lookup.
• Removed `maxTagCount` to display all selected models without truncation.

Benefit: simplifies selecting specific models when the list is large, improving usability during token creation/editing.
This commit is contained in:
t0ng7u
2025-07-13 18:25:05 +08:00
parent d1e48d02bd
commit 27f99a0f38
2 changed files with 15 additions and 14 deletions

View File

@@ -326,7 +326,7 @@ const SiderBar = () => {
style={{ width: isCollapsed ? '60px' : '180px' }} style={{ width: isCollapsed ? '60px' : '180px' }}
> >
<Nav <Nav
className="sidebar-nav custom-sidebar-nav" className="sidebar-nav"
defaultIsCollapsed={styleState.siderCollapsed} defaultIsCollapsed={styleState.siderCollapsed}
isCollapsed={isCollapsed} isCollapsed={isCollapsed}
onCollapseChange={(collapsed) => { onCollapseChange={(collapsed) => {

View File

@@ -469,6 +469,20 @@ const EditToken = (props) => {
</div> </div>
</div> </div>
<Row gutter={12}> <Row gutter={12}>
<Col span={24}>
<Form.Select
field='model_limits'
label={t('模型限制列表')}
placeholder={t('请选择该令牌支持的模型,留空支持所有模型')}
multiple
optionList={models}
extraText={t('非必要,不建议启用模型限制')}
filter
searchPosition='dropdown'
showClear
style={{ width: '100%' }}
/>
</Col>
<Col span={24}> <Col span={24}>
<Form.TextArea <Form.TextArea
field='allow_ips' field='allow_ips'
@@ -481,19 +495,6 @@ const EditToken = (props) => {
style={{ width: '100%' }} style={{ width: '100%' }}
/> />
</Col> </Col>
<Col span={24}>
<Form.Select
field='model_limits'
label={t('模型限制列表')}
placeholder={t('请选择该令牌支持的模型,留空支持所有模型')}
multiple
optionList={models}
maxTagCount={3}
extraText={t('非必要,不建议启用模型限制')}
showClear
style={{ width: '100%' }}
/>
</Col>
</Row> </Row>
</Card> </Card>
</div> </div>