Add live monitoring status overlay with heartbeat updates

Backend: monitor_thread sends periodic monitor_heartbeat events (every
5s) with elapsed time, packet count, and device count so the frontend
knows monitoring is active.

Frontend: new monitoring overlay replaces scan progress bar when
auto-monitor starts. Shows pulsing green indicator, ARFCN being
monitored, live elapsed timer, packet/device counts, and
"Listening..."/"Capturing" activity state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-02-08 18:41:30 +00:00
parent 82f442ffb8
commit 6b7f817aa6
2 changed files with 179 additions and 1 deletions
+21
View File
@@ -1628,6 +1628,10 @@ def monitor_thread(process):
stderr_thread = threading.Thread(target=read_stderr, daemon=True)
stderr_thread.start()
monitor_start_time = time.time()
packets_captured = 0
last_heartbeat = time.time()
try:
while app_module.gsm_spy_monitor_process:
# Check if process died
@@ -1635,6 +1639,21 @@ def monitor_thread(process):
logger.info(f"Monitor process exited (code: {process.returncode})")
break
# Send periodic heartbeat so frontend knows monitor is alive
now = time.time()
if now - last_heartbeat >= 5:
last_heartbeat = now
elapsed = int(now - monitor_start_time)
try:
app_module.gsm_spy_queue.put_nowait({
'type': 'monitor_heartbeat',
'elapsed': elapsed,
'packets': packets_captured,
'devices': len(app_module.gsm_spy_devices)
})
except queue.Full:
pass
# Get output from queue with timeout
try:
msg_type, line = output_queue_local.get(timeout=1.0)
@@ -1646,6 +1665,8 @@ def monitor_thread(process):
parsed = parse_tshark_output(line)
if parsed:
packets_captured += 1
# Store in DataStore
key = parsed.get('tmsi') or parsed.get('imsi') or str(time.time())
app_module.gsm_spy_devices[key] = parsed