chore: update channel table ui

This commit is contained in:
JustSong
2024-11-10 11:39:45 +08:00
parent 755725205b
commit ad2fd6bf90
2 changed files with 80 additions and 29 deletions
+35 -11
View File
@@ -1,5 +1,12 @@
import React, { useEffect, useState } from 'react';
import { Button, Form, Label, Pagination, Table } from 'semantic-ui-react';
import {
Button,
Form,
Label,
Pagination,
Popup,
Table,
} from 'semantic-ui-react';
import { Link } from 'react-router-dom';
import { API, showError, showSuccess, testChannel } from '../helpers';
@@ -246,24 +253,21 @@ const ChannelsTable = () => {
<Table.Cell>
<div>
<Button
size={'small'}
negative
onClick={() => {
manageChannel(channel.id, 'delete', idx).then();
}}
>
删除
</Button>
<Button
positive
size={'small'}
onClick={() => {
testChannel(user.username, user.token, channel.name).then();
testChannel(
user.username,
user.token,
channel.name
).then();
}}
>
测试
</Button>
<Button
size={'small'}
color={'yellow'}
onClick={() => {
manageChannel(
channel.id,
@@ -281,6 +285,26 @@ const ChannelsTable = () => {
>
编辑
</Button>
<Popup
trigger={
<Button size='small' negative>
删除
</Button>
}
on='click'
flowing
hoverable
>
<Button
size={'small'}
negative
onClick={() => {
manageChannel(channel.id, 'delete', idx).then();
}}
>
删除通道 {channel.name}
</Button>
</Popup>
</div>
</Table.Cell>
</Table.Row>