AEB-71: Added 3D navigation in monitoring zones
This commit is contained in:
@@ -67,6 +67,20 @@ export async function GET() {
|
||||
checked: sensor.checked ?? false,
|
||||
location: sensor.zone ?? '',
|
||||
serial_number: sensor.serial_number ?? sensor.name ?? '',
|
||||
detector_type: sensor.detector_type ?? '',
|
||||
notifications: Array.isArray(sensor.notifications) ? sensor.notifications.map((n: any) => {
|
||||
const severity = String(n?.severity || n?.type || '').toLowerCase()
|
||||
const type = severity === 'critical' ? 'critical' : severity === 'warning' ? 'warning' : 'info'
|
||||
const priority = severity === 'critical' ? 'high' : severity === 'warning' ? 'medium' : 'low'
|
||||
return {
|
||||
id: n.id,
|
||||
type,
|
||||
message: n.message,
|
||||
timestamp: n.timestamp || n.created_at,
|
||||
acknowledged: typeof n.acknowledged === 'boolean' ? n.acknowledged : !!n.resolved,
|
||||
priority,
|
||||
}
|
||||
}) : []
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user