refactor: move record/playback to dedicated page, restore test mode in settings

- New '录制回放' page with sidebar nav entry
- Recording: start/stop/auto, file list with play/export/delete
- Playback: visual bar indicator, opens dashboards to see replayed data
- Settings: restored dev tools section with test mode toggle
This commit is contained in:
2026-07-26 19:10:48 +08:00
parent 3514612f7a
commit 7e9211507b
5 changed files with 103 additions and 8 deletions
+4 -6
View File
@@ -481,11 +481,9 @@ async def api_export_recording(filename: str):
return FileResponse(path, media_type="application/octet-stream", filename=filename)
@router.post("/recording/import")
async def api_import_recording(file: UploadFile = File(...)):
@router.delete("/recording/{filename}/delete")
async def api_delete_recording(filename: str):
from server.recorder import RECORDINGS_DIR
if not file.filename or not file.filename.endswith('.tsr'):
raise HTTPException(400, "Only .tsr files are accepted")
dest = RECORDINGS_DIR / file.filename
dest.write_bytes(await file.read())
path = RECORDINGS_DIR / filename
if path.exists(): path.unlink()
return {"ok": True}