2022-11-13 10:29:25 +00:00
|
|
|
import { useEnvironmentId } from '@/react/hooks/useEnvironmentId';
|
|
|
|
|
|
|
|
import { PageHeader } from '@@/PageHeader';
|
|
|
|
|
|
|
|
import { useJobs } from './useJobs';
|
|
|
|
import { JobsDatatable } from './JobsDatatable';
|
|
|
|
|
|
|
|
export function JobsView() {
|
|
|
|
const environmentId = useEnvironmentId();
|
|
|
|
const jobsQuery = useJobs(environmentId);
|
|
|
|
|
|
|
|
async function reloadData() {
|
|
|
|
await jobsQuery.refetch();
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<PageHeader
|
|
|
|
title="Nomad Job list"
|
|
|
|
breadcrumbs={[{ label: 'Nomad Jobs' }]}
|
|
|
|
reload
|
|
|
|
loading={jobsQuery.isLoading}
|
|
|
|
onReload={reloadData}
|
|
|
|
/>
|
|
|
|
|
2022-11-22 12:16:34 +00:00
|
|
|
<JobsDatatable
|
|
|
|
jobs={jobsQuery.data || []}
|
|
|
|
refreshData={reloadData}
|
|
|
|
isLoading={jobsQuery.isLoading}
|
|
|
|
/>
|
2022-11-13 10:29:25 +00:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|