Merge branch 'Calcium-Ion:main' into new512

This commit is contained in:
iszcz
2024-05-17 12:53:23 +08:00
committed by GitHub
23 changed files with 221 additions and 41 deletions

View File

@@ -6,6 +6,7 @@ import {
showError,
showInfo,
showSuccess,
showWarning,
timestamp2string,
} from '../helpers';
@@ -309,6 +310,12 @@ const ChannelsTable = () => {
const setChannelFormat = (channels) => {
for (let i = 0; i < channels.length; i++) {
if (channels[i].type === 8) {
showWarning(
'检测到您使用了“自定义渠道”类型请更换为“OpenAI”渠道类型',
);
showWarning('下个版本将不再支持“自定义渠道”类型!');
}
channels[i].key = '' + channels[i].id;
let test_models = [];
channels[i].models.split(',').forEach((item, index) => {

View File

@@ -294,6 +294,30 @@ const LogsTable = () => {
);
},
},
{
title: '重试',
dataIndex: 'retry',
className: isAdmin() ? 'tableShow' : 'tableHiddle',
render: (text, record, index) => {
let content = '渠道:' + record.channel;
if (record.other !== '') {
let other = JSON.parse(record.other);
if (other.admin_info !== undefined) {
if (
other.admin_info.use_channel !== null &&
other.admin_info.use_channel !== undefined &&
other.admin_info.use_channel !== ''
) {
// channel id array
let useChannel = other.admin_info.use_channel;
let useChannelStr = useChannel.join('->');
content = `渠道:${useChannelStr}`;
}
}
}
return isAdminUser ? <div>{content}</div> : <></>;
},
},
{
title: '详情',
dataIndex: 'content',