54337a5917
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>
22 lines
621 B
Python
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,
|
|
)
|