Files
security-alert-center/backend/app/services/event_summary.py
T
PapaTramp 54337a5917 feat: host inventory (agent.inventory), host detail page, UI columns
Store hardware/software snapshots on hosts; warn on hardware changes. Host card from Hosts list. Add agent version column to Events/Overview; rename Hosts table columns and sort by status.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 09:53:00 +10:00

22 lines
621 B
Python

from app.models.event import Event
from app.schemas.list_models import EventSummary
def event_to_summary(event: Event) -> EventSummary:
host = event.host
return EventSummary(
id=event.id,
event_id=event.event_id,
host_id=event.host_id,
hostname=host.hostname,
display_name=host.display_name,
product_version=host.product_version,
occurred_at=event.occurred_at,
received_at=event.received_at,
category=event.category,
type=event.type,
severity=event.severity,
title=event.title,
summary=event.summary,
)