feat: #2 G-force circle dashboard + .tsr export/import
- g_force dashboard: acceleration vector on 2G ring, lat/long G readout - .tsr files export/import via API and UI - Composite dashboard reverted (G-force is standalone)
This commit is contained in:
@@ -469,3 +469,23 @@ async def api_start_playback(data: dict):
|
||||
async def api_stop_playback():
|
||||
_get_player().stop()
|
||||
return {"ok": True, "playing": False}
|
||||
|
||||
|
||||
@router.get("/recording/{filename}/export")
|
||||
async def api_export_recording(filename: str):
|
||||
from fastapi.responses import FileResponse
|
||||
from server.recorder import RECORDINGS_DIR
|
||||
path = RECORDINGS_DIR / filename
|
||||
if not path.exists():
|
||||
raise HTTPException(404, "Recording not found")
|
||||
return FileResponse(path, media_type="application/octet-stream", filename=filename)
|
||||
|
||||
|
||||
@router.post("/recording/import")
|
||||
async def api_import_recording(file: UploadFile = File(...)):
|
||||
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())
|
||||
return {"ok": True}
|
||||
|
||||
Reference in New Issue
Block a user