From 655722641bfda646b96687e95f28aada055e46be Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Tue, 5 Dec 2023 21:26:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B8=A0=E9=81=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=B2=A1=E6=9C=89=E6=B5=8B=E8=AF=95=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/ChannelsTable.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/src/components/ChannelsTable.js b/web/src/components/ChannelsTable.js index 7446097..b6c3d4e 100644 --- a/web/src/components/ChannelsTable.js +++ b/web/src/components/ChannelsTable.js @@ -165,6 +165,7 @@ const ChannelsTable = () => { dataIndex: 'operate', render: (text, record, index) => (
+ { setSearching(false); }; - const testChannel = async (id, name, idx) => { - const res = await API.get(`/api/channel/test/${id}/`); + const testChannel = async (record) => { + const res = await API.get(`/api/channel/test/${record.id}/`); const {success, message, time} = res.data; if (success) { let newChannels = [...channels]; - let realIdx = (activePage - 1) * pageSize + idx; - newChannels[realIdx].response_time = time * 1000; - newChannels[realIdx].test_time = Date.now() / 1000; + record.response_time = time * 1000; + record.test_time = Date.now() / 1000; setChannels(newChannels); - showInfo(`通道 ${name} 测试成功,耗时 ${time.toFixed(2)} 秒。`); + showInfo(`通道 ${record.name} 测试成功,耗时 ${time.toFixed(2)} 秒。`); } else { showError(message); }