mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-26 04:02:47 +00:00
Feat: delete and toggle node
This commit is contained in:
parent
f71a9ddd41
commit
ee4eff7d7a
|
|
@ -141,6 +141,21 @@ export default function Node() {
|
|||
});
|
||||
};
|
||||
|
||||
const deleteNode = (id) => {
|
||||
setLoading(true);
|
||||
API.delete("/admin/node/" + id)
|
||||
.then(() => {
|
||||
loadList();
|
||||
ToggleSnackbar("top", "right", "节点已删除", "success");
|
||||
})
|
||||
.catch((error) => {
|
||||
ToggleSnackbar("top", "right", error.message, "error");
|
||||
})
|
||||
.then(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
loadList();
|
||||
}, [page, pageSize]);
|
||||
|
|
@ -286,6 +301,9 @@ export default function Node() {
|
|||
</Tooltip>
|
||||
<Tooltip title={"删除"}>
|
||||
<IconButton
|
||||
onClick={() =>
|
||||
deleteNode(row.ID)
|
||||
}
|
||||
disabled={loading}
|
||||
size={"small"}
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in New Issue