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
092807b7
authored
Mar 03, 2026
by
Calcium-Ion
Committed by
GitHub
Mar 03, 2026
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3096 from seefs001/fix/auto-fetch-upstream-model-tips
Fix/auto fetch upstream model tips
parents
4f7c4d64
3844ecca
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
28 deletions
+36
-28
controller/channel_upstream_update.go
+0
-8
dto/channel_settings.go
+1
-1
web/src/components/table/channels/ChannelsColumnDefs.jsx
+0
-4
web/src/components/table/channels/modals/EditChannelModal.jsx
+12
-13
web/src/hooks/channels/useChannelUpstreamUpdates.jsx
+23
-2
No files found.
controller/channel_upstream_update.go
View file @
092807b7
...
@@ -730,14 +730,6 @@ func DetectChannelUpstreamModelUpdates(c *gin.Context) {
...
@@ -730,14 +730,6 @@ func DetectChannelUpstreamModelUpdates(c *gin.Context) {
}
}
settings
:=
channel
.
GetOtherSettings
()
settings
:=
channel
.
GetOtherSettings
()
if
!
settings
.
UpstreamModelUpdateCheckEnabled
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"success"
:
false
,
"message"
:
"该渠道未开启上游模型更新检测"
,
})
return
}
modelsChanged
,
autoAdded
,
err
:=
checkAndPersistChannelUpstreamModelUpdates
(
channel
,
&
settings
,
true
,
false
)
modelsChanged
,
autoAdded
,
err
:=
checkAndPersistChannelUpstreamModelUpdates
(
channel
,
&
settings
,
true
,
false
)
if
err
!=
nil
{
if
err
!=
nil
{
common
.
ApiError
(
c
,
err
)
common
.
ApiError
(
c
,
err
)
...
...
dto/channel_settings.go
View file @
092807b7
...
@@ -32,7 +32,7 @@ type ChannelOtherSettings struct {
...
@@ -32,7 +32,7 @@ type ChannelOtherSettings struct {
AllowInferenceGeo
bool
`json:"allow_inference_geo,omitempty"`
// 是否允许 inference_geo 透传(仅 Claude,默认过滤以满足数据驻留合规
AllowInferenceGeo
bool
`json:"allow_inference_geo,omitempty"`
// 是否允许 inference_geo 透传(仅 Claude,默认过滤以满足数据驻留合规
AllowSafetyIdentifier
bool
`json:"allow_safety_identifier,omitempty"`
// 是否允许 safety_identifier 透传(默认过滤以保护用户隐私)
AllowSafetyIdentifier
bool
`json:"allow_safety_identifier,omitempty"`
// 是否允许 safety_identifier 透传(默认过滤以保护用户隐私)
DisableStore
bool
`json:"disable_store,omitempty"`
// 是否禁用 store 透传(默认允许透传,禁用后可能导致 Codex 无法使用)
DisableStore
bool
`json:"disable_store,omitempty"`
// 是否禁用 store 透传(默认允许透传,禁用后可能导致 Codex 无法使用)
AllowIncludeObfuscation
bool
`json:"allow_include_obfuscation,
omitempty"`
// 是否允许 stream_options.include_obfuscation 透传(默认过滤以避免关闭流混淆保护)
AllowIncludeObfuscation
bool
`json:"allow_include_obfuscation,omitempty"`
// 是否允许 stream_options.include_obfuscation 透传(默认过滤以避免关闭流混淆保护)
AwsKeyType
AwsKeyType
`json:"aws_key_type,omitempty"`
AwsKeyType
AwsKeyType
`json:"aws_key_type,omitempty"`
UpstreamModelUpdateCheckEnabled
bool
`json:"upstream_model_update_check_enabled,omitempty"`
// 是否检测上游模型更新
UpstreamModelUpdateCheckEnabled
bool
`json:"upstream_model_update_check_enabled,omitempty"`
// 是否检测上游模型更新
UpstreamModelUpdateAutoSyncEnabled
bool
`json:"upstream_model_update_auto_sync_enabled,omitempty"`
// 是否自动同步上游模型更新
UpstreamModelUpdateAutoSyncEnabled
bool
`json:"upstream_model_update_auto_sync_enabled,omitempty"`
// 是否自动同步上游模型更新
...
...
web/src/components/table/channels/ChannelsColumnDefs.jsx
View file @
092807b7
...
@@ -723,10 +723,6 @@ export const getChannelsColumns = ({
...
@@ -723,10 +723,6 @@ export const getChannelsColumns = ({
name
:
t
(
'仅检测上游模型更新'
),
name
:
t
(
'仅检测上游模型更新'
),
type
:
'tertiary'
,
type
:
'tertiary'
,
onClick
:
()
=>
{
onClick
:
()
=>
{
if
(
!
upstreamUpdateMeta
.
enabled
)
{
showInfo
(
t
(
'该渠道未开启上游模型更新检测'
));
return
;
}
detectChannelUpstreamUpdates
(
record
);
detectChannelUpstreamUpdates
(
record
);
},
},
});
});
...
...
web/src/components/table/channels/modals/EditChannelModal.jsx
View file @
092807b7
...
@@ -3291,6 +3291,18 @@ const EditChannelModal = (props) => {
...
@@ -3291,6 +3291,18 @@ const EditChannelModal = (props) => {
inputs
.
upstream_model_update_last_check_time
,
inputs
.
upstream_model_update_last_check_time
,
)
}
)
}
</
div
>
</
div
>
<
Form
.
Input
field=
'upstream_model_update_ignored_models'
label=
{
t
(
'已忽略模型'
)
}
placeholder=
{
t
(
'例如:gpt-4.1-nano,gpt-4o-mini'
)
}
onChange=
{
(
value
)
=>
handleInputChange
(
'upstream_model_update_ignored_models'
,
value
,
)
}
showClear
/>
</>
</>
)
}
)
}
...
@@ -3460,19 +3472,6 @@ const EditChannelModal = (props) => {
...
@@ -3460,19 +3472,6 @@ const EditChannelModal = (props) => {
)
}
)
}
/>
/>
<
Form
.
Input
field=
'upstream_model_update_ignored_models'
label=
{
t
(
'手动忽略模型(逗号分隔)'
)
}
placeholder=
{
t
(
'例如:gpt-4.1-nano,gpt-4o-mini'
)
}
onChange=
{
(
value
)
=>
handleInputChange
(
'upstream_model_update_ignored_models'
,
value
,
)
}
showClear
/>
<
div
className=
'text-xs text-gray-500 mb-3'
>
<
div
className=
'text-xs text-gray-500 mb-3'
>
{
t
(
'上次检测到可加入模型'
)
}
:
{
t
(
'上次检测到可加入模型'
)
}
:
{
upstreamDetectedModels
.
length
===
0
?
(
{
upstreamDetectedModels
.
length
===
0
?
(
...
...
web/src/hooks/channels/useChannelUpstreamUpdates.jsx
View file @
092807b7
...
@@ -21,6 +21,23 @@ import { useRef, useState } from 'react';
...
@@ -21,6 +21,23 @@ import { useRef, useState } from 'react';
import
{
API
,
showError
,
showInfo
,
showSuccess
}
from
'../../helpers'
;
import
{
API
,
showError
,
showInfo
,
showSuccess
}
from
'../../helpers'
;
import
{
normalizeModelList
}
from
'./upstreamUpdateUtils'
;
import
{
normalizeModelList
}
from
'./upstreamUpdateUtils'
;
const
getManualIgnoredModelCountFromSettings
=
(
settings
)
=>
{
let
parsed
=
null
;
if
(
settings
&&
typeof
settings
===
'object'
)
{
parsed
=
settings
;
}
else
if
(
typeof
settings
===
'string'
)
{
try
{
parsed
=
JSON
.
parse
(
settings
);
}
catch
(
error
)
{
parsed
=
null
;
}
}
if
(
!
parsed
||
typeof
parsed
!==
'object'
)
{
return
0
;
}
return
normalizeModelList
(
parsed
.
upstream_model_update_ignored_models
).
length
;
};
export
const
useChannelUpstreamUpdates
=
({
t
,
refresh
})
=>
{
export
const
useChannelUpstreamUpdates
=
({
t
,
refresh
})
=>
{
const
[
showUpstreamUpdateModal
,
setShowUpstreamUpdateModal
]
=
useState
(
false
);
const
[
showUpstreamUpdateModal
,
setShowUpstreamUpdateModal
]
=
useState
(
false
);
const
[
upstreamUpdateChannel
,
setUpstreamUpdateChannel
]
=
useState
(
null
);
const
[
upstreamUpdateChannel
,
setUpstreamUpdateChannel
]
=
useState
(
null
);
...
@@ -114,14 +131,18 @@ export const useChannelUpstreamUpdates = ({ t, refresh }) => {
...
@@ -114,14 +131,18 @@ export const useChannelUpstreamUpdates = ({ t, refresh }) => {
const
addedCount
=
data
?.
added_models
?.
length
||
0
;
const
addedCount
=
data
?.
added_models
?.
length
||
0
;
const
removedCount
=
data
?.
removed_models
?.
length
||
0
;
const
removedCount
=
data
?.
removed_models
?.
length
||
0
;
const
ignoredCount
=
data
?.
ignored_models
?.
length
||
0
;
const
totalIgnoredCount
=
getManualIgnoredModelCountFromSettings
(
data
?.
settings
,
);
const
ignoredCount
=
normalizeModelList
(
ignoreModels
).
length
;
showSuccess
(
showSuccess
(
t
(
t
(
'已处理上游模型更新:加入 {{added}} 个,删除 {{removed}} 个,
忽略 {{i
gnored}} 个'
,
'已处理上游模型更新:加入 {{added}} 个,删除 {{removed}} 个,
本次忽略 {{ignored}} 个,当前已忽略模型 {{totalI
gnored}} 个'
,
{
{
added
:
addedCount
,
added
:
addedCount
,
removed
:
removedCount
,
removed
:
removedCount
,
ignored
:
ignoredCount
,
ignored
:
ignoredCount
,
totalIgnored
:
totalIgnoredCount
,
},
},
),
),
);
);
...
...
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