fix: show hostname for agent events on dashboard (0.4.8)
Prefix heartbeat and other agent.* lines in recent events with hostname. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -13,8 +13,8 @@ android {
|
||||
applicationId = "ru.kalinamall.seaca"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 11
|
||||
versionName = "0.4.7"
|
||||
versionCode = 12
|
||||
versionName = "0.4.8"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@@ -79,7 +79,11 @@ fun DashboardScreen(repo: SacRepository) {
|
||||
StatCard("Хосты", "${d.hostsTotal} (stale: ${d.hostsStale})")
|
||||
Text("Последние события", style = MaterialTheme.typography.titleMedium)
|
||||
d.recentEvents.take(8).forEach { e ->
|
||||
Text("${e.severity} · ${e.title}", style = MaterialTheme.typography.bodySmall)
|
||||
Text(
|
||||
dashboardRecentEventLine(e),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
}
|
||||
}
|
||||
if (data == null && loading) {
|
||||
@@ -89,6 +93,15 @@ fun DashboardScreen(repo: SacRepository) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun dashboardRecentEventLine(event: EventSummary): String {
|
||||
val body = if (event.type.startsWith("agent.")) {
|
||||
"${event.hostname}: ${event.title}"
|
||||
} else {
|
||||
event.title
|
||||
}
|
||||
return "${event.severity}: $body"
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun StatCard(label: String, value: String) {
|
||||
Card(Modifier.fillMaxWidth()) {
|
||||
|
||||
Reference in New Issue
Block a user