Skip to content

Commit 1097566

Browse files
committed
fix: fix webhook ui
1 parent 981539b commit 1097566

File tree

1 file changed

+49
-29
lines changed

1 file changed

+49
-29
lines changed

web/src/components/WebhooksTable.js

Lines changed: 49 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import React, { useEffect, useState } from 'react';
2-
import { Button, Form, Label, Pagination, Table, Popup } from 'semantic-ui-react';
2+
import {
3+
Button,
4+
Form,
5+
Label,
6+
Pagination,
7+
Popup,
8+
Table,
9+
} from 'semantic-ui-react';
310
import { Link } from 'react-router-dom';
411
import { API, copy, showError, showSuccess, showWarning } from '../helpers';
512

@@ -239,36 +246,28 @@ const WebhooksTable = () => {
239246
</Table.Cell>
240247
<Table.Cell>
241248
<div>
242-
<Popup content={webhookUrl} hoverable trigger={
243-
<Button
244-
size={'small'}
245-
positive
246-
onClick={async () => {
247-
if (
248-
await copy(
249-
webhookUrl
250-
)
251-
) {
252-
showSuccess('已复制到剪贴板!');
253-
} else {
254-
showWarning('无法复制到剪贴板!');
255-
}
256-
}}
257-
>
258-
复制 Webhook 链接
259-
</Button>
260-
} />
261-
<Button
262-
size={'small'}
263-
negative
264-
onClick={() => {
265-
manageWebhook(webhook.id, 'delete', idx).then();
266-
}}
267-
>
268-
删除
269-
</Button>
249+
<Popup
250+
content={webhookUrl}
251+
hoverable
252+
trigger={
253+
<Button
254+
size={'small'}
255+
positive
256+
onClick={async () => {
257+
if (await copy(webhookUrl)) {
258+
showSuccess('已复制到剪贴板!');
259+
} else {
260+
showWarning('无法复制到剪贴板!');
261+
}
262+
}}
263+
>
264+
复制 Webhook 链接
265+
</Button>
266+
}
267+
/>
270268
<Button
271269
size={'small'}
270+
color={'yellow'}
272271
onClick={() => {
273272
manageWebhook(
274273
webhook.id,
@@ -281,11 +280,32 @@ const WebhooksTable = () => {
281280
</Button>
282281
<Button
283282
size={'small'}
283+
primary
284284
as={Link}
285285
to={'/webhook/edit/' + webhook.id}
286286
>
287287
编辑
288288
</Button>
289+
<Popup
290+
trigger={
291+
<Button size='small' negative>
292+
删除
293+
</Button>
294+
}
295+
on='click'
296+
flowing
297+
hoverable
298+
>
299+
<Button
300+
size={'small'}
301+
negative
302+
onClick={() => {
303+
manageWebhook(webhook.id, 'delete', idx).then();
304+
}}
305+
>
306+
删除 {webhook.name}
307+
</Button>
308+
</Popup>
289309
</div>
290310
</Table.Cell>
291311
</Table.Row>

0 commit comments

Comments
 (0)