import { useFormikContext, Field } from 'formik'; import { FormControl } from '@/portainer/components/form-components/FormControl'; import { Input } from '@/portainer/components/form-components/Input'; import { SwitchField } from '@/portainer/components/form-components/SwitchField'; import { TextTip } from '@/portainer/components/Tip/TextTip'; import { NomadTokenField } from './NomadTokenField'; import { ScriptFormValues } from './types'; interface Props { isNomadTokenVisible?: boolean; hideIdGetter?: boolean; } export function EdgeScriptSettingsFieldset({ isNomadTokenVisible, hideIdGetter, }: Props) { const { values, setFieldValue } = useFormikContext(); return ( <> {!hideIdGetter && ( <> setFieldValue(e.target.name, e.target.value)} />
PORTAINER_EDGE_ID environment variable is required to successfully connect the edge agent to Portainer
)} {isNomadTokenVisible && }
setFieldValue('allowSelfSignedCertificates', value) } label="Allow self-signed certs" tooltip="When allowing self-signed certificates the edge agent will ignore the domain validation when connecting to Portainer via HTTPS" />
); }