diff --git a/ui/src/components/SchedulerEntriesTable.tsx b/ui/src/components/SchedulerEntriesTable.tsx index fd672e8..d10018f 100644 --- a/ui/src/components/SchedulerEntriesTable.tsx +++ b/ui/src/components/SchedulerEntriesTable.tsx @@ -2,6 +2,7 @@ import React, { useState } from "react"; import clsx from "clsx"; import { makeStyles } from "@material-ui/core/styles"; import Collapse from "@material-ui/core/Collapse"; +import Box from "@material-ui/core/Box"; import IconButton from "@material-ui/core/IconButton"; import Table from "@material-ui/core/Table"; import TableBody from "@material-ui/core/TableBody"; @@ -9,6 +10,8 @@ import TableCell from "@material-ui/core/TableCell"; import TableContainer from "@material-ui/core/TableContainer"; import TableHead from "@material-ui/core/TableHead"; import TableRow from "@material-ui/core/TableRow"; +import Typography from "@material-ui/core/Typography"; +import Tooltip from "@material-ui/core/Tooltip"; import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown"; import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp"; import Alert from "@material-ui/lab/Alert"; @@ -43,6 +46,8 @@ enum SortBy { Options, NextEnqueue, PrevEnqueue, + + None, } const colConfigs: SortableTableColumn[] = [ @@ -88,6 +93,12 @@ const colConfigs: SortableTableColumn[] = [ sortBy: SortBy.PrevEnqueue, align: "left", }, + { + label: "", + key: "show_history", + sortBy: SortBy.None, + align: "left", + }, ]; // sortEntries takes a array of entries and return a sorted array. @@ -217,45 +228,103 @@ interface RowProps { } const useRowStyles = makeStyles((theme) => ({ + root: { + "& > *": { + borderBottom: "unset", + }, + }, + historyBox: { + maxWidth: 540, + }, noBorder: { border: "none", }, })); +// TODO: replace with real data +const history = [ + { enqueuedAt: "3m ago", taskId: "abc123" }, + { enqueuedAt: "10m ago", taskId: "xyz456" }, + { enqueuedAt: "30m ago", taskId: "dyz45f" }, +]; + function Row(props: RowProps) { const { entry, isLastRow } = props; const classes = useRowStyles(); + const [open, setOpen] = useState(false); return ( - - - {entry.id} - - - {entry.spec} - - - {entry.task_type} - - - - {JSON.stringify(entry.task_payload)} - - - - - {entry.options.length > 0 ? entry.options.join(", ") : "No options"} - - - - {durationBefore(entry.next_enqueue_at)} - - - {entry.prev_enqueue_at ? timeAgo(entry.prev_enqueue_at) : "N/A"} - - + + + + {entry.id} + + + {entry.spec} + + + {entry.task_type} + + + + {JSON.stringify(entry.task_payload)} + + + + + {entry.options.length > 0 ? entry.options.join(", ") : "No options"} + + + + {durationBefore(entry.next_enqueue_at)} + + + {entry.prev_enqueue_at ? timeAgo(entry.prev_enqueue_at) : "N/A"} + + + + setOpen(!open)} + > + {open ? : } + + + + + + + + + + History + + + + + Enqueued + Task ID + + + + {history.map((historyRow) => ( + + + {historyRow.enqueuedAt} + + {historyRow.taskId} + + ))} + +
+
+
+
+
+
); }