feat: ovh api conditions checkbox

This commit is contained in:
Maël Gangloff
2024-07-30 17:48:09 +02:00
parent 51e5cb7e36
commit d7682ce4ac
5 changed files with 123 additions and 106 deletions

View File

@@ -0,0 +1,25 @@
import {ConnectorProvider} from "../api/connectors";
import {Typography} from "antd";
import {t} from "ttag";
import React from "react";
export const helpGetTokenLink = (provider?: string) => {
switch (provider) {
case ConnectorProvider.OVH:
return <Typography.Link target='_blank'
href="https://api.ovh.com/createToken/index.cgi?GET=/order/cart/*&POST=/order/cart&POST=/order/cart/*&DELETE=/order/cart/*">
{t`Retrieve a set of tokens from your customer account on the Provider's website`}
</Typography.Link>
default:
return <></>
}
}
export const tosHyperlink = (provider?: string) => {
switch (provider) {
case ConnectorProvider.OVH:
return 'https://www.ovhcloud.com/fr/terms-and-conditions/contracts/'
default:
return ''
}
}

View File

@@ -0,0 +1,27 @@
import {t} from "ttag";
import {regionNames} from "../../i18n";
export const ovhFields = () => ({
appKey: t`Application key`,
appSecret: t`Application secret`,
consumerKey: t`Consumer key`
})
export const ovhEndpointList = () => [
{
label: t`European Region`,
value: 'ovh-eu'
}
]
export const ovhSubsidiaryList = () => [...[
'CZ', 'DE', 'ES', 'FI', 'FR', 'GB', 'IE', 'IT', 'LT', 'MA', 'NL', 'PL', 'PT', 'SN', 'TN'
].map(c => ({value: c, label: regionNames.of(c) ?? c})), {value: 'EU', label: t`Europe`}]
export const ovhPricingMode = () => [
{value: 'create-default', label: t`The domain is free and at the standard price`},
{
value: 'create-premium',
label: t`The domain is free but is a premium. Its price varies from one domain to another`
}
]