core-cli: add position output for querying nodes
This commit is contained in:
parent
7fcedf527f
commit
425a2ee141
1 changed files with 20 additions and 15 deletions
|
@ -210,8 +210,13 @@ def query_session(core: CoreGrpcClient, args: Namespace) -> None:
|
|||
def query_node(core: CoreGrpcClient, args: Namespace) -> None:
|
||||
session = core.get_session(args.id)
|
||||
node, ifaces, _ = core.get_node(args.id, args.node)
|
||||
print("ID | Name | Type")
|
||||
print(f"{node.id:<4} | {node.name:<7} | {node.type.name}")
|
||||
print("ID | Name | Type | XY")
|
||||
xy_pos = f"{int(node.position.x)},{int(node.position.y)}"
|
||||
print(f"{node.id:<4} | {node.name[:7]:<7} | {node.type.name[:7]:<7} | {xy_pos}")
|
||||
if node.geo:
|
||||
print("Geo")
|
||||
print(f"{node.geo.lon:.7f},{node.geo.lat:.7f},{node.geo.alt:f}")
|
||||
if ifaces:
|
||||
print("Interfaces")
|
||||
print("Connected To | ", end="")
|
||||
print_iface_header()
|
||||
|
|
Loading…
Reference in a new issue