mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-12 15:16:49 +00:00
Fix status history and show on the health check
This commit is contained in:
@@ -227,7 +227,7 @@ export default function HealthChecksTable({
|
||||
header: () => <span className="p-3">Uptime (30d)</span>,
|
||||
cell: ({ row }) => {
|
||||
return (
|
||||
<UptimeMiniBar targetId={row.original.targetHealthCheckId} days={30} />
|
||||
<UptimeMiniBar orgId={orgId} healthCheckId={row.original.targetHealthCheckId} days={30} />
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -45,16 +45,18 @@ const barColorClass: Record<string, string> = {
|
||||
};
|
||||
|
||||
type UptimeBarProps = {
|
||||
orgId?: string;
|
||||
siteId?: number;
|
||||
targetId?: number;
|
||||
healthCheckId?: number;
|
||||
days?: number;
|
||||
title?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export default function UptimeBar({
|
||||
orgId,
|
||||
siteId,
|
||||
targetId,
|
||||
healthCheckId,
|
||||
days = 90,
|
||||
title,
|
||||
className
|
||||
@@ -68,8 +70,8 @@ export default function UptimeBar({
|
||||
});
|
||||
|
||||
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 }
|
||||
});
|
||||
|
||||
@@ -205,4 +207,4 @@ export default function UptimeBar({
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user