fix uptime on dashboard
This commit is contained in:
+8
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user