AEB-71: Added 3D navigation in monitoring zones
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user