Fix status history and show on the health check

This commit is contained in:
Owen
2026-04-16 20:55:21 -07:00
parent c1782a2650
commit f932cc7aca
13 changed files with 319 additions and 276 deletions

View File

@@ -37,14 +37,16 @@ const barColorClass: Record<string, string> = {
};
type UptimeMiniBarProps = {
orgId?: string;
siteId?: number;
targetId?: number;
healthCheckId?: number;
days?: number;
};
export default function UptimeMiniBar({
orgId,
siteId,
targetId,
healthCheckId,
days = 30
}: UptimeMiniBarProps) {
const api = createApiClient(useEnvContext());
@@ -56,8 +58,8 @@ export default function UptimeMiniBar({
});
const hcQuery = useQuery({
...orgQueries.healthCheckStatusHistory({ targetId: targetId ?? 0, days }),
enabled: targetId != null && siteId == null,
...orgQueries.healthCheckStatusHistory({ orgId: orgId ?? "", healthCheckId: healthCheckId ?? 0, days }),
enabled: healthCheckId != null && siteId == null,
meta: { api }
});
@@ -125,4 +127,4 @@ export default function UptimeMiniBar({
</span>
</div>
);
}
}