mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-15 23:54:30 +00:00
feat: able to only test disabled channels (#1090)
This commit is contained in:
@@ -240,11 +240,11 @@ const ChannelsTable = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const testAllChannels = async () => {
|
||||
const res = await API.get(`/api/channel/test`);
|
||||
const testChannels = async (scope) => {
|
||||
const res = await API.get(`/api/channel/test?scope=${scope}`);
|
||||
const { success, message } = res.data;
|
||||
if (success) {
|
||||
showInfo('已成功开始测试所有通道,请刷新页面查看结果。');
|
||||
showInfo('已成功开始测试通道,请刷新页面查看结果。');
|
||||
} else {
|
||||
showError(message);
|
||||
}
|
||||
@@ -529,9 +529,12 @@ const ChannelsTable = () => {
|
||||
<Button size='small' as={Link} to='/channel/add' loading={loading}>
|
||||
添加新的渠道
|
||||
</Button>
|
||||
<Button size='small' loading={loading} onClick={testAllChannels}>
|
||||
<Button size='small' loading={loading} onClick={()=>{testChannels("all")}}>
|
||||
测试所有渠道
|
||||
</Button>
|
||||
<Button size='small' loading={loading} onClick={()=>{testChannels("disabled")}}>
|
||||
测试禁用渠道
|
||||
</Button>
|
||||
{/*<Button size='small' onClick={updateAllChannelsBalance}*/}
|
||||
{/* loading={loading || updatingBalance}>更新已启用渠道余额</Button>*/}
|
||||
<Popup
|
||||
|
Reference in New Issue
Block a user