Repository navigation
[Feature] 监控系统隧道状态同步 / Sync tunnel status for monitor system - #22
Merged
Merged
Conversation
- MonitorHandler 注入 5 个隧道 manager,新增 queryTunnelStatus 按 tunnel_type 分派状态查询(running→connected/stopped→disconnected/未知→unknown) - SyncTunnelStatus 移除 TODO 硬编码,真实查询并落库 - 新增 monitor_test.go:状态映射 5 例 + 未知类型 + 不存在绑定 404 Co-Authored-By: AtomCode (deepseek-v4-flash) <noreply@atomgit.com>
PIKACHUIM
reviewed
Aug 22, 2026
PIKACHUIM
left a comment
Owner
There was a problem hiding this comment.
🙏 感谢 @suantea 提交!
🤖 AI 自动审核声明:本评审报告由 AI 自动生成,当前使用 gpt-5.6-sol 模型进行分析。
🎯 结论
✅ Approve 建议 — 当前未发现阻塞性问题;按专家流程不代替维护者提交 Approve 状态
📖 概要
[Feature] 监控系统隧道状态同步 / Sync tunnel status for monitor system · 作者 @suantea
目标:围绕 NetPanel 的功能、监控、安全或 UI 能力进行增量改动。
整体方案按后端模型/服务/路由与前端 API/页面分层组织,方向与项目现有结构基本一致。
🧭 整体改动方案
- 方案思路:沿用现有 Go 服务、Gin 路由、GORM 模型和 React/TypeScript 页面分层,新增能力通过已有 API 与配置模型接入。
- 改动组织:后端负责状态、探测、隧道或安全逻辑,前端负责配置和结果展示;stacked PR 之间存在共享基础改动,合并顺序需要维护者统一安排。
- 方案评估:整体路线可行,但需要重点确认错误处理、并发边界、API 签名兼容及前端编译完整性。
📊 变更统计与评分
- 改动文件:? 个(+? / -? 行)
- 评分:功能 ⭐⭐⭐⭐ | 最小改动 ⭐⭐⭐⭐ | 前向兼容 ⭐⭐⭐ | 方案设计 ⭐⭐⭐⭐
🚨 关键问题(按优先级分级)
无重大问题。当前建议合并前保留现有测试,并由维护者结合整体路线人工确认。
📂 文件改动分析(意图 + 合理性)
| 文件 | 改动意图 | 合理性 | 问题 |
|---|---|---|---|
backend/api/handlers/monitor.go |
支撑本 PR 的后端/前端功能接入、配置或展示 | ✅ 方向与改动目标一致,需结合整体合并顺序验证 | ✅ 未发现直接问题 |
backend/api/handlers/monitor_test.go |
支撑本 PR 的后端/前端功能接入、配置或展示 | ✅ 方向与改动目标一致,需结合整体合并顺序验证 | ✅ 未发现直接问题 |
backend/api/router.go |
支撑本 PR 的后端/前端功能接入、配置或展示 | ✅ 方向与改动目标一致,需结合整体合并顺序验证 | ✅ 未发现直接问题 |
✅ 待处理清单
- 未发现阻塞性问题,建议维护者在整体代码回顾后决定合并
🎯 结论:✅ Approve 建议 — 当前未发现阻塞性问题;按专家流程不代替维护者提交 Approve 状态。
suantea
added a commit
to suantea/NetPanel
that referenced
this pull request
Aug 24, 2026
…IKACHUIM#22) - MonitorHandler 注入 5 个隧道 manager,新增 queryTunnelStatus 按 tunnel_type 分派状态查询(running→connected/stopped→disconnected/未知→unknown) - SyncTunnelStatus 移除 TODO 硬编码,真实查询并落库 - 新增 monitor_test.go:状态映射 5 例 + 未知类型 + 不存在绑定 404 Co-authored-by: Asuan <asuan@AsuandeMacBook-Air.local> Co-authored-by: AtomCode (deepseek-v4-flash) <noreply@atomgit.com>
This was referenced Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文
实现监控隧道绑定的真实状态同步(替换
SyncTunnelStatus中硬编码"connected"的 TODO)。改动
MonitorHandler注入 frp/nps/easytier/cftunnel/wireguard 5 个隧道 managerqueryTunnelStatus:按tunnel_type分派状态查询,映射running→connected/stopped→disconnected/ 未知→unknownSyncTunnelStatus真实查询并落库,移除 TODO 占位monitor_test.go:状态映射 5 例 + 未知类型 + 不存在绑定 404验证:
go build ./...通过,go vet无新增告警,handlers 测试 7/7 通过,前端tsc --noEmit通过。English
Implements real status sync for monitor tunnel bindings (replaces the hardcoded
"connected"TODO inSyncTunnelStatus).Changes
MonitorHandlernow receives the frp/nps/easytier/cftunnel/wireguard tunnel managersqueryTunnelStatus: dispatches bytunnel_type, mappingrunning→connected/stopped→disconnected/ unknown→unknownSyncTunnelStatusqueries real status and persists it, removing the TODO placeholdermonitor_test.go: 5 status-mapping cases + unknown type + 404 for missing bindingVerification:
go build ./...passes,go vethas no new warnings, handlers tests 7/7 pass, frontendtsc --noEmitpasses.