fix: load hidden host events via include_hidden API

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
PTah
2026-06-29 15:16:10 +10:00
parent d794d7dc48
commit 3bb81e40af
2 changed files with 11 additions and 4 deletions
@@ -29,6 +29,8 @@ interface SacApi {
@Query("page_size") pageSize: Int = 30,
@Query("severity") severity: String? = null,
@Query("type") type: String? = null,
@Query("host_id") hostId: Long? = null,
@Query("include_hidden") includeHidden: Boolean? = null,
@Query("hostname") hostname: String? = null,
@Query("q") q: String? = null,
): EventListResponse
@@ -389,7 +389,7 @@ fun HostDetailScreen(
HostDetailTab.Info -> HostInfoContent(host, repo, dateMode)
HostDetailTab.Events -> HostEventsContent(
repo = repo,
hostname = host.hostname,
hostId = host.id,
onOpenEvent = onOpenEvent,
)
}
@@ -428,7 +428,7 @@ private fun HostInfoContent(host: HostDetail, repo: SacRepository, dateMode: Dat
@Composable
private fun HostEventsContent(
repo: SacRepository,
hostname: String,
hostId: Long,
onOpenEvent: (Long) -> Unit,
) {
var page by remember { mutableIntStateOf(1) }
@@ -448,7 +448,12 @@ private fun HostEventsContent(
error = null
try {
val res = repo.withAuth {
it.listEvents(page = page, pageSize = 30, hostname = hostname)
it.listEvents(
page = page,
pageSize = 30,
hostId = hostId,
includeHidden = true,
)
}
items = res.items
total = res.total
@@ -461,7 +466,7 @@ private fun HostEventsContent(
}
}
LaunchedEffect(page, hostname) { load() }
LaunchedEffect(page, hostId) { load() }
Column(
Modifier