feat: add admin panel at /admin for full dashboard configuration

- Backend: ConfigManager write methods (atomic YAML save), admin CRUD
  router for settings (display/odoo/refresh) and nodes, WS broadcast
  on config changes, fix nmap scan blocking event loop with to_thread
- Frontend: admin UI with tab navigation, overview dashboard, node
  CRUD table with modal form, Odoo/display/refresh settings pages,
  typed API wrappers, active views filtering, config_changed WS handler
- Infra: nginx no-cache headers for HTML, cache-forever for hashed assets
- Fixes: WebSocket reconnect loop (ref pattern), rotation index OOB
  when views shrink, mutable node list cache

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 02:34:05 +00:00
parent 15f5f87376
commit 81bcdcd696
22 changed files with 1228 additions and 689 deletions

View File

@@ -1,3 +1,5 @@
import asyncio
from fastapi import APIRouter, Depends
from modules.config_manager import ConfigManager
from modules.network_scanner import NetworkScanner
@@ -19,7 +21,7 @@ async def get_topology(config: ConfigManager = Depends(get_config)):
if scan_config.get("enabled", False):
try:
scan_data = scanner.scan()
scan_data = await asyncio.to_thread(scanner.scan)
discovered = scanner.parse_scan_results(scan_data)
nodes = scanner.merge_with_config(discovered, configured_nodes)
except Exception: