diff --git a/client/src/Pages/Logs/TabQueue.tsx b/client/src/Pages/Logs/TabQueue.tsx index 84573e8f0..51c9693c0 100644 --- a/client/src/Pages/Logs/TabQueue.tsx +++ b/client/src/Pages/Logs/TabQueue.tsx @@ -19,7 +19,7 @@ export const TabQueue = () => { isLoading, // error, refetch, - } = useGet("/queue/all-metrics", {}, { refreshInterval: 5000 }); + } = useGet("/queue/all-metrics", {}, { refreshInterval: 1000 }); const { post, loading: isFlushing } = usePost(); diff --git a/client/src/Pages/Logs/components/TableJobs.tsx b/client/src/Pages/Logs/components/TableJobs.tsx index f690bd417..1f1da1003 100644 --- a/client/src/Pages/Logs/components/TableJobs.tsx +++ b/client/src/Pages/Logs/components/TableJobs.tsx @@ -30,6 +30,22 @@ export const TableJobs = ({ jobs }: TableJobsProps) => { }; const headers: Header[] = [ + { + id: "state", + content: t("pages.logs.table.headers.state"), + render: (row) => { + if (row.lockedAt) { + return t("common.labels.running"); + } + if (row.monitorActive === true) { + return t("common.labels.active"); + } + if (row.monitorActive === false) { + return t("common.labels.paused"); + } + return t("common.labels.idle"); + }, + }, { id: "id", content: t("common.table.headers.monitorId"), @@ -47,7 +63,10 @@ export const TableJobs = ({ jobs }: TableJobsProps) => { id: "url", content: t("common.table.headers.url"), render: (row) => ( - + {row.monitorUrl} ), @@ -60,9 +79,15 @@ export const TableJobs = ({ jobs }: TableJobsProps) => { { id: "interval", content: t("common.table.headers.interval"), - render: (row) => ( - {prettyMilliseconds(row.monitorInterval ?? 0)} - ), + render: (row) => { + let interval; + if (row.monitorId.toString().includes("geo")) { + interval = row.monitorGeoInterval ?? 0; + } else { + interval = row.repeat ?? 0; + } + return {prettyMilliseconds(interval)}; + }, }, { id: "lastRun", @@ -70,7 +95,10 @@ export const TableJobs = ({ jobs }: TableJobsProps) => { render: (row) => { const v = formatTimestamp(row.lastRunAt) ?? "-"; return ( - + {v} ); @@ -90,7 +118,10 @@ export const TableJobs = ({ jobs }: TableJobsProps) => { render: (row) => { const v = formatTimestamp(row.lockedAt) ?? "-"; return ( - + {v} ); @@ -100,6 +131,7 @@ export const TableJobs = ({ jobs }: TableJobsProps) => { const isDark = theme.palette.mode === "dark"; const runningBg = isDark ? "rgba(19, 113, 91, 0.18)" : "#ECF7F2"; + const pausedBg = isDark ? "rgba(255, 165, 0, 0.18)" : "#FFF4E5"; return ( { ...(row.lockedAt && { "& td": { backgroundColor: runningBg }, }), + ...(row.monitorActive === false && { + "& td": { backgroundColor: pausedBg }, + }), })} /> ); diff --git a/client/src/Types/Queue.ts b/client/src/Types/Queue.ts index 77a770aeb..bbb3ca9a4 100644 --- a/client/src/Types/Queue.ts +++ b/client/src/Types/Queue.ts @@ -23,6 +23,8 @@ export interface QueueJobSummary { monitorUrl: string | null; monitorType: MonitorType | null; monitorInterval: number | null; + monitorGeoInterval: number | null; + monitorActive: boolean | null; active: boolean; lockedAt: number | null; runCount: number; @@ -32,6 +34,7 @@ export interface QueueJobSummary { lastFinishedAt: number | null; lastRunTook: number | null; lastFailedAt: number | null; + repeat: number | null; } export interface QueueData { diff --git a/client/src/locales/en.json b/client/src/locales/en.json index b5fe0c1cb..a08cdfe8a 100644 --- a/client/src/locales/en.json +++ b/client/src/locales/en.json @@ -70,7 +70,9 @@ }, "labels": { "active": "Active", - "paused": "paused", + "running": "Running", + "paused": "Paused", + "idle": "Idle", "na": "N/A", "resolved": "Resolved", "responseTime": "Response time" @@ -887,6 +889,7 @@ }, "table": { "headers": { + "state": "State", "timestamp": "Timestamp", "level": "Level", "service": "Service",