Private
Public Access
1
0

fix: health checks list not showing - API returns {checks:[...]} not array
Some checks failed
CI Pipeline / Rust Format Check (push) Failing after 5s
CI Pipeline / Clippy Lints (push) Successful in 46s
CI Pipeline / Rust Unit Tests (push) Successful in 1m1s
CI Pipeline / Security Audit (push) Successful in 4s
CI Pipeline / Frontend Lint & Type Check (push) Failing after 9s
CI Pipeline / Build .deb & Release (push) Has been skipped

- Fixed data extraction: use res.data?.checks instead of Array.isArray(res.data)
- Added Target column to health checks table showing service_name or URL
- Matches the pattern used by maintenance windows (res.data?.windows)
This commit is contained in:
2026-05-06 03:51:40 +00:00
parent 00cdadafce
commit 3d9b2d4917

View File

@ -631,7 +631,7 @@ export default function HostDetailPage() {
setHcLoading(true) setHcLoading(true)
try { try {
const res = await healthChecksApi.list(id) const res = await healthChecksApi.list(id)
setHealthChecks(Array.isArray(res.data) ? res.data : []) setHealthChecks(res.data?.checks ?? [])
} catch { /* ignore */ } } catch { /* ignore */ }
finally { setHcLoading(false) } finally { setHcLoading(false) }
}, [id]) }, [id])
@ -1019,6 +1019,7 @@ export default function HostDetailPage() {
<TableCell>Name</TableCell> <TableCell>Name</TableCell>
<TableCell>Type</TableCell> <TableCell>Type</TableCell>
<TableCell>Status</TableCell> <TableCell>Status</TableCell>
<TableCell>Target</TableCell>
<TableCell>Enabled</TableCell> <TableCell>Enabled</TableCell>
<TableCell>Detail</TableCell> <TableCell>Detail</TableCell>
<TableCell>Latency</TableCell> <TableCell>Latency</TableCell>
@ -1033,6 +1034,13 @@ export default function HostDetailPage() {
<TableCell> <TableCell>
<Chip label={check.check_type} size="small" variant="outlined" /> <Chip label={check.check_type} size="small" variant="outlined" />
</TableCell> </TableCell>
<TableCell>
<Typography variant="body2" sx={{ maxWidth: 250, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
{check.check_type === 'service'
? (check.service_name ?? '—')
: (check.url ?? '—')}
</Typography>
</TableCell>
<TableCell> <TableCell>
{check.last_result ? ( {check.last_result ? (
check.last_result.healthy ? ( check.last_result.healthy ? (