feat: implement full backend + frontend server detail, settings, and create server pages
Backend: - Complete FastAPI backend with 42+ REST endpoints (auth, servers, config, players, bans, missions, mods, games, system) - Game adapter architecture with Arma 3 as first-class adapter - WebSocket real-time events for status, metrics, logs, players - Background thread system (process monitor, metrics, log tail, RCon poller) - Fernet encryption for sensitive config fields at rest - JWT auth with admin/viewer roles, bcrypt password hashing - SQLite with WAL mode, parameterized queries, migration system - APScheduler cleanup jobs for logs, metrics, events Frontend: - Server Detail page with 7 tabs (overview, config, players, bans, missions, mods, logs) - Settings page with password change and admin user management - Create Server wizard (4-step; known bug: silent validation failure) - New hooks: useServerDetail, useAuth, useGames - New components: ServerHeader, ConfigEditor, PlayerTable, BanTable, MissionList, ModList, LogViewer, PasswordChange, UserManager - WebSocket onEvent callback for real-time log accumulation - 120 unit tests passing (Vitest + React Testing Library) Docs: - Added .gitignore, CLAUDE.md, README.md - Updated FRONTEND.md, ARCHITECTURE.md with current implementation state - Added .env.example for backend configuration Known issues: - Create Server form: "Next" buttons don't validate before advancing, causing silent submit failure when fields are invalid - Config sub-tabs need UX redesign for non-technical users
This commit is contained in:
32
backend/core/system/router.py
Normal file
32
backend/core/system/router.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
from typing import Annotated
|
||||
from dependencies import get_current_user
|
||||
from adapters.registry import GameAdapterRegistry
|
||||
|
||||
router = APIRouter(prefix="/system", tags=["system"])
|
||||
|
||||
|
||||
@router.get("/health")
|
||||
def health():
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
@router.get("/status")
|
||||
def system_status(_user: Annotated[dict, Depends(get_current_user)]):
|
||||
from sqlalchemy import text
|
||||
from database import get_engine
|
||||
with get_engine().connect() as db:
|
||||
running = db.execute(
|
||||
text("SELECT COUNT(*) FROM servers WHERE status IN ('running','starting')")
|
||||
).fetchone()[0]
|
||||
total = db.execute(text("SELECT COUNT(*) FROM servers")).fetchone()[0]
|
||||
|
||||
return {
|
||||
"success": True,
|
||||
"data": {
|
||||
"version": "1.0.0",
|
||||
"running_servers": running,
|
||||
"total_servers": total,
|
||||
"supported_games": [a.game_type for a in GameAdapterRegistry.all()],
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user