Просмотр исходного кода

🔍 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.
t0ng7u 7 месяцев назад
Родитель
Сommit
27f99a0f38
2 измененных файлов с 15 добавлено и 14 удалено
  1. 1 1
      web/src/components/layout/SiderBar.js
  2. 14 13
      web/src/pages/Token/EditToken.js

+ 1 - 1
web/src/components/layout/SiderBar.js

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

+ 14 - 13
web/src/pages/Token/EditToken.js

@@ -469,18 +469,6 @@ const EditToken = (props) => {
                   </div>
                 </div>
                 <Row gutter={12}>
-                  <Col span={24}>
-                    <Form.TextArea
-                      field='allow_ips'
-                      label={t('IP白名单')}
-                      placeholder={t('允许的IP,一行一个,不填写则不限制')}
-                      autosize
-                      rows={1}
-                      extraText={t('请勿过度信任此功能,IP可能被伪造')}
-                      showClear
-                      style={{ width: '100%' }}
-                    />
-                  </Col>
                   <Col span={24}>
                     <Form.Select
                       field='model_limits'
@@ -488,8 +476,21 @@ const EditToken = (props) => {
                       placeholder={t('请选择该令牌支持的模型,留空支持所有模型')}
                       multiple
                       optionList={models}
-                      maxTagCount={3}
                       extraText={t('非必要,不建议启用模型限制')}
+                      filter
+                      searchPosition='dropdown'
+                      showClear
+                      style={{ width: '100%' }}
+                    />
+                  </Col>
+                  <Col span={24}>
+                    <Form.TextArea
+                      field='allow_ips'
+                      label={t('IP白名单')}
+                      placeholder={t('允许的IP,一行一个,不填写则不限制')}
+                      autosize
+                      rows={1}
+                      extraText={t('请勿过度信任此功能,IP可能被伪造')}
                       showClear
                       style={{ width: '100%' }}
                     />