feat: virtual company module, team projects, PWA dishes app, and startup scripts overhaul
- Add company module (3-tier org, CEO planning, parallel departments) - Add company orchestrator, knowledge extractor, presets, scheduler - Add company API endpoints, models, and frontend views - Add 今天吃啥 PWA app (69 dishes, real images, offline support) - Add team_projects output directory structure - Add unified manage.ps1 for service lifecycle - Add Windows startup guide v1.0 - Add TTS troubleshooting doc - Update frontend (AgentChat UX overhaul, new views) - Update backend (voice engine fix, multi-tenant, RBAC) - Remove deprecated startup scripts and old docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,7 @@ async def get_agent_overview(
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
"""Agent 概览统计:Agent 数、对话次数、LLM 调用次数、Token 用量、工具调用次数。"""
|
||||
user_id = None if current_user.role == "admin" else current_user.id
|
||||
user_id = None if current_user.has_permission("monitoring:view_all") else current_user.id
|
||||
return AgentMonitoringService.get_overview(db, user_id)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ async def get_llm_calls(
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
"""最近 LLM 调用记录列表。"""
|
||||
user_id = None if current_user.role == "admin" else current_user.id
|
||||
user_id = None if current_user.has_permission("monitoring:view_all") else current_user.id
|
||||
return AgentMonitoringService.get_llm_calls(db, user_id, days, limit)
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ async def get_agent_stats(
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
"""各 Agent 用量统计(按 Agent 分组)。"""
|
||||
user_id = None if current_user.role == "admin" else current_user.id
|
||||
user_id = None if current_user.has_permission("monitoring:view_all") else current_user.id
|
||||
return AgentMonitoringService.get_agent_stats(db, user_id, days)
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ async def get_tool_usage(
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
"""工具调用频次统计。"""
|
||||
user_id = None if current_user.role == "admin" else current_user.id
|
||||
user_id = None if current_user.has_permission("monitoring:view_all") else current_user.id
|
||||
return AgentMonitoringService.get_tool_usage(db, user_id, days)
|
||||
|
||||
|
||||
@@ -70,5 +70,5 @@ async def get_daily_trend(
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
"""每日 LLM 调用趋势。"""
|
||||
user_id = None if current_user.role == "admin" else current_user.id
|
||||
user_id = None if current_user.has_permission("monitoring:view_all") else current_user.id
|
||||
return AgentMonitoringService.get_daily_trend(db, user_id, days)
|
||||
|
||||
Reference in New Issue
Block a user