next front end
This commit is contained in:
@@ -17,6 +17,9 @@ from datetime import datetime, timedelta, date
|
||||
from pathlib import Path
|
||||
|
||||
from app.database.base import get_db
|
||||
|
||||
# Track application start time
|
||||
APPLICATION_START_TIME = time.time()
|
||||
from app.models import User, Rolodex, File as FileModel, Ledger, QDRO, AuditLog, LoginAttempt
|
||||
from app.models.lookups import SystemSetup, Employee, FileType, FileStatus, TransactionType, TransactionCode, State, FormIndex
|
||||
from app.auth.security import get_admin_user, get_password_hash, create_access_token
|
||||
@@ -219,13 +222,9 @@ async def system_health(
|
||||
except:
|
||||
alerts.append("Unable to check backup status")
|
||||
|
||||
# System uptime (simplified)
|
||||
try:
|
||||
import psutil
|
||||
uptime_seconds = time.time() - psutil.boot_time()
|
||||
uptime = str(timedelta(seconds=int(uptime_seconds)))
|
||||
except ImportError:
|
||||
uptime = "Unknown"
|
||||
# Application uptime
|
||||
uptime_seconds = int(time.time() - APPLICATION_START_TIME)
|
||||
uptime = str(timedelta(seconds=uptime_seconds))
|
||||
|
||||
status = "healthy" if db_connected and disk_available and memory_available else "unhealthy"
|
||||
|
||||
@@ -287,14 +286,9 @@ async def system_statistics(
|
||||
except:
|
||||
pass
|
||||
|
||||
# System uptime (simplified)
|
||||
system_uptime = "Unknown"
|
||||
try:
|
||||
import psutil
|
||||
uptime_seconds = time.time() - psutil.boot_time()
|
||||
system_uptime = str(timedelta(seconds=int(uptime_seconds)))
|
||||
except ImportError:
|
||||
pass
|
||||
# Application uptime
|
||||
uptime_seconds = int(time.time() - APPLICATION_START_TIME)
|
||||
system_uptime = str(timedelta(seconds=uptime_seconds))
|
||||
|
||||
# Recent activity (last 10 actions)
|
||||
recent_activity = []
|
||||
|
||||
Reference in New Issue
Block a user