AEB-71: Added 3D navigation in monitoring zones

This commit is contained in:
iv_vuytsik
2025-11-11 10:07:38 +03:00
parent 549a05509b
commit 88653cb07c
27 changed files with 503 additions and 184 deletions

View File

@@ -36,10 +36,16 @@ export async function GET(req: NextRequest) {
if (!backendUrl) {
return NextResponse.json({ success: false, error: 'BACKEND_URL is not configured' }, { status: 500 })
}
const url = new URL(req.url)
const timePeriod = url.searchParams.get('time_period')
const qs = timePeriod ? `?time_period=${encodeURIComponent(timePeriod)}` : ''
const timePeriodRaw = url.searchParams.get('time_period')
const allowedPeriods = new Set([24, 72, 168, 720])
let timePeriodNum = timePeriodRaw ? Number(timePeriodRaw) : undefined
if (Number.isNaN(timePeriodNum)) {
timePeriodNum = undefined
}
const finalTimePeriod = timePeriodNum && allowedPeriods.has(timePeriodNum) ? String(timePeriodNum) : '168'
const qs = `?time_period=${encodeURIComponent(finalTimePeriod)}`
const res = await fetch(`${backendUrl}/account/get-dashboard/${qs}`, {
headers: {