1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 13:55:21 +02:00

refactor(nomad): sync frontend with EE [EE-3353] (#7758)

This commit is contained in:
Chaim Lev-Ari 2022-11-13 12:29:25 +02:00 committed by GitHub
parent 78dcba614d
commit 881e99df53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
68 changed files with 1799 additions and 17 deletions

View file

@ -0,0 +1,46 @@
import { useEnvironmentId } from '@/react/hooks/useEnvironmentId';
import { PageHeader } from '@@/PageHeader';
import { TableSettingsProvider } from '@@/datatables/useTableSettings';
import { useJobs } from './useJobs';
import { JobsDatatable } from './JobsDatatable';
export function JobsView() {
const environmentId = useEnvironmentId();
const jobsQuery = useJobs(environmentId);
const defaultSettings = {
autoRefreshRate: 10,
pageSize: 10,
sortBy: { id: 'name', desc: false },
};
async function reloadData() {
await jobsQuery.refetch();
}
return (
<>
<PageHeader
title="Nomad Job list"
breadcrumbs={[{ label: 'Nomad Jobs' }]}
reload
loading={jobsQuery.isLoading}
onReload={reloadData}
/>
<div className="row">
<div className="col-sm-12">
<TableSettingsProvider defaults={defaultSettings} storageKey="jobs">
<JobsDatatable
jobs={jobsQuery.data || []}
refreshData={reloadData}
isLoading={jobsQuery.isLoading}
/>
</TableSettingsProvider>
</div>
</div>
</>
);
}