mirror of
https://github.com/JetSprow/J-Board-Lite.git
synced 2026-05-01 01:14:10 +05:30
feat: add log cleanup controls
This commit is contained in:
10
docs/API.md
10
docs/API.md
@@ -313,6 +313,13 @@ Server Actions 是后台和用户端写操作的主要入口。它们不是公
|
||||
|
||||
后台“订阅风控”页面依赖 `src/services/subscription-risk-review.ts` 整理地图、IP、分析日志和报告文本。
|
||||
|
||||
#### 日志清理:`src/actions/admin/logs.ts`
|
||||
|
||||
- `deleteAdminLogEntry({ target, id })`:删除单条审计、任务、流量、节点延迟、风控访问或风控事件日志。
|
||||
- `cleanupExpiredAdminLogs({ target, cutoffDays })`:按日志范围和保留天数手动清理过期日志,并写入审计日志。
|
||||
|
||||
自动清理由 `src/services/log-cleanup-scheduler.ts` 启动,默认每天最多执行一次,读取 `AppConfig.logCleanupEnabled` 和 `AppConfig.logRetentionDays`。自动清理和手动过期清理都会保留仍处于用户端限制中的风控事件。
|
||||
|
||||
#### 订单:`src/actions/admin/orders.ts`
|
||||
|
||||
- `confirmOrder(orderId)`:手动确认订单并触发开通。
|
||||
@@ -329,6 +336,7 @@ Server Actions 是后台和用户端写操作的主要入口。它们不是公
|
||||
- 公告:`src/actions/admin/announcements.ts`
|
||||
- 工单:`src/actions/admin/support.ts`
|
||||
- 系统设置:`src/actions/admin/settings.ts`
|
||||
- 日志清理:`src/actions/admin/logs.ts`
|
||||
- 备份恢复:`src/actions/admin/backups.ts`
|
||||
- 任务重试:`src/actions/admin/tasks.ts`
|
||||
- 流量视图刷新:`src/actions/admin/traffic.ts`
|
||||
@@ -349,7 +357,7 @@ Server Actions 是后台和用户端写操作的主要入口。它们不是公
|
||||
- `SubscriptionAccessLog`:保存订阅 API 访问和节点真实连接证据。
|
||||
- `SubscriptionRiskEvent`:保存风控事件、复核状态、报告、用户端限制和最终处理动作。
|
||||
- `SubscriptionRiskReason`:包含城市、省/地区、国家变化,以及节点高频、目标分散等原因。
|
||||
- `AppConfig`:保存订阅风控总控、自动暂停开关、阈值、节点日志风控阈值。
|
||||
- `AppConfig`:保存订阅风控总控、自动暂停开关、阈值、节点日志风控阈值,以及日志清理开关、保留天数和上次清理时间。
|
||||
- `NodeClient.email`:用于匹配 Xray access log 中的 `email:`。它可能形如 `user@example.com-cmojtnp3`,不要手动在 3x-ui 修改。
|
||||
|
||||
## 错误处理约定
|
||||
|
||||
Reference in New Issue
Block a user