Fix: 修复存储文件名和拓扑构建逻辑
- 修正存储文件名: network-topology.db -> devices.json - 移除handleGetDevices中的重复builder重建逻辑 - 移除冗余的调试日志输出 - 统一日志术语: database -> storage - 确保添加设备时正确更新builder和存储
这个提交包含在:
@@ -50,15 +50,6 @@ 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)
|
||||
}
|
||||
}
|
||||
|
||||
// 构建边(基于邻居信息)
|
||||
|
||||
在新工单中引用
屏蔽一个用户