add cloudflare provider

This commit is contained in:
yoan
2024-09-02 14:36:46 +08:00
parent 2b8fb9314f
commit 52cca47ec8
15 changed files with 854 additions and 87 deletions

View File

@@ -3,6 +3,7 @@ import { z } from "zod";
export const accessTypeMap: Map<string, [string, string]> = new Map([
["tencent", ["腾讯云", "/imgs/providers/tencent.svg"]],
["aliyun", ["阿里云", "/imgs/providers/aliyun.svg"]],
["cloudflare", ["Cloudflare", "/imgs/providers/cloudflare.svg"]],
["ssh", ["SSH部署", "/imgs/providers/ssh.svg"]],
["webhook", ["Webhook", "/imgs/providers/webhook.svg"]],
]);
@@ -13,6 +14,7 @@ export const accessFormType = z.union(
z.literal("tencent"),
z.literal("ssh"),
z.literal("webhook"),
z.literal("cloudflare"),
],
{ message: "请选择云服务商" }
);
@@ -21,7 +23,12 @@ export type Access = {
id: string;
name: string;
configType: string;
config: TencentConfig | AliyunConfig | SSHConfig | WebhookConfig;
config:
| TencentConfig
| AliyunConfig
| SSHConfig
| WebhookConfig
| CloudflareConfig;
deleted?: string;
created?: string;
updated?: string;
@@ -31,6 +38,10 @@ export type WebhookConfig = {
url: string;
};
export type CloudflareConfig = {
dnsApiToken: string;
};
export type TencentConfig = {
secretId: string;
secretKey: string;