功能:实现 webapp 基于索引的日志导航

主要改进:
- 添加索引导航支持:前进/后退按钮现在基于记录索引加载数据
- 后端 API 支持可选的 index 参数,返回包含 centerIndex 的响应
- 前端追踪 currentCenterIndex,实现精确的页面跳转
- 在状态徽章中显示记录索引号 [#索引]
- 修复日志显示逻辑:从追加模式改为完全重新渲染

代码优化:
- concurrent: 使用 Go 1.25 range 语法和 min 函数
- concurrent: 使用 WaitGroup.Go 方法简化 goroutine 启动
- topic_processor: 修正格式化输出

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-04 01:43:48 +08:00
parent 3d82a6845e
commit 48b0b56ce7
3 changed files with 115 additions and 66 deletions

View File

@@ -10,7 +10,7 @@ import (
func main() {
// ===== TopicProcessor 作为聚合器使用 =====
fmt.Println("=== TopicProcessor 聚合器示例 ===\n")
fmt.Println("=== TopicProcessor 聚合器示例 ===")
// 创建 TopicProcessor提供空 handler
logger := slog.Default()