mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-06 17:53:19 +08:00
Connect bridge telemetry to FlightLab with auto-advance triggers
Map raw bridge fields (ias_kt, on_ground, etc.) to FlightLabTelemetryState format, add direct telemetry polling endpoint for solo mode, and show sim condition panel in sidebar regardless of auto-advance toggle state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
20
server/api/flightlab/telemetry.get.ts
Normal file
20
server/api/flightlab/telemetry.get.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { requireUserSession } from '../../utils/auth'
|
||||
import { flightlabTelemetryStore } from '../../utils/flightlabTelemetry'
|
||||
|
||||
/**
|
||||
* Returns the latest bridge telemetry for the authenticated user.
|
||||
* Used by FlightLab in solo mode (no WebSocket session) to poll telemetry.
|
||||
*
|
||||
* GET /api/flightlab/telemetry
|
||||
* Authorization: Bearer <access-token>
|
||||
*/
|
||||
export default defineEventHandler(async (event) => {
|
||||
const user = await requireUserSession(event)
|
||||
const userId = String(user._id)
|
||||
const telemetry = flightlabTelemetryStore.get(userId)
|
||||
|
||||
return {
|
||||
telemetry,
|
||||
timestamp: telemetry?.timestamp ?? null,
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user