diff --git a/web/air/src/components/ChannelsTable.js b/web/air/src/components/ChannelsTable.js index 144842ee..5de123ce 100644 --- a/web/air/src/components/ChannelsTable.js +++ b/web/air/src/components/ChannelsTable.js @@ -4,18 +4,18 @@ import { API, isMobile, shouldShowPrompt, showError, showInfo, showSuccess, time import { CHANNEL_OPTIONS, ITEMS_PER_PAGE } from '../constants'; import { renderGroup, renderNumberWithPoint, renderQuota } from '../helpers/render'; import { - Button, - Dropdown, - Form, - InputNumber, - Popconfirm, - Space, - SplitButtonGroup, - Switch, - Table, - Tag, - Tooltip, - Typography + Button, + Dropdown, + Form, + InputNumber, + Popconfirm, + Space, + SplitButtonGroup, + Switch, + Table, + Tag, + Tooltip, + Typography } from '@douyinfe/semi-ui'; import EditChannel from '../pages/Channel/EditChannel'; import { IconTreeTriangleDown } from '@douyinfe/semi-icons'; @@ -56,23 +56,23 @@ const ChannelsTable = () => { title: '名称', dataIndex: 'name' }, - { - title: '分组', - dataIndex: 'group', - render: (text, record, index) => { - return ( -
- - { - text.split(',').map((item, index) => { - return (renderGroup(item)); - }) - } - -
- ); - } - }, + // { + // title: '分组', + // dataIndex: 'group', + // render: (text, record, index) => { + // return ( + //
+ // + // { + // text.split(',').map((item, index) => { + // return (renderGroup(item)); + // }) + // } + // + //
+ // ); + // } + // }, { title: '类型', dataIndex: 'type', @@ -147,33 +147,33 @@ const ChannelsTable = () => { ); } }, - { - title: '权重', - dataIndex: 'weight', - render: (text, record, index) => { - return ( -
- { - manageChannel(record.id, 'weight', record, e.target.value); - }} - keepFocus={true} - innerButtons - defaultValue={record.weight} - min={0} - /> -
- ); - } - }, + // { + // title: '权重', + // dataIndex: 'weight', + // render: (text, record, index) => { + // return ( + //
+ // { + // manageChannel(record.id, 'weight', record, e.target.value); + // }} + // keepFocus={true} + // innerButtons + // defaultValue={record.weight} + // min={0} + // /> + //
+ // ); + // } + // }, { title: '', dataIndex: 'operate', render: (text, record, index) => (
- + {/* @@ -181,8 +181,8 @@ 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); } @@ -576,22 +576,23 @@ const ChannelsTable = () => { return ( <> -
{ - searchChannels(searchKeyword, searchGroup, searchModel); - }} labelPosition="left"> -
- - { - setSearchKeyword(v.trim()); - }} - /> - + { + searchChannels(searchKeyword, searchGroup, searchModel); + }} labelPosition="left"> +
+ + { + setSearchKeyword(v.trim()); + }} + /> + {/* { { setSearchGroup(v); searchChannels(searchKeyword, v, searchModel); - }} /> - + }} /> */} + + +
+ +
+ + + { testChannels("all") }} + position={isMobile() ? 'top' : 'top'} + > + + + { testChannels("disabled") }} + position={isMobile() ? 'top' : 'top'} + > + + + {/* + + */} + + + + + + + {/*
*/} + + {/*
*/} +
+ {/*
+ + 开启批量删除 + { + setEnableBatchDelete(v); + }}> + + + + + +
- -
- +
- 使用ID排序 - { - localStorage.setItem('id-sort', v + ''); - setIdSort(v); - loadChannels(0, pageSize, v) - .then() - .catch((reason) => { - showError(reason); - }); - }}> + + 使用ID排序 + { + localStorage.setItem('id-sort', v + ''); + setIdSort(v); + loadChannels(0, pageSize, v) + .then() + .catch((reason) => { + showError(reason); + }); + }}> + - +
*/}
- { } } : null } /> -
- - - - - - - - - - - - - - - {/*
*/} - - {/*
*/} -
-
- - 开启批量删除 - { - setEnableBatchDelete(v); - }}> - - - - - - - -
); };