fix(client): job queue table layout + theme-aware running-row tint
TableJobs: - Cut from 11 to 7 columns, dropping active / runCount / failCount / lastFinishedAt (covered by Failed jobs table or by lastRun + lastRunTook). - All cells get whiteSpace:nowrap + textOverflow:ellipsis + maxWidth so long timestamps and IDs no longer wrap and inflate row height; full value visible via title tooltip. - Running-row tint: was theme.palette.success.light (too saturated in light, drowns white text in dark). Now #ECF7F2 in light, an 18%-alpha green in dark — readable in both modes. TabQueue: - One-line explainer above the Job queue heading, with the words "Highlighted rows" wrapped in the same green tint so the meaning is immediately associated. - One-line explainer above Failed jobs heading too.
This commit is contained in:
1 parent
0a3ff275ae
commit
0c765d5ce5
1 file changed
+50
-35
@@ -22,77 +22,92 @@ export const TableJobs = ({ jobs }: TableJobsProps) => {
|
|||||||
id: job.monitorId,
|
id: job.monitorId,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const cellSx = {
|
||||||
|
whiteSpace: "nowrap" as const,
|
||||||
|
overflow: "hidden",
|
||||||
|
textOverflow: "ellipsis",
|
||||||
|
maxWidth: 220,
|
||||||
|
};
|
||||||
|
|
||||||
const headers: Header<QueueJobWithId>[] = [
|
const headers: Header<QueueJobWithId>[] = [
|
||||||
{
|
{
|
||||||
id: "id",
|
id: "id",
|
||||||
content: t("common.table.headers.monitorId"),
|
content: t("common.table.headers.monitorId"),
|
||||||
render: (row) => <Typography fontFamily={"monospace"}>{row.monitorId}</Typography>,
|
render: (row) => (
|
||||||
|
<Typography
|
||||||
|
fontFamily="monospace"
|
||||||
|
title={String(row.monitorId)}
|
||||||
|
sx={cellSx}
|
||||||
|
>
|
||||||
|
{row.monitorId}
|
||||||
|
</Typography>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "url",
|
id: "url",
|
||||||
content: t("common.table.headers.url"),
|
content: t("common.table.headers.url"),
|
||||||
render: (row) => <Typography>{row.monitorUrl}</Typography>,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "interval",
|
|
||||||
content: t("common.table.headers.interval"),
|
|
||||||
render: (row) => (
|
render: (row) => (
|
||||||
<Typography>{prettyMilliseconds(row.monitorInterval ?? 0)}</Typography>
|
<Typography title={row.monitorUrl ?? ""} sx={cellSx}>
|
||||||
|
{row.monitorUrl}
|
||||||
|
</Typography>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "type",
|
id: "type",
|
||||||
content: t("common.table.headers.type"),
|
content: t("common.table.headers.type"),
|
||||||
render: (row) => <Typography>{row.monitorType}</Typography>,
|
render: (row) => <Typography sx={cellSx}>{row.monitorType}</Typography>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "active",
|
id: "interval",
|
||||||
content: t("common.table.headers.active"),
|
content: t("common.table.headers.interval"),
|
||||||
render: (row) => <Typography>{row.active.toString()}</Typography>,
|
render: (row) => (
|
||||||
},
|
<Typography sx={cellSx}>{prettyMilliseconds(row.monitorInterval ?? 0)}</Typography>
|
||||||
{
|
),
|
||||||
id: "runCount",
|
|
||||||
content: t("pages.logs.table.headers.runCount"),
|
|
||||||
render: (row) => <Typography>{row.runCount}</Typography>,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "failCount",
|
|
||||||
content: t("pages.logs.table.headers.failCount"),
|
|
||||||
render: (row) => <Typography>{row.failCount}</Typography>,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "lastRun",
|
id: "lastRun",
|
||||||
content: t("pages.logs.table.headers.lastRunAt"),
|
content: t("pages.logs.table.headers.lastRunAt"),
|
||||||
render: (row) => <Typography>{formatTimestamp(row.lastRunAt)}</Typography>,
|
render: (row) => {
|
||||||
},
|
const v = formatTimestamp(row.lastRunAt) ?? "-";
|
||||||
{
|
return (
|
||||||
id: "lockedAt",
|
<Typography title={v} sx={cellSx}>
|
||||||
content: t("pages.logs.table.headers.lockedAt"),
|
{v}
|
||||||
render: (row) => <Typography>{formatTimestamp(row.lockedAt)}</Typography>,
|
</Typography>
|
||||||
},
|
);
|
||||||
|
},
|
||||||
{
|
|
||||||
id: "lastFinish",
|
|
||||||
content: t("pages.logs.table.headers.lastFinishedAt"),
|
|
||||||
render: (row) => <Typography>{formatTimestamp(row.lastFinishedAt)}</Typography>,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "lastRunTook",
|
id: "lastRunTook",
|
||||||
content: t("pages.logs.table.headers.lastRunTook"),
|
content: t("pages.logs.table.headers.lastRunTook"),
|
||||||
render: (row) => {
|
render: (row) => {
|
||||||
const value = row.lastRunTook ? prettyMilliseconds(row.lastRunTook) : "-";
|
const value = row.lastRunTook ? prettyMilliseconds(row.lastRunTook) : "-";
|
||||||
return <Typography>{value}</Typography>;
|
return <Typography sx={cellSx}>{value}</Typography>;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "lockedAt",
|
||||||
|
content: t("pages.logs.table.headers.lockedAt"),
|
||||||
|
render: (row) => {
|
||||||
|
const v = formatTimestamp(row.lockedAt) ?? "-";
|
||||||
|
return (
|
||||||
|
<Typography title={v} sx={cellSx}>
|
||||||
|
{v}
|
||||||
|
</Typography>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const isDark = theme.palette.mode === "dark";
|
||||||
|
const runningBg = isDark ? "rgba(19, 113, 91, 0.18)" : "#ECF7F2";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table
|
<Table
|
||||||
headers={headers}
|
headers={headers}
|
||||||
data={jobsWithId}
|
data={jobsWithId}
|
||||||
getRowSx={(row) => ({
|
getRowSx={(row) => ({
|
||||||
...(row.lockedAt && {
|
...(row.lockedAt && {
|
||||||
"& td": { backgroundColor: theme.palette.success.light },
|
"& td": { backgroundColor: runningBg },
|
||||||
}),
|
}),
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user