fix uptime on dashboard

This commit is contained in:
Constantin
2025-09-13 14:42:44 +03:00
parent 47c2beaf96
commit b40e4f277e
2 changed files with 26 additions and 2 deletions
+8 -1
View File
@@ -25,6 +25,9 @@ from logging.handlers import RotatingFileHandler
import uuid
import contextvars
# Track API start time for uptime calculation
API_START_TIME = time.time()
from network_manager import NetworkManager
from wireguard_manager import WireGuardManager
from peer_registry import PeerRegistry
@@ -305,10 +308,14 @@ def get_cell_status():
peers = peer_registry.list_peers()
# Calculate actual uptime
current_time = time.time()
uptime_seconds = int(current_time - API_START_TIME)
return jsonify({
"cell_name": "personal-internet-cell",
"domain": "cell.local",
"uptime": 3600, # Placeholder
"uptime": uptime_seconds,
"peers_count": len(peers),
"services": services_status,
"timestamp": datetime.utcnow().isoformat()