mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-08-11 19:22:54 +02:00
feat(contacts): show path/route info in UI and split console commands
- Console `contacts` now shows device-only contacts with path info (matching meshcore-cli format: name, type, pubkey, path) - New `contacts_all` command shows all contacts (device + cached from DB) - Contact cards in UI now always show routing mode for device contacts (Flood, Direct 0 hop, or hex path with hop count) - Fix path_or_mode computation: prioritize out_path over out_path_len to handle firmware edge case where out_path exists but out_path_len=-1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2142,12 +2142,22 @@ function createExistingContactCard(contact, index) {
|
||||
lastAdvertDiv.appendChild(timeText);
|
||||
}
|
||||
|
||||
// Path/mode (optional)
|
||||
// Path/route info for device contacts
|
||||
let pathDiv = null;
|
||||
if (contact.path_or_mode && contact.path_or_mode !== 'Flood') {
|
||||
if (contact.on_device !== false) {
|
||||
pathDiv = document.createElement('div');
|
||||
pathDiv.className = 'text-muted small';
|
||||
pathDiv.textContent = `Path: ${contact.path_or_mode}`;
|
||||
const mode = contact.path_or_mode || 'Flood';
|
||||
const pathLen = contact.out_path_len;
|
||||
if (mode === 'Flood') {
|
||||
pathDiv.innerHTML = '<i class="bi bi-broadcast"></i> Flood';
|
||||
} else if (mode === '0 hop') {
|
||||
pathDiv.innerHTML = '<i class="bi bi-arrow-right-short"></i> Direct (0 hop)';
|
||||
} else {
|
||||
// mode is hex path string, show hops count + path
|
||||
const hops = pathLen >= 0 ? pathLen : '?';
|
||||
pathDiv.innerHTML = `<i class="bi bi-signpost-split"></i> Path: ${mode} (${hops} hops)`;
|
||||
}
|
||||
}
|
||||
|
||||
// Action buttons
|
||||
|
||||
Reference in New Issue
Block a user