chore: merge master

This commit is contained in:
Maël Gangloff
2024-10-02 12:59:37 +02:00
22 changed files with 1302 additions and 985 deletions

View File

@@ -1,4 +1,4 @@
import {Alert, Button, Checkbox, Form, FormInstance, Input, Popconfirm, Select, Space, Typography } from "antd";
import {Alert, Button, Checkbox, Form, FormInstance, Input, Popconfirm, Select, Space, Typography} from "antd";
import React, {useState} from "react";
import {Connector, ConnectorProvider} from "../../../utils/api/connectors";
import {t} from "ttag";
@@ -134,9 +134,10 @@ export function ConnectorForm({form, onCreate}: { form: FormInstance, onCreate:
}
{
provider === ConnectorProvider.AUTODNS && <>
<Alert message={t`Because of some limitations in API of AutoDNS, we suggest to create an dedicated user for API with limited rights.`} type="info" />
<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" />
<br />
<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"/>
<br/>
<Form.Item
label={t`AutoDNS Username`}
name={['authData', 'username']}
@@ -156,8 +157,9 @@ export function ConnectorForm({form, onCreate}: { form: FormInstance, onCreate:
label={t`Domain Contact Handle ID`}
name={['authData', 'contactid']}
help={<Typography.Text
type='secondary'>{t`The Contact ID for ownership of registered Domains. `}<a href="https://cloud.autodns.com/contacts/domain">{t`You got from this page`}</a></Typography.Text>}
rules={[{required: true, message: t`Required`}]}
type='secondary'>{t`The Contact ID for ownership of registered Domains. `}<a
href="https://cloud.autodns.com/contacts/domain">{t`You got from this page`}</a></Typography.Text>}
rules={[{required: true, message: t`Required`}]}
required={true}>
<Input autoComplete='off' required={true} placeholder=''/>
</Form.Item>
@@ -169,20 +171,36 @@ export function ConnectorForm({form, onCreate}: { form: FormInstance, onCreate:
type='secondary'>{t`If you not sure, use the default value 4`}</Typography.Text>}
required={false}>
<Input autoComplete='off' required={false} placeholder='4' />
<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={true}>{t`Owner confirms his consent of domain order jobs`}</Checkbox>
</Form.Item>
</Form.Item>
</>
}
{
provider === ConnectorProvider.NAMECHEAP && <>
<Form.Item
label={t`Username`}
name={['authData', 'ApiUser']}
>
<Input autoComplete='off'></Input>
</Form.Item>
<Form.Item
label={t`API key`}
name={['authData', 'ApiKey']}
>
<Input autoComplete='off'></Input>
</Form.Item>
</>
}

View File

@@ -4,6 +4,7 @@ export enum ConnectorProvider {
OVH = 'ovh',
GANDI = 'gandi',
AUTODNS = 'autodns',
NAMECHEAP = 'namecheap'
}
export type Connector = {

View File

@@ -15,7 +15,14 @@ export const helpGetTokenLink = (provider?: string) => {
return <Typography.Link target='_blank' href="https://admin.gandi.net/organizations/account/pat">
{t`Retrieve a Personal Access Token from your customer account on the Provider's website`}
</Typography.Link>
case ConnectorProvider.NAMECHEAP:
return <Typography.Link target='_blank' href="https://ap.www.namecheap.com/settings/tools/apiaccess/">
{t`Retreive an API key and whitelist this instance's IP address on Namecheap's website`}
</Typography.Link>
case ConnectorProvider.AUTODNS:
return <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>
default:
return <></>