feat: 批量检测集成统一接口并添加AI查询统计页面

- 修改 argon_batch_detect_spam_comments() 使用统一的 argon_ai_query() 接口
- 删除旧的 argon_call_ai_api_for_batch_spam_detection() 函数
- 添加 argon_register_ai_query_stats_page() 注册统计页面
- 添加 argon_render_ai_query_stats_page() 渲染统计页面
- 统计页面显示总查询次数、成功率、平均响应时间、失败次数
- 按场景和服务商分别统计查询数据
- 显示最近30天的查询趋势
- 在 settings.php 的 AI 摘要设置中添加查看统计链接

统计页面功能:
- 总览卡片:总查询次数、成功率、平均响应时间、失败次数
- 按场景统计:文章摘要、垃圾评论检测、批量检测等
- 按服务商统计:OpenAI、Claude、DeepSeek 等
- 查询趋势:最近30天每日查询数据
This commit is contained in:
2026-01-26 12:58:41 +08:00
parent 5bfe6a0e70
commit 31e55648cb
2 changed files with 202 additions and 118 deletions

View File

@@ -2587,6 +2587,16 @@ function themeoptions_page(){
</td>
</tr>
<tr>
<th><label><?php _e('AI 查询统计', 'argon');?></label></th>
<td>
<a href="<?php echo admin_url('admin.php?page=argon-ai-query-stats'); ?>" class="button" target="_blank">
<?php _e('查看 AI 查询统计', 'argon');?>
</a>
<p class="description"><?php _e('查看所有 AI 查询的统计信息,包括查询次数、成功率、响应时间等', 'argon');?></p>
</td>
</tr>
<tr><th class="subtitle"><h3 id="subsection-footnote"><?php _e('脚注引用', 'argon');?></h3></th></tr>
<tr>