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>
This commit is contained in:
PTah
2026-06-05 09:53:00 +10:00
parent 5d3cda2ab6
commit 54337a5917
23 changed files with 826 additions and 17 deletions
+23
View File
@@ -303,3 +303,26 @@ def test_ssh_failed_template():
assert "root" in text
assert "10.10.36.9" in text
assert "3 / 5" in text
def test_agent_inventory_hardware_change_template():
event = Event(
event_id="00000000-0000-4000-8000-000000000504",
host_id=1,
occurred_at=datetime(2026, 6, 4, 12, 0, tzinfo=timezone.utc),
category="agent",
type="agent.inventory",
severity="warning",
title="Hardware changed",
summary="memory_gb changed",
details={
"hardware_changes": [
{"field": "memory_gb", "old": 16.0, "new": 32.0},
]
},
payload={},
)
text = format_event_telegram_html(event)
assert "железо" in text.lower() or "Изменилось" in text
assert "memory_gb" in text
assert "32" in text