mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
feat(kubernetes): support for jobs and cron jobs - r8s-182 (#260)
Co-authored-by: James Carppe <85850129+jamescarppe@users.noreply.github.com> Co-authored-by: Anthony Lapenna <anthony.lapenna@portainer.io> Co-authored-by: andres-portainer <91705312+andres-portainer@users.noreply.github.com> Co-authored-by: Oscar Zhou <100548325+oscarzhou-portainer@users.noreply.github.com> Co-authored-by: Yajith Dayarathna <yajith.dayarathna@portainer.io> Co-authored-by: LP B <xAt0mZ@users.noreply.github.com> Co-authored-by: oscarzhou <oscar.zhou@portainer.io> Co-authored-by: testA113 <aliharriss1995@gmail.com>
This commit is contained in:
parent
24fdb1f600
commit
d32b0f8b7e
51 changed files with 1786 additions and 22 deletions
51
app/react/kubernetes/more-resources/JobsView/JobsView.tsx
Normal file
51
app/react/kubernetes/more-resources/JobsView/JobsView.tsx
Normal file
|
@ -0,0 +1,51 @@
|
|||
import { useCurrentStateAndParams } from '@uirouter/react';
|
||||
import { CalendarCheck2, CalendarSync } from 'lucide-react';
|
||||
|
||||
import { useUnauthorizedRedirect } from '@/react/hooks/useUnauthorizedRedirect';
|
||||
|
||||
import { PageHeader } from '@@/PageHeader';
|
||||
import { WidgetTabs, Tab, findSelectedTabIndex } from '@@/Widget/WidgetTabs';
|
||||
|
||||
import { JobsDatatable } from './JobsDatatable/JobsDatatable';
|
||||
import { CronJobsDatatable } from './CronJobsDatatable/CronJobsDatatable';
|
||||
|
||||
export function JobsView() {
|
||||
useUnauthorizedRedirect(
|
||||
{ authorizations: ['K8sJobsR', 'K8sCronJobsR'] },
|
||||
{ to: 'kubernetes.dashboard' }
|
||||
);
|
||||
|
||||
const tabs: Tab[] = [
|
||||
{
|
||||
name: 'Cron Jobs',
|
||||
icon: CalendarSync,
|
||||
widget: <CronJobsDatatable />,
|
||||
selectedTabParam: 'cronJobs',
|
||||
},
|
||||
{
|
||||
name: 'Jobs',
|
||||
icon: CalendarCheck2,
|
||||
widget: <JobsDatatable />,
|
||||
selectedTabParam: 'jobs',
|
||||
},
|
||||
];
|
||||
|
||||
const currentTabIndex = findSelectedTabIndex(
|
||||
useCurrentStateAndParams(),
|
||||
tabs
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageHeader
|
||||
title="Cron Jobs & Jobs lists"
|
||||
breadcrumbs="Cron Jobs & Jobs"
|
||||
reload
|
||||
/>
|
||||
<>
|
||||
<WidgetTabs tabs={tabs} currentTabIndex={currentTabIndex} />
|
||||
<div className="content">{tabs[currentTabIndex].widget}</div>
|
||||
</>
|
||||
</>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue