mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-06-28 20:05:39 +08:00
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>
21 lines
623 B
TypeScript
21 lines
623 B
TypeScript
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,
|
|
}
|
|
})
|