Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1fb829dd
authored
Jul 27, 2025
by
t0ng7u
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'alpha' into refactor/model-pricing
parents
017f32b9
90cf9efd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
14 deletions
+18
-14
web/src/components/playground/SettingsPanel.js
+2
-2
web/src/components/table/channels/modals/EditChannelModal.jsx
+3
-3
web/src/components/table/channels/modals/EditTagModal.jsx
+2
-2
web/src/components/table/tokens/modals/EditTokenModal.jsx
+2
-2
web/src/helpers/utils.js
+9
-5
No files found.
web/src/components/playground/SettingsPanel.js
View file @
1fb829dd
...
...
@@ -33,7 +33,7 @@ import {
Settings
,
}
from
'lucide-react'
;
import
{
useTranslation
}
from
'react-i18next'
;
import
{
renderGroupOption
,
modelS
electFilter
}
from
'../../helpers'
;
import
{
renderGroupOption
,
s
electFilter
}
from
'../../helpers'
;
import
ParameterControl
from
'./ParameterControl'
;
import
ImageUrlInput
from
'./ImageUrlInput'
;
import
ConfigManager
from
'./ConfigManager'
;
...
...
@@ -173,7 +173,7 @@ const SettingsPanel = ({
name
=
'model'
required
selection
filter
=
{
modelS
electFilter
}
filter
=
{
s
electFilter
}
autoClearSearchValue
=
{
false
}
onChange
=
{(
value
)
=>
onInputChange
(
'model'
,
value
)}
value
=
{
inputs
.
model
}
...
...
web/src/components/table/channels/modals/EditChannelModal.jsx
View file @
1fb829dd
...
...
@@ -46,7 +46,7 @@ import {
Col
,
Highlight
,
}
from
'@douyinfe/semi-ui'
;
import
{
getChannelModels
,
copy
,
getChannelIcon
,
getModelCategories
,
modelS
electFilter
}
from
'../../../../helpers'
;
import
{
getChannelModels
,
copy
,
getChannelIcon
,
getModelCategories
,
s
electFilter
}
from
'../../../../helpers'
;
import
{
IconSave
,
IconClose
,
...
...
@@ -979,7 +979,7 @@ const EditChannelModal = (props) => {
rules=
{
[{
required
:
true
,
message
:
t
(
'请选择渠道类型'
)
}]
}
optionList=
{
channelOptionList
}
style=
{
{
width
:
'100%'
}
}
filter=
{
modelS
electFilter
}
filter=
{
s
electFilter
}
autoClearSearchValue=
{
false
}
searchPosition=
'dropdown'
onSearch=
{
(
value
)
=>
setChannelSearchValue
(
value
)
}
...
...
@@ -1380,7 +1380,7 @@ const EditChannelModal = (props) => {
placeholder=
{
t
(
'请选择该渠道所支持的模型'
)
}
rules=
{
[{
required
:
true
,
message
:
t
(
'请选择模型'
)
}]
}
multiple
filter=
{
modelS
electFilter
}
filter=
{
s
electFilter
}
autoClearSearchValue=
{
false
}
searchPosition=
'dropdown'
optionList=
{
modelOptions
}
...
...
web/src/components/table/channels/modals/EditTagModal.jsx
View file @
1fb829dd
...
...
@@ -25,7 +25,7 @@ import {
showSuccess
,
showWarning
,
verifyJSON
,
modelS
electFilter
,
s
electFilter
,
}
from
'../../../../helpers'
;
import
{
SideSheet
,
...
...
@@ -395,7 +395,7 @@ const EditTagModal = (props) => {
label=
{
t
(
'模型'
)
}
placeholder=
{
t
(
'请选择该渠道所支持的模型,留空则不更改'
)
}
multiple
filter=
{
modelS
electFilter
}
filter=
{
s
electFilter
}
autoClearSearchValue=
{
false
}
searchPosition=
'dropdown'
optionList=
{
modelOptions
}
...
...
web/src/components/table/tokens/modals/EditTokenModal.jsx
View file @
1fb829dd
...
...
@@ -26,7 +26,7 @@ import {
renderGroupOption
,
renderQuotaWithPrompt
,
getModelCategories
,
modelS
electFilter
,
s
electFilter
,
}
from
'../../../../helpers'
;
import
{
useIsMobile
}
from
'../../../../hooks/common/useIsMobile.js'
;
import
{
...
...
@@ -514,7 +514,7 @@ const EditTokenModal = (props) => {
multiple
optionList=
{
models
}
extraText=
{
t
(
'非必要,不建议启用模型限制'
)
}
filter=
{
modelS
electFilter
}
filter=
{
s
electFilter
}
autoClearSearchValue=
{
false
}
searchPosition=
'dropdown'
showClear
...
...
web/src/helpers/utils.js
View file @
1fb829dd
...
...
@@ -560,12 +560,16 @@ export function setTableCompactMode(compact, tableKey = 'global') {
// -------------------------------
// Select 组件统一过滤逻辑
//
解决 label 为 ReactNode(带图标等)时无法用内置 filter 搜索的问题。
//
使用方式: <Select filter={modelSelectFilter} ... />
export
const
modelS
electFilter
=
(
input
,
option
)
=>
{
//
使用方式: <Select filter={selectFilter} ... />
//
统一的 Select 搜索过滤逻辑 -- 支持同时匹配 option.value 与 option.label
export
const
s
electFilter
=
(
input
,
option
)
=>
{
if
(
!
input
)
return
true
;
const
val
=
(
option
?.
value
||
''
).
toString
().
toLowerCase
();
return
val
.
includes
(
input
.
trim
().
toLowerCase
());
const
keyword
=
input
.
trim
().
toLowerCase
();
const
valueText
=
(
option
?.
value
??
''
).
toString
().
toLowerCase
();
const
labelText
=
(
option
?.
label
??
''
).
toString
().
toLowerCase
();
return
valueText
.
includes
(
keyword
)
||
labelText
.
includes
(
keyword
);
};
// -------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment