mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 13:25:26 +02:00
feat(edge/jobs): migrate create view to react [EE-2221] (#11867)
This commit is contained in:
parent
94c91035a7
commit
02fbdfec36
27 changed files with 777 additions and 163 deletions
|
@ -0,0 +1,31 @@
|
|||
import { useFormikContext } from 'formik';
|
||||
|
||||
import { SwitchField } from '@@/form-components/SwitchField';
|
||||
|
||||
import { FormValues } from './types';
|
||||
import { RecurringFieldset, defaultCronExpression } from './RecurringFieldset';
|
||||
import { ScheduledDateFieldset } from './ScheduledDateFieldset';
|
||||
|
||||
export function BasicCronFieldset() {
|
||||
const { values, setFieldValue } = useFormikContext<FormValues>();
|
||||
return (
|
||||
<>
|
||||
<div className="form-group">
|
||||
<div className="col-sm-12">
|
||||
<SwitchField
|
||||
label="Recurring Edge job"
|
||||
checked={values.recurring}
|
||||
onChange={(value) => {
|
||||
setFieldValue('recurring', value);
|
||||
if (value) {
|
||||
setFieldValue('recurringOption', defaultCronExpression);
|
||||
}
|
||||
}}
|
||||
data-cy="edgeJobCreate-recurringSwitch"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{values.recurring ? <RecurringFieldset /> : <ScheduledDateFieldset />}
|
||||
</>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue