feat(admin): 添加评论数据看板功能
- 新增数据看板页面,展示评论统计信息 - 添加 echarts 依赖用于数据可视化 - 实现后端统计接口,包括总数、按域名和最近7天数据 - 完善前端统计页面样式和交互 - 更新文档说明和版本更新指南
This commit is contained in:
@@ -62,6 +62,26 @@ export type EmailNotifySettingsResponse = {
|
||||
};
|
||||
};
|
||||
|
||||
export type CommentStatsResponse = {
|
||||
summary: {
|
||||
total: number;
|
||||
approved: number;
|
||||
pending: number;
|
||||
rejected: number;
|
||||
};
|
||||
domains: {
|
||||
domain: string;
|
||||
total: number;
|
||||
approved: number;
|
||||
pending: number;
|
||||
rejected: number;
|
||||
}[];
|
||||
last7Days: {
|
||||
date: string;
|
||||
total: number;
|
||||
}[];
|
||||
};
|
||||
|
||||
export async function loginAdmin(name: string, password: string): Promise<string> {
|
||||
const res = await post<AdminLoginResponse>('/admin/login', { name, password });
|
||||
const key = res.data.key;
|
||||
@@ -160,3 +180,7 @@ export function exportComments(): Promise<any[]> {
|
||||
export function importComments(data: any[]): Promise<{ message: string }> {
|
||||
return post<{ message: string }>('/admin/comments/import', data);
|
||||
}
|
||||
|
||||
export function fetchCommentStats(): Promise<CommentStatsResponse> {
|
||||
return get<CommentStatsResponse>('/admin/stats/comments');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user