mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-04 19:44:47 +00:00
Add the status to the resources and ajust location
This commit is contained in:
@@ -516,7 +516,7 @@ export default function ProxyResourcesTable({
|
||||
},
|
||||
{
|
||||
id: "statusHistory",
|
||||
friendlyName: t("statusHistory"),
|
||||
friendlyName: t("uptime30d"),
|
||||
header: () => <span className="p-3">{t("statusHistory")}</span>,
|
||||
cell: ({ row }) => {
|
||||
const resourceRow = row.original;
|
||||
|
||||
@@ -47,6 +47,7 @@ const barColorClass: Record<string, string> = {
|
||||
type UptimeBarProps = {
|
||||
orgId?: string;
|
||||
siteId?: number;
|
||||
resourceId?: number;
|
||||
healthCheckId?: number;
|
||||
days?: number;
|
||||
title?: string;
|
||||
@@ -56,6 +57,7 @@ type UptimeBarProps = {
|
||||
export default function UptimeBar({
|
||||
orgId,
|
||||
siteId,
|
||||
resourceId,
|
||||
healthCheckId,
|
||||
days = 90,
|
||||
title,
|
||||
@@ -71,11 +73,20 @@ export default function UptimeBar({
|
||||
|
||||
const hcQuery = useQuery({
|
||||
...orgQueries.healthCheckStatusHistory({ orgId: orgId ?? "", healthCheckId: healthCheckId ?? 0, days }),
|
||||
enabled: healthCheckId != null && siteId == null,
|
||||
enabled: healthCheckId != null && siteId == null && resourceId == null,
|
||||
meta: { api }
|
||||
});
|
||||
|
||||
const { data, isLoading } = siteId != null ? siteQuery : hcQuery;
|
||||
const resourceQuery = useQuery({
|
||||
...orgQueries.resourceStatusHistory({ resourceId, days }),
|
||||
enabled: resourceId != null && siteId == null && healthCheckId == null,
|
||||
meta: { api }
|
||||
});
|
||||
|
||||
const { data, isLoading } =
|
||||
siteId != null ? siteQuery :
|
||||
resourceId != null ? resourceQuery :
|
||||
hcQuery;
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user