mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-03-28 17:42:45 +01:00
fix(console): correct trace display order
SNR precedes the hop hash: 12.50 > [5e]12.25 > [d1]-8.25 > [e7]-3.00 (each SNR shows link quality, hash shows the next relay node) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
13
app/main.py
13
app/main.py
@@ -393,13 +393,14 @@ def _execute_console_command(args: list) -> str:
|
||||
result = device_manager.send_trace(path)
|
||||
if result.get('success'):
|
||||
data = result['data']
|
||||
# Format: snr > [hash]snr > [hash]snr > ... > [hash]snr
|
||||
parts = []
|
||||
# Format like meshcore-cli: snr > [hash]snr > [hash]snr
|
||||
# Each element has snr + optional hash pointing to next hop
|
||||
output = ""
|
||||
for t in data.get('path', []):
|
||||
snr = f"{t['snr']:.2f}"
|
||||
h = f"[{t['hash']}]" if 'hash' in t else ''
|
||||
parts.append(f"{h}{snr}")
|
||||
return " > ".join(parts) if parts else "(empty trace)"
|
||||
output += f"{t['snr']:.2f}"
|
||||
if 'hash' in t:
|
||||
output += f" > [{t['hash']}]"
|
||||
return output if output else "(empty trace)"
|
||||
return f"Error: {result.get('error')}"
|
||||
|
||||
elif cmd == 'trace':
|
||||
|
||||
Reference in New Issue
Block a user