feat: add a service for periodic cleanup of error accounts based on configuration.
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user