Skip to content

feat: add notification audit log tab to settings#2990

Draft
Copilot wants to merge 3 commits into
developfrom
copilot/add-notification-audit-log
Draft

feat: add notification audit log tab to settings#2990
Copilot wants to merge 3 commits into
developfrom
copilot/add-notification-audit-log

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

No historical record existed for notifications sent via QLAPI.systemNotify — users had no visibility into what was sent, when, via which channel, or whether it succeeded.

Backend

  • back/data/system.ts: Added notifyLog to AuthDataType, new NotifyStatus enum, and NotifyLogInfo interface (timestamp, title, content, status, notifyType).
  • back/services/system.ts: notify() now resolves the active notification channel (from notificationInfo or system config) and writes a log entry to the DB after each send attempt. Added getNotifyLog() returning the 200 most recent entries, newest first, with DB-level cleanup of older records.
  • back/api/system.ts: New GET /system/notify-log endpoint.

Frontend

  • src/pages/setting/notifyLog.tsx: New table component — columns: send time, title, content (truncated at 100 chars), channel, status (colored tag).
  • src/pages/setting/index.tsx: Wires up data fetching and adds a 通知日志 tab between 登录日志 and 依赖设置.

Logged fields per notification:

{
  timestamp: number,   // ms epoch
  title: string,
  content: string,
  notifyType: string,  // e.g. "bark", "telegramBot"
  status: 0 | 1,      // 0 = success, 1 = fail
}

Copilot AI linked an issue Apr 25, 2026 that may be closed by this pull request
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
qinglong Ready Ready Preview, Comment Apr 25, 2026 7:02am
qinglong-back Error Error Apr 25, 2026 7:02am

Agent-Logs-Url: https://github.com/whyour/qinglong/sessions/4c9f0ab1-8b0e-4b94-b295-39c90ed942c2

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Copilot AI changed the title [WIP] Add notification audit log feature to settings page feat: add notification audit log tab to settings Apr 25, 2026
Copilot AI requested a review from whyour April 25, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

功能建议:增加通知审计日志功能

2 participants