From f6f9a7a67b8da462d622c6bc004c22417bba7438 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 2 Feb 2024 13:28:15 -0700 Subject: [PATCH] Node: Sort jobs chronologically Signed-off-by: Zack Cerza --- src/components/JobList/index.tsx | 9 +++++---- src/pages/Node/index.tsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/JobList/index.tsx b/src/components/JobList/index.tsx index 6fca51f..f9ed017 100644 --- a/src/components/JobList/index.tsx +++ b/src/components/JobList/index.tsx @@ -197,9 +197,10 @@ function JobDetailPanel(props: JobDetailPanelProps): ReactNode { type JobListProps = { query: UseQueryResult | UseQueryResult; + sortMode?: "time" | "id"; } -export default function JobList({ query }: JobListProps) { +export default function JobList({ query, sortMode }: JobListProps) { const options = useDefaultTableOptions(); const data = query.data?.jobs || []; const table = useMaterialReactTable({ @@ -213,7 +214,7 @@ export default function JobList({ query }: JobListProps) { columnVisibility: { posted: false, updated: false, - runtime: false, + duration: false, waiting: false, }, pagination: { @@ -222,8 +223,8 @@ export default function JobList({ query }: JobListProps) { }, sorting: [ { - id: "job_id", - desc: false, + id: sortMode === "time"? "started" : "job_id", + desc: true, }, ], }, diff --git a/src/pages/Node/index.tsx b/src/pages/Node/index.tsx index 53ec848..89fcee9 100644 --- a/src/pages/Node/index.tsx +++ b/src/pages/Node/index.tsx @@ -36,7 +36,7 @@ export default function Node() {
- +