mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 12:25:22 +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,37 @@
|
|||
import { useFormikContext } from 'formik';
|
||||
|
||||
import { FormSection } from '@@/form-components/FormSection';
|
||||
import { BoxSelector } from '@@/BoxSelector';
|
||||
|
||||
import { cronMethodOptions } from '../../CreateView/cron-method-options';
|
||||
|
||||
import { FormValues } from './types';
|
||||
import { AdvancedCronFieldset } from './AdvancedCronFieldset';
|
||||
import { BasicCronFieldset } from './BasicCronFieldset';
|
||||
|
||||
export function JobConfigurationFieldset() {
|
||||
const { values, setFieldValue } = useFormikContext<FormValues>();
|
||||
|
||||
return (
|
||||
<>
|
||||
<FormSection title="Edge job configuration">
|
||||
<BoxSelector
|
||||
slim
|
||||
radioName="configuration"
|
||||
value={values.cronMethod}
|
||||
options={cronMethodOptions}
|
||||
onChange={(value) => {
|
||||
setFieldValue('cronMethod', value);
|
||||
setFieldValue('cronExpression', '');
|
||||
}}
|
||||
/>
|
||||
</FormSection>
|
||||
|
||||
{values.cronMethod === 'basic' ? (
|
||||
<BasicCronFieldset />
|
||||
) : (
|
||||
<AdvancedCronFieldset />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue