feat: add a service for periodic cleanup of error accounts based on configuration.

This commit is contained in:
2026-02-01 06:02:39 +08:00
parent e867bc5cbd
commit 14a07e741e
5 changed files with 85 additions and 10 deletions

View File

@@ -396,6 +396,31 @@ export default function Cleaner() {
<span className="text-sm text-slate-500 dark:text-slate-400">
{logTotal}
</span>
<Button
variant="outline"
size="sm"
onClick={async () => {
if (!confirm('确定要清空所有清理日志吗?此操作不可撤销。')) return
try {
const res = await fetch('/api/logs/clear-module?module=cleaner', { method: 'POST' })
const data = await res.json()
if (data.code === 0) {
setLogEntries([])
setLogTotal(0)
setLogTotalPages(0)
setMessage({ type: 'success', text: data.data.message || '日志已清空' })
} else {
setMessage({ type: 'error', text: data.message || '清空失败' })
}
} catch {
setMessage({ type: 'error', text: '网络错误' })
}
}}
icon={<Trash2 className="h-3 w-3" />}
className="text-red-500 hover:text-red-600 border-red-300 hover:border-red-400 dark:border-red-800"
>
</Button>
<Button
variant="outline"
size="sm"