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

@@ -89,16 +89,21 @@ export async function GET(req: NextRequest) {
return true
}) : list
const transformed = filtered.map((a) => ({
id: a.id,
detector_name: a.name,
message: a.message,
type: a.severity,
location: a.object,
priority: a.severity,
acknowledged: a.resolved,
timestamp: a.created_at,
}))
const transformed = filtered.map((a) => {
const severity = String(a?.severity || a?.type || '').toLowerCase()
const type = severity === 'critical' ? 'critical' : severity === 'warning' ? 'warning' : 'info'
const priority = severity === 'critical' ? 'high' : severity === 'warning' ? 'medium' : 'low'
return {
id: a.id,
detector_name: a.name || a.detector_name,
message: a.message,
type,
location: a.object,
priority,
acknowledged: typeof a.acknowledged === 'boolean' ? a.acknowledged : !!a.resolved,
timestamp: a.timestamp || a.created_at,
}
})
return NextResponse.json({ success: true, data: transformed })
} catch (error) {