ChannelsTable.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. import React, {useEffect, useState} from 'react';
  2. import {
  3. API,
  4. isMobile,
  5. shouldShowPrompt,
  6. showError,
  7. showInfo,
  8. showSuccess,
  9. timestamp2string
  10. } from '../helpers';
  11. import {CHANNEL_OPTIONS, ITEMS_PER_PAGE} from '../constants';
  12. import {renderGroup, renderNumber, renderNumberWithPoint, renderQuota, renderQuotaWithPrompt} from '../helpers/render';
  13. import {
  14. Avatar,
  15. Tag,
  16. Table,
  17. Button,
  18. Popover,
  19. Form,
  20. Modal,
  21. Popconfirm,
  22. Space,
  23. Tooltip,
  24. Switch,
  25. Typography, InputNumber
  26. } from "@douyinfe/semi-ui";
  27. import EditChannel from "../pages/Channel/EditChannel";
  28. function renderTimestamp(timestamp) {
  29. return (
  30. <>
  31. {timestamp2string(timestamp)}
  32. </>
  33. );
  34. }
  35. let type2label = undefined;
  36. function renderType(type) {
  37. if (!type2label) {
  38. type2label = new Map;
  39. for (let i = 0; i < CHANNEL_OPTIONS.length; i++) {
  40. type2label[CHANNEL_OPTIONS[i].value] = CHANNEL_OPTIONS[i];
  41. }
  42. type2label[0] = {value: 0, text: '未知类型', color: 'grey'};
  43. }
  44. return <Tag size='large' color={type2label[type]?.color}>{type2label[type]?.text}</Tag>;
  45. }
  46. function renderBalance(type, balance) {
  47. switch (type) {
  48. case 1: // OpenAI
  49. return <span>${balance.toFixed(2)}</span>;
  50. case 4: // CloseAI
  51. return <span>¥{balance.toFixed(2)}</span>;
  52. case 8: // 自定义
  53. return <span>${balance.toFixed(2)}</span>;
  54. case 5: // OpenAI-SB
  55. return <span>¥{(balance / 10000).toFixed(2)}</span>;
  56. case 10: // AI Proxy
  57. return <span>{renderNumber(balance)}</span>;
  58. case 12: // API2GPT
  59. return <span>¥{balance.toFixed(2)}</span>;
  60. case 13: // AIGC2D
  61. return <span>{renderNumber(balance)}</span>;
  62. default:
  63. return <span>不支持</span>;
  64. }
  65. }
  66. const ChannelsTable = () => {
  67. const columns = [
  68. // {
  69. // title: '',
  70. // dataIndex: 'checkbox',
  71. // className: 'checkbox',
  72. // },
  73. {
  74. title: 'ID',
  75. dataIndex: 'id',
  76. },
  77. {
  78. title: '名称',
  79. dataIndex: 'name',
  80. },
  81. {
  82. title: '分组',
  83. dataIndex: 'group',
  84. render: (text, record, index) => {
  85. return (
  86. <div>
  87. <Space spacing={2}>
  88. {
  89. text.split(',').map((item, index) => {
  90. return (renderGroup(item))
  91. })
  92. }
  93. </Space>
  94. </div>
  95. );
  96. },
  97. },
  98. {
  99. title: '类型',
  100. dataIndex: 'type',
  101. render: (text, record, index) => {
  102. return (
  103. <div>
  104. {renderType(text)}
  105. </div>
  106. );
  107. },
  108. },
  109. {
  110. title: '状态',
  111. dataIndex: 'status',
  112. render: (text, record, index) => {
  113. return (
  114. <div>
  115. {renderStatus(text)}
  116. </div>
  117. );
  118. },
  119. },
  120. {
  121. title: '响应时间',
  122. dataIndex: 'response_time',
  123. render: (text, record, index) => {
  124. return (
  125. <div>
  126. {renderResponseTime(text)}
  127. </div>
  128. );
  129. },
  130. },
  131. {
  132. title: '已用/剩余',
  133. dataIndex: 'expired_time',
  134. render: (text, record, index) => {
  135. return (
  136. <div>
  137. <Space spacing={1}>
  138. <Tooltip content={'已用额度'}>
  139. <Tag color='white' type='ghost' size='large'>{renderQuota(record.used_quota)}</Tag>
  140. </Tooltip>
  141. <Tooltip content={'剩余额度' + record.balance + ',点击更新'}>
  142. <Tag color='white' type='ghost' size='large' onClick={() => {updateChannelBalance(record)}}>${renderNumberWithPoint(record.balance)}</Tag>
  143. </Tooltip>
  144. </Space>
  145. </div>
  146. );
  147. },
  148. },
  149. {
  150. title: '优先级',
  151. dataIndex: 'priority',
  152. render: (text, record, index) => {
  153. return (
  154. <div>
  155. <InputNumber
  156. style={{width: 70}}
  157. name='priority'
  158. onChange={value => {
  159. manageChannel(record.id, 'priority', record, value);
  160. }}
  161. defaultValue={record.priority}
  162. min={-999}
  163. />
  164. </div>
  165. );
  166. },
  167. },
  168. {
  169. title: '权重',
  170. dataIndex: 'weight',
  171. render: (text, record, index) => {
  172. return (
  173. <div>
  174. <InputNumber
  175. style={{width: 70}}
  176. name='weight'
  177. onChange={value => {
  178. manageChannel(record.id, 'weight', record, value);
  179. }}
  180. defaultValue={record.weight}
  181. min={0}
  182. />
  183. </div>
  184. );
  185. },
  186. },
  187. {
  188. title: '',
  189. dataIndex: 'operate',
  190. render: (text, record, index) => (
  191. <div>
  192. <Button theme='light' type='primary' style={{marginRight: 1}} onClick={()=>testChannel(record)}>测试</Button>
  193. <Popconfirm
  194. title="确定是否要删除此渠道?"
  195. content="此修改将不可逆"
  196. okType={'danger'}
  197. position={'left'}
  198. onConfirm={() => {
  199. manageChannel(record.id, 'delete', record).then(
  200. () => {
  201. removeRecord(record.id);
  202. }
  203. )
  204. }}
  205. >
  206. <Button theme='light' type='danger' style={{marginRight: 1}}>删除</Button>
  207. </Popconfirm>
  208. {
  209. record.status === 1 ?
  210. <Button theme='light' type='warning' style={{marginRight: 1}} onClick={
  211. async () => {
  212. manageChannel(
  213. record.id,
  214. 'disable',
  215. record
  216. )
  217. }
  218. }>禁用</Button> :
  219. <Button theme='light' type='secondary' style={{marginRight: 1}} onClick={
  220. async () => {
  221. manageChannel(
  222. record.id,
  223. 'enable',
  224. record
  225. );
  226. }
  227. }>启用</Button>
  228. }
  229. <Button theme='light' type='tertiary' style={{marginRight: 1}} onClick={
  230. () => {
  231. setEditingChannel(record);
  232. setShowEdit(true);
  233. }
  234. }>编辑</Button>
  235. </div>
  236. ),
  237. },
  238. ];
  239. const [channels, setChannels] = useState([]);
  240. const [loading, setLoading] = useState(true);
  241. const [activePage, setActivePage] = useState(1);
  242. const [idSort, setIdSort] = useState(false);
  243. const [searchKeyword, setSearchKeyword] = useState('');
  244. const [searchGroup, setSearchGroup] = useState('');
  245. const [searching, setSearching] = useState(false);
  246. const [updatingBalance, setUpdatingBalance] = useState(false);
  247. const [pageSize, setPageSize] = useState(ITEMS_PER_PAGE);
  248. const [showPrompt, setShowPrompt] = useState(shouldShowPrompt("channel-test"));
  249. const [channelCount, setChannelCount] = useState(pageSize);
  250. const [groupOptions, setGroupOptions] = useState([]);
  251. const [showEdit, setShowEdit] = useState(false);
  252. const [enableBatchDelete, setEnableBatchDelete] = useState(false);
  253. const [editingChannel, setEditingChannel] = useState({
  254. id: undefined,
  255. });
  256. const [selectedChannels, setSelectedChannels] = useState([]);
  257. const removeRecord = id => {
  258. let newDataSource = [...channels];
  259. if (id != null) {
  260. let idx = newDataSource.findIndex(data => data.id === id);
  261. if (idx > -1) {
  262. newDataSource.splice(idx, 1);
  263. setChannels(newDataSource);
  264. }
  265. }
  266. };
  267. const setChannelFormat = (channels) => {
  268. for (let i = 0; i < channels.length; i++) {
  269. channels[i].key = '' + channels[i].id;
  270. }
  271. // data.key = '' + data.id
  272. setChannels(channels);
  273. if (channels.length >= pageSize) {
  274. setChannelCount(channels.length + pageSize);
  275. } else {
  276. setChannelCount(channels.length);
  277. }
  278. }
  279. const loadChannels = async (startIdx, pageSize, idSort) => {
  280. setLoading(true);
  281. const res = await API.get(`/api/channel/?p=${startIdx}&page_size=${pageSize}&id_sort=${idSort}`);
  282. const {success, message, data} = res.data;
  283. if (success) {
  284. if (startIdx === 0) {
  285. setChannelFormat(data);
  286. } else {
  287. let newChannels = [...channels];
  288. newChannels.splice(startIdx * pageSize, data.length, ...data);
  289. setChannelFormat(newChannels);
  290. }
  291. } else {
  292. showError(message);
  293. }
  294. setLoading(false);
  295. };
  296. const refresh = async () => {
  297. await loadChannels(activePage - 1, pageSize, idSort);
  298. };
  299. useEffect(() => {
  300. // console.log('default effect')
  301. const localIdSort = localStorage.getItem('id-sort') === 'true';
  302. setIdSort(localIdSort)
  303. loadChannels(0, pageSize, localIdSort)
  304. .then()
  305. .catch((reason) => {
  306. showError(reason);
  307. });
  308. fetchGroups().then();
  309. }, []);
  310. // useEffect(() => {
  311. // console.log('search effect')
  312. // searchChannels()
  313. // }, [searchGroup]);
  314. // useEffect(() => {
  315. // localStorage.setItem('id-sort', idSort + '');
  316. // refresh()
  317. // }, [idSort]);
  318. const manageChannel = async (id, action, record, value) => {
  319. let data = {id};
  320. let res;
  321. switch (action) {
  322. case 'delete':
  323. res = await API.delete(`/api/channel/${id}/`);
  324. break;
  325. case 'enable':
  326. data.status = 1;
  327. res = await API.put('/api/channel/', data);
  328. break;
  329. case 'disable':
  330. data.status = 2;
  331. res = await API.put('/api/channel/', data);
  332. break;
  333. case 'priority':
  334. if (value === '') {
  335. return;
  336. }
  337. data.priority = parseInt(value);
  338. res = await API.put('/api/channel/', data);
  339. break;
  340. case 'weight':
  341. if (value === '') {
  342. return;
  343. }
  344. data.weight = parseInt(value);
  345. if (data.weight < 0) {
  346. data.weight = 0;
  347. }
  348. res = await API.put('/api/channel/', data);
  349. break;
  350. }
  351. const {success, message} = res.data;
  352. if (success) {
  353. showSuccess('操作成功完成!');
  354. let channel = res.data.data;
  355. let newChannels = [...channels];
  356. if (action === 'delete') {
  357. } else {
  358. record.status = channel.status;
  359. }
  360. setChannels(newChannels);
  361. } else {
  362. showError(message);
  363. }
  364. };
  365. const renderStatus = (status) => {
  366. switch (status) {
  367. case 1:
  368. return <Tag size='large' color='green'>已启用</Tag>;
  369. case 2:
  370. return (
  371. <Tag size='large' color='yellow'>
  372. 已禁用
  373. </Tag>
  374. );
  375. case 3:
  376. return (
  377. <Tag size='large' color='yellow'>
  378. 自动禁用
  379. </Tag>
  380. );
  381. default:
  382. return (
  383. <Tag size='large' color='grey'>
  384. 未知状态
  385. </Tag>
  386. );
  387. }
  388. };
  389. const renderResponseTime = (responseTime) => {
  390. let time = responseTime / 1000;
  391. time = time.toFixed(2) + ' 秒';
  392. if (responseTime === 0) {
  393. return <Tag size='large' color='grey'>未测试</Tag>;
  394. } else if (responseTime <= 1000) {
  395. return <Tag size='large' color='green'>{time}</Tag>;
  396. } else if (responseTime <= 3000) {
  397. return <Tag size='large' color='lime'>{time}</Tag>;
  398. } else if (responseTime <= 5000) {
  399. return <Tag size='large' color='yellow'>{time}</Tag>;
  400. } else {
  401. return <Tag size='large' color='red'>{time}</Tag>;
  402. }
  403. };
  404. const searchChannels = async (searchKeyword, searchGroup) => {
  405. if (searchKeyword === '' && searchGroup === '') {
  406. // if keyword is blank, load files instead.
  407. await loadChannels(0, pageSize, idSort);
  408. setActivePage(1);
  409. return;
  410. }
  411. setSearching(true);
  412. const res = await API.get(`/api/channel/search?keyword=${searchKeyword}&group=${searchGroup}`);
  413. const {success, message, data} = res.data;
  414. if (success) {
  415. setChannels(data);
  416. setActivePage(1);
  417. } else {
  418. showError(message);
  419. }
  420. setSearching(false);
  421. };
  422. const testChannel = async (record) => {
  423. const res = await API.get(`/api/channel/test/${record.id}/`);
  424. const {success, message, time} = res.data;
  425. if (success) {
  426. let newChannels = [...channels];
  427. record.response_time = time * 1000;
  428. record.test_time = Date.now() / 1000;
  429. setChannels(newChannels);
  430. showInfo(`通道 ${record.name} 测试成功,耗时 ${time.toFixed(2)} 秒。`);
  431. } else {
  432. showError(message);
  433. }
  434. };
  435. const testAllChannels = async () => {
  436. const res = await API.get(`/api/channel/test`);
  437. const {success, message} = res.data;
  438. if (success) {
  439. showInfo('已成功开始测试所有已启用通道,请刷新页面查看结果。');
  440. } else {
  441. showError(message);
  442. }
  443. };
  444. const deleteAllDisabledChannels = async () => {
  445. const res = await API.delete(`/api/channel/disabled`);
  446. const {success, message, data} = res.data;
  447. if (success) {
  448. showSuccess(`已删除所有禁用渠道,共计 ${data} 个`);
  449. await refresh();
  450. } else {
  451. showError(message);
  452. }
  453. };
  454. const updateChannelBalance = async (record) => {
  455. const res = await API.get(`/api/channel/update_balance/${record.id}/`);
  456. const {success, message, balance} = res.data;
  457. if (success) {
  458. record.balance = balance;
  459. record.balance_updated_time = Date.now() / 1000;
  460. showInfo(`通道 ${record.name} 余额更新成功!`);
  461. } else {
  462. showError(message);
  463. }
  464. };
  465. const updateAllChannelsBalance = async () => {
  466. setUpdatingBalance(true);
  467. const res = await API.get(`/api/channel/update_balance`);
  468. const {success, message} = res.data;
  469. if (success) {
  470. showInfo('已更新完毕所有已启用通道余额!');
  471. } else {
  472. showError(message);
  473. }
  474. setUpdatingBalance(false);
  475. };
  476. const batchDeleteChannels = async () => {
  477. if (selectedChannels.length === 0) {
  478. showError('请先选择要删除的通道!');
  479. return;
  480. }
  481. setLoading(true);
  482. let ids = [];
  483. selectedChannels.forEach((channel) => {
  484. ids.push(channel.id);
  485. });
  486. const res = await API.post(`/api/channel/batch`, {ids: ids});
  487. const {success, message, data} = res.data;
  488. if (success) {
  489. showSuccess(`已删除 ${data} 个通道!`);
  490. await refresh();
  491. } else {
  492. showError(message);
  493. }
  494. setLoading(false);
  495. }
  496. const fixChannelsAbilities = async () => {
  497. const res = await API.post(`/api/channel/fix`);
  498. const {success, message, data} = res.data;
  499. if (success) {
  500. showSuccess(`已修复 ${data} 个通道!`);
  501. await refresh();
  502. } else {
  503. showError(message);
  504. }
  505. }
  506. const sortChannel = (key) => {
  507. if (channels.length === 0) return;
  508. setLoading(true);
  509. let sortedChannels = [...channels];
  510. if (typeof sortedChannels[0][key] === 'string') {
  511. sortedChannels.sort((a, b) => {
  512. return ('' + a[key]).localeCompare(b[key]);
  513. });
  514. } else {
  515. sortedChannels.sort((a, b) => {
  516. if (a[key] === b[key]) return 0;
  517. if (a[key] > b[key]) return -1;
  518. if (a[key] < b[key]) return 1;
  519. });
  520. }
  521. if (sortedChannels[0].id === channels[0].id) {
  522. sortedChannels.reverse();
  523. }
  524. setChannels(sortedChannels);
  525. setLoading(false);
  526. };
  527. let pageData = channels.slice((activePage - 1) * pageSize, activePage * pageSize);
  528. const handlePageChange = page => {
  529. setActivePage(page);
  530. if (page === Math.ceil(channels.length / pageSize) + 1) {
  531. // In this case we have to load more data and then append them.
  532. loadChannels(page - 1, pageSize, idSort).then(r => {
  533. });
  534. }
  535. };
  536. const handlePageSizeChange = async(size) => {
  537. setPageSize(size)
  538. setActivePage(1)
  539. loadChannels(0, size, idSort)
  540. .then()
  541. .catch((reason) => {
  542. showError(reason);
  543. })
  544. };
  545. const fetchGroups = async () => {
  546. try {
  547. let res = await API.get(`/api/group/`);
  548. // add 'all' option
  549. // res.data.data.unshift('all');
  550. setGroupOptions(res.data.data.map((group) => ({
  551. label: group,
  552. value: group,
  553. })));
  554. } catch (error) {
  555. showError(error.message);
  556. }
  557. };
  558. const closeEdit = () => {
  559. setShowEdit(false);
  560. }
  561. const handleRow = (record, index) => {
  562. if (record.status !== 1) {
  563. return {
  564. style: {
  565. background: 'var(--semi-color-disabled-border)',
  566. },
  567. };
  568. } else {
  569. return {};
  570. }
  571. };
  572. return (
  573. <>
  574. <EditChannel refresh={refresh} visible={showEdit} handleClose={closeEdit} editingChannel={editingChannel}/>
  575. <Form onSubmit={() => {searchChannels(searchKeyword, searchGroup)}} labelPosition='left'>
  576. <div style={{display: 'flex'}}>
  577. <Space>
  578. <Form.Input
  579. field='search'
  580. label='关键词'
  581. placeholder='ID,名称和密钥 ...'
  582. value={searchKeyword}
  583. loading={searching}
  584. onChange={(v)=>{
  585. setSearchKeyword(v.trim())
  586. }}
  587. />
  588. <Form.Select field="group" label='分组' optionList={groupOptions} onChange={(v) => {
  589. setSearchGroup(v)
  590. searchChannels(searchKeyword, v)
  591. }}/>
  592. </Space>
  593. </div>
  594. </Form>
  595. <div style={{marginTop: 10, display: 'flex'}}>
  596. <Space>
  597. <Space>
  598. <Typography.Text strong>使用ID排序</Typography.Text>
  599. <Switch checked={idSort} label='使用ID排序' uncheckedText="关" aria-label="是否用ID排序" onChange={(v) => {
  600. localStorage.setItem('id-sort', v + '')
  601. setIdSort(v)
  602. loadChannels(0, pageSize, v)
  603. .then()
  604. .catch((reason) => {
  605. showError(reason);
  606. })
  607. }}></Switch>
  608. </Space>
  609. </Space>
  610. </div>
  611. <Table style={{marginTop: 15}} columns={columns} dataSource={pageData} pagination={{
  612. currentPage: activePage,
  613. pageSize: pageSize,
  614. total: channelCount,
  615. pageSizeOpts: [10, 20, 50, 100],
  616. showSizeChanger: true,
  617. formatPageText:(page) => '',
  618. onPageSizeChange: (size) => {
  619. handlePageSizeChange(size).then()
  620. },
  621. onPageChange: handlePageChange,
  622. }} loading={loading} onRow={handleRow} rowSelection={
  623. enableBatchDelete ?
  624. {
  625. onChange: (selectedRowKeys, selectedRows) => {
  626. // console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
  627. setSelectedChannels(selectedRows);
  628. },
  629. } : null
  630. }/>
  631. <div style={{display: isMobile()?'':'flex', marginTop: isMobile()?0:-45, zIndex: 999, position: 'relative', pointerEvents: 'none'}}>
  632. <Space style={{pointerEvents: 'auto'}}>
  633. <Button theme='light' type='primary' style={{marginRight: 8}} onClick={
  634. () => {
  635. setEditingChannel({
  636. id: undefined,
  637. });
  638. setShowEdit(true)
  639. }
  640. }>添加渠道</Button>
  641. <Popconfirm
  642. title="确定?"
  643. okType={'warning'}
  644. onConfirm={testAllChannels}
  645. position={isMobile()?'top':'top'}
  646. >
  647. <Button theme='light' type='warning' style={{marginRight: 8}}>测试所有已启用通道</Button>
  648. </Popconfirm>
  649. <Popconfirm
  650. title="确定?"
  651. okType={'secondary'}
  652. onConfirm={updateAllChannelsBalance}
  653. >
  654. <Button theme='light' type='secondary' style={{marginRight: 8}}>更新所有已启用通道余额</Button>
  655. </Popconfirm>
  656. <Popconfirm
  657. title="确定是否要删除禁用通道?"
  658. content="此修改将不可逆"
  659. okType={'danger'}
  660. onConfirm={deleteAllDisabledChannels}
  661. >
  662. <Button theme='light' type='danger' style={{marginRight: 8}}>删除禁用通道</Button>
  663. </Popconfirm>
  664. <Button theme='light' type='primary' style={{marginRight: 8}} onClick={refresh}>刷新</Button>
  665. </Space>
  666. {/*<div style={{width: '100%', pointerEvents: 'none', position: 'absolute'}}>*/}
  667. {/*</div>*/}
  668. </div>
  669. <div style={{marginTop: 20}}>
  670. <Space>
  671. <Typography.Text strong>开启批量删除</Typography.Text>
  672. <Switch label='开启批量删除' uncheckedText="关" aria-label="是否开启批量删除" onChange={(v) => {
  673. setEnableBatchDelete(v)
  674. }}></Switch>
  675. <Popconfirm
  676. title="确定是否要删除所选通道?"
  677. content="此修改将不可逆"
  678. okType={'danger'}
  679. onConfirm={batchDeleteChannels}
  680. disabled={!enableBatchDelete}
  681. position={'top'}
  682. >
  683. <Button disabled={!enableBatchDelete} theme='light' type='danger' style={{marginRight: 8}}>删除所选通道</Button>
  684. </Popconfirm>
  685. <Popconfirm
  686. title="确定是否要修复数据库一致性?"
  687. content="进行该操作时,可能导致渠道访问错误,请仅在数据库出现问题时使用"
  688. okType={'warning'}
  689. onConfirm={fixChannelsAbilities}
  690. position={'top'}
  691. >
  692. <Button theme='light' type='secondary' style={{marginRight: 8}}>修复数据库一致性</Button>
  693. </Popconfirm>
  694. </Space>
  695. </div>
  696. </>
  697. );
  698. };
  699. export default ChannelsTable;