内容管理
浏览与处理帖子/评论,含回收站恢复与彻底删除;策略开关仅超管/站长可改
{canConfigureSettings && (
已过审用户后续免审
开启后,已有过审内容的用户后续发帖与评论将直接公开。默认开启。
void toggleTrust()}
label="已过审用户后续免审"
/>
)}
{(
[
{ key: "posts" as Kind, label: "帖子", icon: , count: counts.posts_live },
{
key: "comments" as Kind,
label: "评论",
icon: ,
count: counts.comments_live,
},
]
).map((t) => {
const active = kind === t.key;
return (
);
})}
{STATUS_TABS.map((t) => {
const active = status === t.key;
const cnt = statusCount(t.key);
return (
);
})}
{loading ? (
加载中…
) : error ? (
{error}
) : kind === "posts" && posts.length === 0 ? (
暂无帖子
) : kind === "comments" && comments.length === 0 ? (
暂无评论
) : kind === "posts" ? (
posts.map((p) => {
const key = `p-${p.id}`;
const busy = actingKey === key;
return (
{statusLabel(p.status, p.deleted)}
{p.board?.name}
{formatRelative(p.created_at)}
{p.deleted ? (
{p.title}
) : (
{p.title}
)}
{p.user?.nickname} · {p.comment_count} 评
{p.deleted ? (
<>
>
) : (
)}
);
})
) : (
comments.map((c) => {
const key = `c-${c.id}`;
const busy = actingKey === key;
return (
{statusLabel(c.status, c.deleted)}
{c.board?.name}
{formatRelative(c.created_at)}
{excerpt(c.content)}
{c.user?.nickname} ·{" "}
{c.deleted ? (
c.post_title
) : (
{c.post_title || `帖子 #${c.post_id}`}
)}
{c.deleted ? (
<>
>
) : (
)}
);
})
)}
{totalPages > 1 && (
{page} / {totalPages}
)}
!confirmBusy && setConfirm(null)}
onConfirm={() => {
if (!confirm) return;
setConfirmBusy(true);
confirm
.run()
.catch((e) => toast(e instanceof Error ? e.message : "操作失败"))
.finally(() => {
setConfirmBusy(false);
setConfirm(null);
});
}}
/>
!staffDeleteBusy && setStaffDeletePost(null)}
onConfirm={(opts) => {
if (!staffDeletePost) return;
setStaffDeleteBusy(true);
apiAdminSoftDeletePost(staffDeletePost.id, opts)
.then(() => {
toast("已移入回收站", "ok");
setStaffDeletePost(null);
reload(postsPage);
})
.catch((e) => toast(e instanceof Error ? e.message : "操作失败"))
.finally(() => setStaffDeleteBusy(false));
}}
/>
!staffDeleteCommentBusy && setStaffDeleteComment(null)}
onConfirm={(opts) => {
if (!staffDeleteComment) return;
setStaffDeleteCommentBusy(true);
apiAdminSoftDeleteComment(staffDeleteComment.id, opts)
.then(() => {
toast("已移入回收站", "ok");
setStaffDeleteComment(null);
reload(commentsPage);
})
.catch((e) => toast(e instanceof Error ? e.message : "操作失败"))
.finally(() => setStaffDeleteCommentBusy(false));
}}
/>
);
}