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
ee6e5ff8
authored
Sep 27, 2025
by
RedwindA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 仅为适当的渠道渲染获取模型列表按钮
parent
84d00fb7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
web/src/components/table/channels/modals/EditChannelModal.jsx
+22
-0
No files found.
web/src/components/table/channels/modals/EditChannelModal.jsx
View file @
ee6e5ff8
...
@@ -85,6 +85,26 @@ const REGION_EXAMPLE = {
...
@@ -85,6 +85,26 @@ const REGION_EXAMPLE = {
'claude-3-5-sonnet-20240620'
:
'europe-west1'
,
'claude-3-5-sonnet-20240620'
:
'europe-west1'
,
};
};
// 支持并且已适配通过接口获取模型列表的渠道类型
const
MODEL_FETCHABLE_TYPES
=
new
Set
([
1
,
4
,
14
,
34
,
17
,
26
,
24
,
47
,
25
,
20
,
23
,
31
,
35
,
40
,
42
,
48
,
]);
function
type2secretPrompt
(
type
)
{
function
type2secretPrompt
(
type
)
{
// inputs.type === 15 ? '按照如下格式输入:APIKey|SecretKey' : (inputs.type === 18 ? '按照如下格式输入:APPID|APISecret|APIKey' : '请输入渠道对应的鉴权密钥')
// inputs.type === 15 ? '按照如下格式输入:APIKey|SecretKey' : (inputs.type === 18 ? '按照如下格式输入:APPID|APISecret|APIKey' : '请输入渠道对应的鉴权密钥')
switch
(
type
)
{
switch
(
type
)
{
...
@@ -1872,6 +1892,7 @@ const EditChannelModal = (props) => {
...
@@ -1872,6 +1892,7 @@ const EditChannelModal = (props) => {
>
>
{
t
(
'填入所有模型'
)
}
{
t
(
'填入所有模型'
)
}
</
Button
>
</
Button
>
{
MODEL_FETCHABLE_TYPES
.
has
(
inputs
.
type
)
&&
(
<
Button
<
Button
size=
'small'
size=
'small'
type=
'tertiary'
type=
'tertiary'
...
@@ -1879,6 +1900,7 @@ const EditChannelModal = (props) => {
...
@@ -1879,6 +1900,7 @@ const EditChannelModal = (props) => {
>
>
{
t
(
'获取模型列表'
)
}
{
t
(
'获取模型列表'
)
}
</
Button
>
</
Button
>
)
}
<
Button
<
Button
size=
'small'
size=
'small'
type=
'warning'
type=
'warning'
...
...
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