feat: 增强管理员工作台聊天统计看板

- 工作台接入聊天消息总数、会话总数、活跃智能体数、趋势与 Top5 排行

- dashboard 接口新增 chatStatus 与聊天统计字段,分析库不可用时明确降级

- today 维度按小时聚合聊天趋势,并补充后端查询与测试覆盖
This commit is contained in:
2026-04-19 17:40:01 +08:00
parent 1d8b9d9662
commit 5827ecde42
16 changed files with 1206 additions and 90 deletions

View File

@@ -8,30 +8,45 @@ export interface DashboardOverviewQuery {
export interface DashboardSummary {
activeUserTotal: number;
activeAssistantTotal: number;
botTotal: number;
chatMessageTotal: number;
chatSessionTotal: number;
knowledgeBaseTotal: number;
userTotal: number;
workflowTotal: number;
}
export interface DashboardChatStatus {
available: boolean;
message: string;
}
export interface DashboardTrendItem {
activeUserTotal: number;
chatMessageTotal: number;
chatSessionTotal: number;
key: string;
label: string;
}
export interface DashboardDistributionItem {
activeUserTotal: number;
assistantId?: number | string;
avgMessagePerSession?: number;
botTotal: number;
key: string;
knowledgeBaseTotal: number;
label: string;
messageTotal?: number;
sessionTotal?: number;
userTotal: number;
value: number;
workflowTotal: number;
}
export interface DashboardOverviewResponse {
chatStatus: DashboardChatStatus;
distribution: DashboardDistributionItem[];
query: DashboardOverviewQuery;
summary: DashboardSummary;