feat: able to test all enabled channels (#59)

This commit is contained in:
JustSong
2023-05-15 12:36:55 +08:00
parent 570b3bc71c
commit d267211ee7
5 changed files with 116 additions and 13 deletions

View File

@@ -170,6 +170,16 @@ const ChannelsTable = () => {
}
};
const testAllChannels = async () => {
const res = await API.get(`/api/channel/test`);
const { success, message } = res.data;
if (success) {
showSuccess("已成功开始测试所有已启用通道,请刷新页面查看结果。");
} else {
showError(message);
}
}
const handleKeywordChange = async (e, { value }) => {
setSearchKeyword(value.trim());
};
@@ -335,6 +345,9 @@ const ChannelsTable = () => {
<Button size='small' as={Link} to='/channel/add' loading={loading}>
添加新的渠道
</Button>
<Button size='small' loading={loading} onClick={testAllChannels}>
测试所有已启用通道
</Button>
<Pagination
floated='right'
activePage={activePage}