mirror of
https://github.com/usual2970/certimate.git
synced 2025-10-04 21:44:54 +00:00
feat: add gcore dns-01 applicant
This commit is contained in:
BIN
ui/public/imgs/providers/gcore.png
Normal file
BIN
ui/public/imgs/providers/gcore.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
@@ -21,6 +21,7 @@ import AccessFormCloudflareConfig from "./AccessFormCloudflareConfig";
|
||||
import AccessFormClouDNSConfig from "./AccessFormClouDNSConfig";
|
||||
import AccessFormDogeCloudConfig from "./AccessFormDogeCloudConfig";
|
||||
import AccessFormEdgioConfig from "./AccessFormEdgioConfig";
|
||||
import AccessFormGcoreConfig from "./AccessFormGcoreConfig";
|
||||
import AccessFormGnameConfig from "./AccessFormGnameConfig";
|
||||
import AccessFormGoDaddyConfig from "./AccessFormGoDaddyConfig";
|
||||
import AccessFormHuaweiCloudConfig from "./AccessFormHuaweiCloudConfig";
|
||||
@@ -114,6 +115,8 @@ const AccessForm = forwardRef<AccessFormInstance, AccessFormProps>(({ className,
|
||||
return <AccessFormClouDNSConfig {...nestedFormProps} />;
|
||||
case ACCESS_PROVIDERS.DOGECLOUD:
|
||||
return <AccessFormDogeCloudConfig {...nestedFormProps} />;
|
||||
case ACCESS_PROVIDERS.GCORE:
|
||||
return <AccessFormGcoreConfig {...nestedFormProps} />;
|
||||
case ACCESS_PROVIDERS.GNAME:
|
||||
return <AccessFormGnameConfig {...nestedFormProps} />;
|
||||
case ACCESS_PROVIDERS.GODADDY:
|
||||
|
61
ui/src/components/access/AccessFormGcoreConfig.tsx
Normal file
61
ui/src/components/access/AccessFormGcoreConfig.tsx
Normal file
@@ -0,0 +1,61 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Form, type FormInstance, Input } from "antd";
|
||||
import { createSchemaFieldRule } from "antd-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
import { type AccessConfigForGcore } from "@/domain/access";
|
||||
|
||||
type AccessFormGcoreConfigFieldValues = Nullish<AccessConfigForGcore>;
|
||||
|
||||
export type AccessFormGcoreConfigProps = {
|
||||
form: FormInstance;
|
||||
formName: string;
|
||||
disabled?: boolean;
|
||||
initialValues?: AccessFormGcoreConfigFieldValues;
|
||||
onValuesChange?: (values: AccessFormGcoreConfigFieldValues) => void;
|
||||
};
|
||||
|
||||
const initFormModel = (): AccessFormGcoreConfigFieldValues => {
|
||||
return {
|
||||
apiToken: "",
|
||||
};
|
||||
};
|
||||
|
||||
const AccessFormGcoreConfig = ({ form: formInst, formName, disabled, initialValues, onValuesChange }: AccessFormGcoreConfigProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiToken: z
|
||||
.string()
|
||||
.min(1, t("access.form.gcore_api_token.placeholder"))
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 }))
|
||||
.trim(),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
|
||||
const handleFormChange = (_: unknown, values: z.infer<typeof formSchema>) => {
|
||||
onValuesChange?.(values);
|
||||
};
|
||||
|
||||
return (
|
||||
<Form
|
||||
form={formInst}
|
||||
disabled={disabled}
|
||||
initialValues={initialValues ?? initFormModel()}
|
||||
layout="vertical"
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item
|
||||
name="apiToken"
|
||||
label={t("access.form.gcore_api_token.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("access.form.gcore_api_token.tooltip") }}></span>}
|
||||
>
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.gcore_api_token.placeholder")} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
export default AccessFormGcoreConfig;
|
@@ -18,6 +18,7 @@ export interface AccessModel extends BaseModel {
|
||||
| AccessConfigForClouDNS
|
||||
| AccessConfigForDogeCloud
|
||||
| AccessConfigForEdgio
|
||||
| AccessConfigForGcore
|
||||
| AccessConfigForGname
|
||||
| AccessConfigForGoDaddy
|
||||
| AccessConfigForHuaweiCloud
|
||||
@@ -101,6 +102,10 @@ export type AccessConfigForEdgio = {
|
||||
clientSecret: string;
|
||||
};
|
||||
|
||||
export type AccessConfigForGcore = {
|
||||
apiToken: string;
|
||||
};
|
||||
|
||||
export type AccessConfigForGname = {
|
||||
appId: string;
|
||||
appKey: string;
|
||||
|
@@ -15,6 +15,7 @@ export const ACCESS_PROVIDERS = Object.freeze({
|
||||
CLOUDFLARE: "cloudflare",
|
||||
CLOUDNS: "cloudns",
|
||||
DOGECLOUD: "dogecloud",
|
||||
GCORE: "gcore",
|
||||
GNAME: "gname",
|
||||
GODADDY: "godaddy",
|
||||
EDGIO: "edgio",
|
||||
@@ -79,6 +80,7 @@ export const accessProvidersMap: Map<AccessProvider["type"] | string, AccessProv
|
||||
[ACCESS_PROVIDERS.AZURE, "provider.azure", "/imgs/providers/azure.svg", [ACCESS_USAGES.APPLY]],
|
||||
[ACCESS_PROVIDERS.CLOUDFLARE, "provider.cloudflare", "/imgs/providers/cloudflare.svg", [ACCESS_USAGES.APPLY]],
|
||||
[ACCESS_PROVIDERS.CLOUDNS, "provider.cloudns", "/imgs/providers/cloudns.svg", [ACCESS_USAGES.APPLY]],
|
||||
[ACCESS_PROVIDERS.GCORE, "provider.gcore", "/imgs/providers/gcore.png", [ACCESS_USAGES.APPLY]],
|
||||
[ACCESS_PROVIDERS.GNAME, "provider.gname", "/imgs/providers/gname.svg", [ACCESS_USAGES.APPLY]],
|
||||
[ACCESS_PROVIDERS.GODADDY, "provider.godaddy", "/imgs/providers/godaddy.svg", [ACCESS_USAGES.APPLY]],
|
||||
[ACCESS_PROVIDERS.NAMEDOTCOM, "provider.namedotcom", "/imgs/providers/namedotcom.svg", [ACCESS_USAGES.APPLY]],
|
||||
@@ -114,6 +116,7 @@ export const APPLY_DNS_PROVIDERS = Object.freeze({
|
||||
AZURE_DNS: `${ACCESS_PROVIDERS.AZURE}-dns`,
|
||||
CLOUDFLARE: `${ACCESS_PROVIDERS.CLOUDFLARE}`,
|
||||
CLOUDNS: `${ACCESS_PROVIDERS.CLOUDNS}`,
|
||||
GCORE: `${ACCESS_PROVIDERS.GCORE}`,
|
||||
GNAME: `${ACCESS_PROVIDERS.GNAME}`,
|
||||
GODADDY: `${ACCESS_PROVIDERS.GODADDY}`,
|
||||
HUAWEICLOUD: `${ACCESS_PROVIDERS.HUAWEICLOUD}`, // 兼容旧值,等同于 `HUAWEICLOUD_DNS`
|
||||
@@ -153,6 +156,7 @@ export const applyDNSProvidersMap: Map<ApplyDNSProvider["type"] | string, ApplyD
|
||||
[APPLY_DNS_PROVIDERS.AZURE_DNS, "provider.azure.dns"],
|
||||
[APPLY_DNS_PROVIDERS.CLOUDFLARE, "provider.cloudflare"],
|
||||
[APPLY_DNS_PROVIDERS.CLOUDNS, "provider.cloudns"],
|
||||
[APPLY_DNS_PROVIDERS.GCORE, "provider.gcore"],
|
||||
[APPLY_DNS_PROVIDERS.GNAME, "provider.gname"],
|
||||
[APPLY_DNS_PROVIDERS.GODADDY, "provider.godaddy"],
|
||||
[APPLY_DNS_PROVIDERS.NAMEDOTCOM, "provider.namedotcom"],
|
||||
|
@@ -100,6 +100,9 @@
|
||||
"access.form.edgio_client_secret.label": "Edgio ClientSecret",
|
||||
"access.form.edgio_client_secret.placeholder": "Please enter Edgio ClientSecret",
|
||||
"access.form.edgio_client_secret.tooltip": "For more information, see <a href=\"https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients\" target=\"_blank\">https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients</a>",
|
||||
"access.form.gcore_api_token.label": "Gcore API token",
|
||||
"access.form.gcore_api_token.placeholder": "Please enter Gcore API token",
|
||||
"access.form.gcore_api_token.tooltip": "For more information, see <a href=\"https://api.gcore.com/docs/iam#section/Authentication\" target=\"_blank\">https://api.gcore.com/docs/iam#section/Authentication</a>",
|
||||
"access.form.gname_app_id.label": "GNAME AppId",
|
||||
"access.form.gname_app_id.placeholder": "Please enter GNAME AppId",
|
||||
"access.form.gname_app_id.tooltip": "For more information, see <a href=\"https://www.gname.com/user#/dealer_api\" target=\"_blank\">https://www.gname.com/user#/dealer_api</a>",
|
||||
|
@@ -100,6 +100,9 @@
|
||||
"access.form.edgio_client_secret.label": "Edgio 客户端密码",
|
||||
"access.form.edgio_client_secret.placeholder": "请输入 Edgio 客户端密码",
|
||||
"access.form.edgio_client_secret.tooltip": "这是什么?请参阅 <a href=\"https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients\" target=\"_blank\">https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients</a>",
|
||||
"access.form.gcore_api_token.label": "Gcore API Token",
|
||||
"access.form.gcore_api_token.placeholder": "请输入 Gcore API Token",
|
||||
"access.form.gcore_api_token.tooltip": "这是什么?请参阅 <a href=\"https://api.gcore.com/docs/iam#section/Authentication\" target=\"_blank\">https://api.gcore.com/docs/iam#section/Authentication</a>",
|
||||
"access.form.gname_app_id.label": "GNAME AppId",
|
||||
"access.form.gname_app_id.placeholder": "请输入 GNAME AppId",
|
||||
"access.form.gname_app_id.tooltip": "这是什么?请参阅 <a href=\"https://www.gname.com/user#/dealer_api\" target=\"_blank\">https://www.gname.com/user#/dealer_api</a>",
|
||||
|
Reference in New Issue
Block a user