Fix: 添加详细调试日志诊断拓扑连线问题
- 在拓扑构建时输出每个设备的邻居详情 - 显示邻居的RemoteIP、RemoteDevice、接口信息 - 从数据库加载设备后重建拓扑确保连线正确 - 帮助诊断为什么邻居无法自动连线
このコミットが含まれているのは:
@@ -50,6 +50,15 @@ func (b *Builder) Build() models.TopologyGraph {
|
||||
}
|
||||
nodeMap[device.IP] = node
|
||||
graph.Nodes = append(graph.Nodes, node)
|
||||
|
||||
// 调试信息
|
||||
fmt.Printf("Node added: %s (%s) with %d neighbors\n",
|
||||
device.IP, device.Type, len(device.Neighbors))
|
||||
for i, neighbor := range device.Neighbors {
|
||||
fmt.Printf(" Neighbor %d: RemoteIP=%s, RemoteDevice=%s, LocalIf=%s, RemoteIf=%s\n",
|
||||
i+1, neighbor.RemoteIP, neighbor.RemoteDevice,
|
||||
neighbor.LocalInterface, neighbor.RemoteInterface)
|
||||
}
|
||||
}
|
||||
|
||||
// 构建边(基于邻居信息)
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする