Add log system with three log types (agent/system/chat)

Implemented a complete log system for tracking:
- Agent logs:智能体调用
- System logs: 系统运行
- Chat logs: 问答对话

Backend:
- Log model with type, level, user_id, message, source, duration_ms
- LogService with methods for logging and querying
- API endpoints: GET /api/logs, GET /api/logs/stats, GET /api/logs/recent

Frontend:
- LogView.vue with filters, stats, pagination, auto-refresh
- log.ts API client with TypeScript interfaces
- Added "运行日志" nav item to sidebar
This commit is contained in:
2026-03-21 11:58:51 +08:00
parent 30568846b3
commit 9e4e94c75e
9 changed files with 979 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ from app.routers import (
settings_router,
folder_router,
skill_router,
log_router,
)
from app.routers.scheduler import router as scheduler_router
from app.services.scheduler_service import start_scheduler, stop_scheduler, get_scheduler_status
@@ -61,6 +62,7 @@ app.include_router(todo_router)
app.include_router(settings_router)
app.include_router(folder_router)
app.include_router(skill_router)
app.include_router(log_router)
app.include_router(scheduler_router)