feat: 仅为适当的渠道渲染获取模型列表按钮

This commit is contained in:
RedwindA 2025-09-27 01:19:09 +08:00
parent 84d00fb75b
commit ee6e5ff882

View File

@ -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,13 +1892,15 @@ const EditChannelModal = (props) => {
> >
{t('填入所有模型')} {t('填入所有模型')}
</Button> </Button>
<Button {MODEL_FETCHABLE_TYPES.has(inputs.type) && (
size='small' <Button
type='tertiary' size='small'
onClick={() => fetchUpstreamModelList('models')} type='tertiary'
> onClick={() => fetchUpstreamModelList('models')}
{t('获取模型列表')} >
</Button> {t('获取模型列表')}
</Button>
)}
<Button <Button
size='small' size='small'
type='warning' type='warning'