2025-02-18 15:41:59 +01:00
|
|
|
import type {FormInstance} from 'antd'
|
|
|
|
|
import {Alert, Checkbox, Form, Input, Typography} from 'antd'
|
|
|
|
|
import React from 'react'
|
2025-02-18 17:20:33 +01:00
|
|
|
import type {Connector} from '../../api/connectors'
|
|
|
|
|
import {ConnectorProvider} from '../../api/connectors'
|
2025-02-18 15:41:59 +01:00
|
|
|
import {t} from 'ttag'
|
2025-02-18 21:42:15 +01:00
|
|
|
import DefaultConnectorFormItems from "./DefaultConnectorFormItems"
|
|
|
|
|
import {formItemLayoutWithOutLabel, providersConfig} from "../index"
|
2025-02-18 15:41:59 +01:00
|
|
|
|
2025-02-18 17:20:33 +01:00
|
|
|
export default function AutoDnsConnectorForm({form, onCreate}: {
|
|
|
|
|
form: FormInstance,
|
|
|
|
|
onCreate: (values: Connector) => void
|
|
|
|
|
}) {
|
2025-02-18 15:41:59 +01:00
|
|
|
|
2025-02-18 17:32:34 +01:00
|
|
|
form.setFieldValue('provider', ConnectorProvider.AutoDNS)
|
|
|
|
|
|
2025-02-18 15:41:59 +01:00
|
|
|
return (
|
|
|
|
|
<Form
|
|
|
|
|
{...formItemLayoutWithOutLabel}
|
|
|
|
|
form={form}
|
|
|
|
|
layout='horizontal'
|
|
|
|
|
labelCol={{span: 6}}
|
|
|
|
|
wrapperCol={{span: 14}}
|
|
|
|
|
onFinish={onCreate}
|
|
|
|
|
>
|
|
|
|
|
<Alert
|
|
|
|
|
message={t`This provider does not provide a list of supported TLD. Please double check if the domain you want to register is supported.`}
|
|
|
|
|
type='warning'
|
|
|
|
|
style={{marginBottom: '2em'}}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Form.Item
|
|
|
|
|
label={t`AutoDNS Username`}
|
|
|
|
|
name={['authData', 'username']}
|
2025-02-19 00:54:04 +01:00
|
|
|
help={<Typography.Link target='_blank' href='https://en.autodns.com/domain-robot-api/'>
|
|
|
|
|
{t`Because of some limitations in API of AutoDNS, we suggest to create an dedicated user for API with limited rights`}
|
|
|
|
|
</Typography.Link>}
|
2025-02-18 15:41:59 +01:00
|
|
|
rules={[{required: true, message: t`Required`}]}
|
|
|
|
|
>
|
|
|
|
|
<Input autoComplete='off' required/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item
|
|
|
|
|
label={t`AutoDNS Password`}
|
|
|
|
|
name={['authData', 'password']}
|
2025-02-19 00:54:04 +01:00
|
|
|
help={<Typography.Text
|
|
|
|
|
type='secondary'
|
|
|
|
|
>{t`Attention: AutoDNS do not support 2-Factor Authentication on API Users for automated systems`}
|
|
|
|
|
</Typography.Text>}
|
2025-02-18 15:41:59 +01:00
|
|
|
rules={[{required: true, message: t`Required`}]}
|
|
|
|
|
required
|
|
|
|
|
>
|
|
|
|
|
<Input.Password autoComplete='off' required placeholder=''/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item
|
|
|
|
|
label={t`Owner nic-handle`}
|
|
|
|
|
name={['authData', 'contactid']}
|
|
|
|
|
help={<Typography.Text
|
|
|
|
|
type='secondary'
|
2025-02-19 00:54:04 +01:00
|
|
|
>{t`The nic-handle of the domain name owner`} <a
|
2025-02-18 15:41:59 +01:00
|
|
|
href='https://cloud.autodns.com/contacts/domain'
|
|
|
|
|
>{t`You can get it from this page`}
|
|
|
|
|
</a>
|
|
|
|
|
</Typography.Text>}
|
|
|
|
|
rules={[{required: true, message: t`Required`}]}
|
|
|
|
|
required
|
|
|
|
|
>
|
|
|
|
|
<Input autoComplete='off' required placeholder=''/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<Form.Item
|
|
|
|
|
label={t`Context Value`}
|
|
|
|
|
name={['authData', 'context']}
|
|
|
|
|
help={<Typography.Text
|
|
|
|
|
type='secondary'
|
|
|
|
|
>{t`If you not sure, use the default value 4`}
|
|
|
|
|
</Typography.Text>}
|
|
|
|
|
|
|
|
|
|
required={false}
|
|
|
|
|
>
|
|
|
|
|
<Input autoComplete='off' required={false} placeholder='4'/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item
|
|
|
|
|
valuePropName='checked'
|
|
|
|
|
label={t`Owner confirmation`}
|
|
|
|
|
name={['authData', 'ownerConfirm']}
|
|
|
|
|
|
|
|
|
|
rules={[{required: true, message: t`Required`}]}
|
|
|
|
|
>
|
|
|
|
|
<Checkbox
|
|
|
|
|
required
|
|
|
|
|
>{t`Owner confirms his consent of domain order jobs`}
|
|
|
|
|
</Checkbox>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
2025-02-18 21:42:15 +01:00
|
|
|
<DefaultConnectorFormItems tosLink={providersConfig[ConnectorProvider.AutoDNS].tosLink}/>
|
2025-02-18 15:41:59 +01:00
|
|
|
</Form>
|
|
|
|
|
)
|
|
|
|
|
}
|