Skip to content

Commit

Permalink
Adds friendly schedule, "paused" columns for job description in list (j…
Browse files Browse the repository at this point in the history
…upyter-server#138)

* Adds friendly schedule column

* Adds friendly status column
  • Loading branch information
JasonWeill committed Oct 12, 2022
1 parent e253aea commit 6a21f91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/job-definition-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import TableRow from '@mui/material/TableRow';
import TableCell from '@mui/material/TableCell';

import { Scheduler } from '../handler';
import { useTranslator } from '../hooks';

function CreatedAt(props: {
job: Scheduler.IDescribeJobDefinition;
Expand Down Expand Up @@ -38,14 +39,17 @@ export function buildJobDefinitionRow(
app: JupyterFrontEnd,
openJobDefinitionDetail: (jobDefId: string) => unknown
): JSX.Element {
const trans = useTranslator('jupyterlab');

const cellContents: React.ReactNode[] = [
// name
<a onClick={() => openJobDefinitionDetail(jobDef.job_definition_id)}>
{jobDef.name}
</a>,
PathExt.basename(jobDef.input_uri),
<CreatedAt job={jobDef} />,
<ScheduleSummary schedule={jobDef.schedule} />
<ScheduleSummary schedule={jobDef.schedule} />,
<>{jobDef.active ? trans.__('Active') : trans.__('Paused')}</>
];

return (
Expand Down
4 changes: 4 additions & 0 deletions src/mainviews/list-jobs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ function ListJobDefinitionsTable(props: ListJobDefinitionsTableProps) {
{
sortField: null,
name: trans.__('Schedule')
},
{
sortField: null,
name: trans.__('Status')
}
];

Expand Down

0 comments on commit 6a21f91

Please sign in to comment.