mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-07-06 09:51:14 +02:00
fix: Remove non-functional Node Discovery feature
Removed Node Discovery feature that was experiencing persistent timeout
issues. Feature attempted to scan mesh network for nearby repeaters but
consistently failed due to bridge timing constraints.
Changes:
- Remove node_discover() function from cli.py
- Remove 'node_discover' from SPECIAL_COMMANDS in api.py
- Remove Discover Nodes button and modal from base.html
- Remove discoverNodes() and displayNodeDiscoveryResults() from app.js
- Remove Discover Nodes documentation from README.md
IMPORTANT: Advert message cleanup ("Advert sent") is preserved and
working correctly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -368,60 +368,6 @@ def floodadv() -> Tuple[bool, str]:
|
||||
return success, stdout or stderr
|
||||
|
||||
|
||||
def node_discover() -> Tuple[bool, List[Dict]]:
|
||||
"""
|
||||
Discover nearby mesh nodes (repeaters).
|
||||
|
||||
Uses .node_discover command which returns JSON array of nearby repeaters
|
||||
with SNR, RSSI, and other metadata.
|
||||
|
||||
Returns:
|
||||
Tuple of (success, nodes_list)
|
||||
Each node dict contains:
|
||||
{
|
||||
'SNR': float,
|
||||
'RSSI': int,
|
||||
'path_len': int,
|
||||
'node_type': int (2=REP),
|
||||
'SNR_in': float,
|
||||
'tag': str (hex),
|
||||
'pubkey': str (hex)
|
||||
}
|
||||
"""
|
||||
success, stdout, stderr = _run_command(['.node_discover'])
|
||||
|
||||
if not success:
|
||||
logger.error(f"node_discover failed: {stderr}")
|
||||
return False, []
|
||||
|
||||
try:
|
||||
# Clean output: remove prompt lines (e.g., "MarWoj|* .node_discover")
|
||||
# and extract only the JSON array
|
||||
cleaned_output = stdout.strip()
|
||||
|
||||
# Find the start of JSON array (first '[')
|
||||
json_start = cleaned_output.find('[')
|
||||
if json_start == -1:
|
||||
logger.error(f"No JSON array found in output: {stdout}")
|
||||
return False, []
|
||||
|
||||
# Extract JSON from first '[' to end
|
||||
json_str = cleaned_output[json_start:]
|
||||
|
||||
# Parse JSON array
|
||||
nodes = json.loads(json_str)
|
||||
if not isinstance(nodes, list):
|
||||
logger.error(f"node_discover returned non-array: {stdout}")
|
||||
return False, []
|
||||
|
||||
logger.info(f"Discovered {len(nodes)} nearby nodes")
|
||||
return True, nodes
|
||||
|
||||
except json.JSONDecodeError as e:
|
||||
logger.error(f"Failed to parse node_discover JSON: {e}, output: {stdout}")
|
||||
return False, []
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Direct Messages (DM)
|
||||
# =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user