mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-26 20:06:37 +08:00
feat:
1. tag support custom color 2. support 403 ban 3. add .dockerignore
This commit is contained in:
parent
b173e1e4ce
commit
f04a81adf2
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
||||
/web/dist/
|
||||
/web/node_modules/
|
@ -9,7 +9,6 @@ var ModelList = []string{
|
||||
"Doubao-lite-128k",
|
||||
"Doubao-lite-32k",
|
||||
"Doubao-lite-4k",
|
||||
"Doubao-embedding",
|
||||
}
|
||||
|
||||
var ChannelName = "doubao"
|
||||
|
@ -31,7 +31,7 @@ func ShouldDisableChannel(err *relaymodel.OpenAIError, statusCode int) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
if statusCode == http.StatusUnauthorized {
|
||||
if statusCode == http.StatusUnauthorized || statusCode == http.StatusForbidden {
|
||||
return true
|
||||
}
|
||||
switch err.Code {
|
||||
@ -59,6 +59,8 @@ func ShouldDisableChannel(err *relaymodel.OpenAIError, statusCode int) bool {
|
||||
return true
|
||||
} else if strings.HasPrefix(err.Message, "You exceeded your current quota") {
|
||||
return true
|
||||
} else if strings.HasPrefix(err.Message, "Permission denied") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -48,6 +48,13 @@ function renderType(type) {
|
||||
}
|
||||
type2label[0] = { value: 0, text: '未知类型', color: 'grey' };
|
||||
}
|
||||
const backgroundColor = type2label[type]?.backgroundColor
|
||||
const textColor = type2label[type]?.textColor
|
||||
if (backgroundColor && textColor) {
|
||||
return <Tag size='large' style={{backgroundColor: backgroundColor, color: textColor}}>
|
||||
{type2label[type]?.text}
|
||||
</Tag>
|
||||
}
|
||||
return (
|
||||
<Tag size='large' color={type2label[type]?.color}>
|
||||
{type2label[type]?.text}
|
||||
|
@ -97,8 +97,21 @@ export const CHANNEL_OPTIONS = [
|
||||
{ key: 23, text: '腾讯混元', value: 23, color: 'teal', label: '腾讯混元' },
|
||||
{ key: 31, text: '零一万物', value: 31, color: 'green', label: '零一万物' },
|
||||
{ key: 35, text: 'MiniMax', value: 35, color: 'green', label: 'MiniMax' },
|
||||
{ key: 36, text: 'ScholarAI', value: 36, color: 'green', label: 'ScholarAI' },
|
||||
{ key: 37, text: '豆包', value: 37, color: 'green', label: '豆包' },
|
||||
{
|
||||
key: 36,
|
||||
text: 'ScholarAI',
|
||||
value: 36,
|
||||
backgroundColor: 'rgb(0, 70, 77)',
|
||||
textColor: 'white',
|
||||
label: 'ScholarAI'
|
||||
},
|
||||
{
|
||||
key: 37,
|
||||
text: '豆包',
|
||||
value: 37,
|
||||
color: 'blue',
|
||||
label: '豆包'
|
||||
},
|
||||
{ key: 8, text: '自定义渠道', value: 8, color: 'pink', label: '自定义渠道' },
|
||||
{
|
||||
key: 22,
|
||||
|
Loading…
Reference in New Issue
Block a user