packages/hyprspace: print node names in route show

This commit is contained in:
Max Headroom 2024-04-22 14:48:32 +02:00
parent a4d5782a7f
commit aadc5f3e7b
3 changed files with 5 additions and 0 deletions

View file

@ -42,6 +42,9 @@ func RouteRun(r *cmd.Root, c *cmd.Sub) {
} else {
target = fmt.Sprintf("/p2p/%s", r.TargetAddr)
}
if r.TargetName != "" {
target = fmt.Sprintf("@%s %s", r.TargetName, target)
}
if r.IsConnected {
connectStatus = " connected"
}

View file

@ -93,6 +93,7 @@ func (hsr *HyprspaceRPC) Route(args *RouteArgs, reply *RouteReply) error {
}
routeInfos = append(routeInfos, RouteInfo{
Network: rte.Network(),
TargetName: rte.Target.Name,
TargetAddr: rte.Target.ID,
RelayAddr: relayAddr,
IsRelay: relay,

View file

@ -32,6 +32,7 @@ const (
type RouteInfo struct {
Network net.IPNet
TargetName string
TargetAddr peer.ID
RelayAddr peer.ID
IsRelay bool