From ecb4c1bff6a861f66c695ccdd3e573284142d418 Mon Sep 17 00:00:00 2001 From: analogpvt <72215823+analogpvt@users.noreply.github.com> Date: Fri, 19 May 2023 23:51:35 +0530 Subject: [PATCH] Update ChannelsTable.js --- web/src/components/ChannelsTable.js | 52 ++++++++++++++--------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/web/src/components/ChannelsTable.js b/web/src/components/ChannelsTable.js index f0f33e96..dc68b356 100644 --- a/web/src/components/ChannelsTable.js +++ b/web/src/components/ChannelsTable.js @@ -21,7 +21,7 @@ function renderType(type) { for (let i = 0; i < CHANNEL_OPTIONS.length; i++) { type2label[CHANNEL_OPTIONS[i].value] = CHANNEL_OPTIONS[i]; } - type2label[0] = { value: 0, text: '未知类型', color: 'grey' }; + type2label[0] = { value: 0, text: 'Unknown type.', color: 'grey' }; } return ; } @@ -91,7 +91,7 @@ const ChannelsTable = () => { } const { success, message } = res.data; if (success) { - showSuccess('操作成功完成!'); + showSuccess('Operation completed successfully.!'); let channel = res.data.data; let newChannels = [...channels]; let realIdx = (activePage - 1) * ITEMS_PER_PAGE + idx; @@ -109,17 +109,17 @@ const ChannelsTable = () => { const renderStatus = (status) => { switch (status) { case 1: - return ; + return ; case 2: return ( ); default: return ( ); } @@ -127,9 +127,9 @@ const ChannelsTable = () => { const renderResponseTime = (responseTime) => { let time = responseTime / 1000; - time = time.toFixed(2) + " 秒"; + time = time.toFixed(2) + " seconds"; if (responseTime === 0) { - return ; + return ; } else if (responseTime <= 1000) { return ; } else if (responseTime <= 3000) { @@ -169,7 +169,7 @@ const ChannelsTable = () => { newChannels[realIdx].response_time = time * 1000; newChannels[realIdx].test_time = Date.now() / 1000; setChannels(newChannels); - showInfo(`通道 ${name} 测试成功,耗时 ${time.toFixed(2)} 秒。`); + showInfo(`Channels ${name} Test successful, time taken ${time.toFixed(2)} seconds。`); } else { showError(message); } @@ -179,7 +179,7 @@ const ChannelsTable = () => { const res = await API.get(`/api/channel/test`); const { success, message } = res.data; if (success) { - showInfo("已成功开始测试所有已启用通道,请刷新页面查看结果。"); + showInfo("All enabled channels have been successfully tested. Please refresh the page to view the results。"); } else { showError(message); } @@ -210,7 +210,7 @@ const ChannelsTable = () => { icon='search' fluid iconPosition='left' - placeholder='搜索渠道的 ID 和名称 ...' + placeholder='Search by channel ID and name. ...' value={searchKeyword} loading={searching} onChange={handleKeywordChange} @@ -234,7 +234,7 @@ const ChannelsTable = () => { sortChannel('name'); }} > - 名称 + Name { sortChannel('type'); }} > - 类型 + Type { sortChannel('status'); }} > - 状态 + Status { sortChannel('response_time'); }} > - 响应时间 + Response time { sortChannel('test_time'); }} > - 测试时间 + Test time - 操作 + Actions @@ -283,11 +283,11 @@ const ChannelsTable = () => { return ( {channel.id} - {channel.name ? channel.name : '无'} + {channel.name ? channel.name : 'none'} {renderType(channel.type)} {renderStatus(channel.status)} {renderResponseTime(channel.response_time)} - {channel.test_time ? renderTimestamp(channel.test_time) : "未测试"} + {channel.test_time ? renderTimestamp(channel.test_time) : "Not tested."}
- 删除 + Delete } on='click' @@ -315,7 +315,7 @@ const ChannelsTable = () => { manageChannel(channel.id, 'delete', idx); }} > - 删除渠道 {channel.name} + Delete Channel {channel.name}
@@ -348,10 +348,10 @@ const ChannelsTable = () => { { (channels.length % ITEMS_PER_PAGE === 0 ? 1 : 0) } /> - +