feat: able to only test disabled channels (#1090)

This commit is contained in:
JustSong
2024-03-10 18:34:57 +08:00
parent b09f979b80
commit 71c61365eb
6 changed files with 25 additions and 15 deletions

View File

@@ -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