mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-17 05:33:42 +08:00
✨ feat: support configuration file (#117)
* ♻️ refactor: move file directory * ♻️ refactor: move file directory * ♻️ refactor: support multiple config methods * 🔥 del: remove unused code * 💩 refactor: Refactor channel management and synchronization * 💄 improve: add channel website * ✨ feat: allow recording 0 consumption
This commit is contained in:
@@ -3,126 +3,147 @@ export const CHANNEL_OPTIONS = {
|
||||
key: 1,
|
||||
text: 'OpenAI',
|
||||
value: 1,
|
||||
color: 'primary'
|
||||
color: 'primary',
|
||||
url: 'https://platform.openai.com/usage'
|
||||
},
|
||||
14: {
|
||||
key: 14,
|
||||
text: 'Anthropic Claude',
|
||||
value: 14,
|
||||
color: 'info'
|
||||
color: 'info',
|
||||
url: 'https://console.anthropic.com/'
|
||||
},
|
||||
3: {
|
||||
key: 3,
|
||||
text: 'Azure OpenAI',
|
||||
value: 3,
|
||||
color: 'orange'
|
||||
color: 'orange',
|
||||
url: 'https://oai.azure.com/'
|
||||
},
|
||||
11: {
|
||||
key: 11,
|
||||
text: 'Google PaLM2',
|
||||
value: 11,
|
||||
color: 'orange'
|
||||
color: 'orange',
|
||||
url: 'https://aistudio.google.com/'
|
||||
},
|
||||
25: {
|
||||
key: 25,
|
||||
text: 'Google Gemini',
|
||||
value: 25,
|
||||
color: 'orange'
|
||||
color: 'orange',
|
||||
url: 'https://aistudio.google.com/'
|
||||
},
|
||||
15: {
|
||||
key: 15,
|
||||
text: '百度文心千帆',
|
||||
value: 15,
|
||||
color: 'default'
|
||||
color: 'default',
|
||||
url: 'https://console.bce.baidu.com/qianfan/overview'
|
||||
},
|
||||
17: {
|
||||
key: 17,
|
||||
text: '阿里通义千问',
|
||||
value: 17,
|
||||
color: 'default'
|
||||
color: 'default',
|
||||
url: 'https://dashscope.console.aliyun.com/overview'
|
||||
},
|
||||
18: {
|
||||
key: 18,
|
||||
text: '讯飞星火认知',
|
||||
value: 18,
|
||||
color: 'default'
|
||||
color: 'default',
|
||||
url: 'https://console.xfyun.cn/'
|
||||
},
|
||||
16: {
|
||||
key: 16,
|
||||
text: '智谱 ChatGLM',
|
||||
value: 16,
|
||||
color: 'default'
|
||||
color: 'default',
|
||||
url: 'https://open.bigmodel.cn/overview'
|
||||
},
|
||||
19: {
|
||||
key: 19,
|
||||
text: '360 智脑',
|
||||
value: 19,
|
||||
color: 'default'
|
||||
color: 'default',
|
||||
url: 'https://ai.360.com/open'
|
||||
},
|
||||
23: {
|
||||
key: 23,
|
||||
text: '腾讯混元',
|
||||
value: 23,
|
||||
color: 'default'
|
||||
color: 'default',
|
||||
url: 'https://cloud.tencent.com/product/hunyuan'
|
||||
},
|
||||
26: {
|
||||
key: 26,
|
||||
text: '百川',
|
||||
value: 26,
|
||||
color: 'orange'
|
||||
color: 'orange',
|
||||
url: 'https://platform.baichuan-ai.com/console/apikey'
|
||||
},
|
||||
27: {
|
||||
key: 27,
|
||||
text: 'MiniMax',
|
||||
value: 27,
|
||||
color: 'orange'
|
||||
color: 'orange',
|
||||
url: 'https://www.minimaxi.com/user-center/basic-information'
|
||||
},
|
||||
28: {
|
||||
key: 28,
|
||||
text: 'Deepseek',
|
||||
value: 28,
|
||||
color: 'default'
|
||||
color: 'default',
|
||||
url: 'https://platform.deepseek.com/usage'
|
||||
},
|
||||
29: {
|
||||
key: 29,
|
||||
text: 'Moonshot',
|
||||
value: 29,
|
||||
color: 'default'
|
||||
color: 'default',
|
||||
url: 'https://platform.moonshot.cn/console/info'
|
||||
},
|
||||
30: {
|
||||
key: 30,
|
||||
text: 'Mistral',
|
||||
value: 30,
|
||||
color: 'orange'
|
||||
color: 'orange',
|
||||
url: 'https://console.mistral.ai/'
|
||||
},
|
||||
31: {
|
||||
key: 31,
|
||||
text: 'Groq',
|
||||
value: 31,
|
||||
color: 'primary'
|
||||
color: 'primary',
|
||||
url: 'https://console.groq.com/keys'
|
||||
},
|
||||
32: {
|
||||
key: 32,
|
||||
text: 'Amazon Bedrock',
|
||||
value: 32,
|
||||
color: 'orange'
|
||||
color: 'orange',
|
||||
url: 'https://console.aws.amazon.com/bedrock/home'
|
||||
},
|
||||
33: {
|
||||
key: 33,
|
||||
text: '零一万物',
|
||||
value: 33,
|
||||
color: 'primary'
|
||||
color: 'primary',
|
||||
url: 'https://platform.lingyiwanwu.com/details'
|
||||
},
|
||||
24: {
|
||||
key: 24,
|
||||
text: 'Azure Speech',
|
||||
value: 24,
|
||||
color: 'orange'
|
||||
color: 'orange',
|
||||
url: 'https://portal.azure.com/'
|
||||
},
|
||||
8: {
|
||||
key: 8,
|
||||
text: '自定义渠道',
|
||||
value: 8,
|
||||
color: 'primary'
|
||||
color: 'primary',
|
||||
url: ''
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@ import TableSwitch from 'ui-component/Switch';
|
||||
import ResponseTimeLabel from './ResponseTimeLabel';
|
||||
import GroupLabel from './GroupLabel';
|
||||
|
||||
import { IconDotsVertical, IconEdit, IconTrash, IconPencil, IconCopy } from '@tabler/icons-react';
|
||||
import { IconDotsVertical, IconEdit, IconTrash, IconPencil, IconCopy, IconWorldWww } from '@tabler/icons-react';
|
||||
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
||||
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
|
||||
import { copy } from 'utils/common';
|
||||
@@ -252,6 +252,18 @@ export default function ChannelTableRow({ item, manageChannel, handleOpenModal,
|
||||
>
|
||||
<IconCopy style={{ marginRight: '16px' }} /> 复制{' '}
|
||||
</MenuItem>
|
||||
{CHANNEL_OPTIONS[item.type]?.url && (
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
handleCloseMenu();
|
||||
// 新页面打开
|
||||
window.open(CHANNEL_OPTIONS[item.type].url);
|
||||
}}
|
||||
>
|
||||
<IconWorldWww style={{ marginRight: '16px' }} />
|
||||
官网
|
||||
</MenuItem>
|
||||
)}
|
||||
|
||||
<MenuItem onClick={handleDeleteOpen} sx={{ color: 'error.main' }}>
|
||||
<IconTrash style={{ marginRight: '16px' }} />
|
||||
|
||||
@@ -76,9 +76,9 @@ export default function LogTableRow({ item, userIsAdmin }) {
|
||||
{' '}
|
||||
<Label color={requestTimeLabelOptions(item.request_time)}> {item.request_time == 0 ? '无' : request_time} </Label>
|
||||
</TableCell>
|
||||
<TableCell>{item.prompt_tokens || ''}</TableCell>
|
||||
<TableCell>{item.completion_tokens || ''}</TableCell>
|
||||
<TableCell>{item.quota ? renderQuota(item.quota, 6) : ''}</TableCell>
|
||||
<TableCell>{item.prompt_tokens || '0'}</TableCell>
|
||||
<TableCell>{item.completion_tokens || '0'}</TableCell>
|
||||
<TableCell>{item.quota ? renderQuota(item.quota, 6) : '0'}</TableCell>
|
||||
<TableCell>{item.content}</TableCell>
|
||||
</TableRow>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user