diff --git a/resources/scripts/components/server/schedules/TaskDetailsModal.tsx b/resources/scripts/components/server/schedules/TaskDetailsModal.tsx index 9bcc00c14..53481a144 100644 --- a/resources/scripts/components/server/schedules/TaskDetailsModal.tsx +++ b/resources/scripts/components/server/schedules/TaskDetailsModal.tsx @@ -10,6 +10,7 @@ import FlashMessageRender from '@/components/FlashMessageRender'; import { number, object, string } from 'yup'; import useFlash from '@/plugins/useFlash'; import useServer from '@/plugins/useServer'; +import FormikFieldWrapper from '@/components/elements/FormikFieldWrapper'; interface Props { schedule: Schedule; @@ -29,10 +30,8 @@ const TaskDetailsForm = ({ isEditingTask }: { isEditingTask: boolean }) => { const { values: { action }, setFieldValue, setFieldTouched } = useFormikContext(); useEffect(() => { - return () => { - setFieldValue('payload', ''); - setFieldTouched('payload', false); - }; + setFieldValue('payload', action === 'power' ? 'start' : ''); + setFieldTouched('payload', false); }, [ action ]); return ( @@ -56,12 +55,14 @@ const TaskDetailsForm = ({ isEditingTask }: { isEditingTask: boolean }) => { :
- - - - - - + + + + + + + +
}