mirror of
https://github.com/usual2970/certimate.git
synced 2025-10-04 21:44:54 +00:00
feat: add aliyun fc deployer
This commit is contained in:
@@ -23,6 +23,7 @@ import DeployNodeConfigFormAliyunCDNConfig from "./DeployNodeConfigFormAliyunCDN
|
||||
import DeployNodeConfigFormAliyunCLBConfig from "./DeployNodeConfigFormAliyunCLBConfig";
|
||||
import DeployNodeConfigFormAliyunDCDNConfig from "./DeployNodeConfigFormAliyunDCDNConfig";
|
||||
import DeployNodeConfigFormAliyunESAConfig from "./DeployNodeConfigFormAliyunESAConfig";
|
||||
import DeployNodeConfigFormAliyunFCConfig from "./DeployNodeConfigFormAliyunFCConfig";
|
||||
import DeployNodeConfigFormAliyunLiveConfig from "./DeployNodeConfigFormAliyunLiveConfig";
|
||||
import DeployNodeConfigFormAliyunNLBConfig from "./DeployNodeConfigFormAliyunNLBConfig";
|
||||
import DeployNodeConfigFormAliyunOSSConfig from "./DeployNodeConfigFormAliyunOSSConfig";
|
||||
@@ -156,6 +157,8 @@ const DeployNodeConfigForm = forwardRef<DeployNodeConfigFormInstance, DeployNode
|
||||
return <DeployNodeConfigFormAliyunDCDNConfig {...nestedFormProps} />;
|
||||
case DEPLOY_PROVIDERS.ALIYUN_ESA:
|
||||
return <DeployNodeConfigFormAliyunESAConfig {...nestedFormProps} />;
|
||||
case DEPLOY_PROVIDERS.ALIYUN_FC:
|
||||
return <DeployNodeConfigFormAliyunFCConfig {...nestedFormProps} />;
|
||||
case DEPLOY_PROVIDERS.ALIYUN_LIVE:
|
||||
return <DeployNodeConfigFormAliyunLiveConfig {...nestedFormProps} />;
|
||||
case DEPLOY_PROVIDERS.ALIYUN_NLB:
|
||||
|
@@ -0,0 +1,90 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Form, type FormInstance, Input, Select } from "antd";
|
||||
import { createSchemaFieldRule } from "antd-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
import { validDomainName } from "@/utils/validators";
|
||||
|
||||
type DeployNodeConfigFormAliyunFCConfigFieldValues = Nullish<{
|
||||
region: string;
|
||||
serviceVersion: string;
|
||||
domain: string;
|
||||
}>;
|
||||
|
||||
export type DeployNodeConfigFormAliyunFCConfigProps = {
|
||||
form: FormInstance;
|
||||
formName: string;
|
||||
disabled?: boolean;
|
||||
initialValues?: DeployNodeConfigFormAliyunFCConfigFieldValues;
|
||||
onValuesChange?: (values: DeployNodeConfigFormAliyunFCConfigFieldValues) => void;
|
||||
};
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormAliyunFCConfigFieldValues => {
|
||||
return {
|
||||
serviceVersion: "3.0",
|
||||
};
|
||||
};
|
||||
|
||||
const DeployNodeConfigFormAliyunFCConfig = ({ form: formInst, formName, disabled, initialValues, onValuesChange }: DeployNodeConfigFormAliyunFCConfigProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
serviceVersion: z.union([z.literal("2.0"), z.literal("3.0")], {
|
||||
message: t("workflow_node.deploy.form.aliyun_fc_service_version.placeholder"),
|
||||
}),
|
||||
region: z
|
||||
.string({ message: t("workflow_node.deploy.form.aliyun_fc_region.placeholder") })
|
||||
.nonempty(t("workflow_node.deploy.form.aliyun_fc_region.placeholder"))
|
||||
.trim(),
|
||||
domain: z
|
||||
.string({ message: t("workflow_node.deploy.form.aliyun_fc_domain.placeholder") })
|
||||
.refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")),
|
||||
});
|
||||
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="serviceVersion" label={t("workflow_node.deploy.form.aliyun_fc_service_version.label")} rules={[formRule]}>
|
||||
<Select placeholder={t("workflow_node.deploy.form.aliyun_fc_service_version.placeholder")}>
|
||||
<Select.Option key="2.0" value="2.0">
|
||||
2.0
|
||||
</Select.Option>
|
||||
<Select.Option key="3.0" value="3.0">
|
||||
3.0
|
||||
</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="region"
|
||||
label={t("workflow_node.deploy.form.aliyun_fc_region.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.aliyun_fc_region.tooltip") }}></span>}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.aliyun_fc_region.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="domain"
|
||||
label={t("workflow_node.deploy.form.aliyun_fc_domain.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.aliyun_fc_domain.tooltip") }}></span>}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.aliyun_fc_domain.placeholder")} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
export default DeployNodeConfigFormAliyunFCConfig;
|
@@ -221,6 +221,7 @@ export const DEPLOY_PROVIDERS = Object.freeze({
|
||||
ALIYUN_CLB: `${ACCESS_PROVIDERS.ALIYUN}-clb`,
|
||||
ALIYUN_DCDN: `${ACCESS_PROVIDERS.ALIYUN}-dcdn`,
|
||||
ALIYUN_ESA: `${ACCESS_PROVIDERS.ALIYUN}-esa`,
|
||||
ALIYUN_FC: `${ACCESS_PROVIDERS.ALIYUN}-fc`,
|
||||
ALIYUN_LIVE: `${ACCESS_PROVIDERS.ALIYUN}-live`,
|
||||
ALIYUN_NLB: `${ACCESS_PROVIDERS.ALIYUN}-nlb`,
|
||||
ALIYUN_OSS: `${ACCESS_PROVIDERS.ALIYUN}-oss`,
|
||||
@@ -256,6 +257,7 @@ export const DEPLOY_PROVIDERS = Object.freeze({
|
||||
TENCENTCLOUD_CSS: `${ACCESS_PROVIDERS.TENCENTCLOUD}-css`,
|
||||
TENCENTCLOUD_ECDN: `${ACCESS_PROVIDERS.TENCENTCLOUD}-ecdn`,
|
||||
TENCENTCLOUD_EO: `${ACCESS_PROVIDERS.TENCENTCLOUD}-eo`,
|
||||
TENCENTCLOUD_SCF: `${ACCESS_PROVIDERS.TENCENTCLOUD}-scf`,
|
||||
TENCENTCLOUD_SSL_DEPLOY: `${ACCESS_PROVIDERS.TENCENTCLOUD}-ssldeploy`,
|
||||
TENCENTCLOUD_VOD: `${ACCESS_PROVIDERS.TENCENTCLOUD}-vod`,
|
||||
TENCENTCLOUD_WAF: `${ACCESS_PROVIDERS.TENCENTCLOUD}-waf`,
|
||||
@@ -313,6 +315,7 @@ export const deployProvidersMap: Map<DeployProvider["type"] | string, DeployProv
|
||||
[DEPLOY_PROVIDERS.ALIYUN_WAF, "provider.aliyun.waf", DEPLOY_CATEGORIES.FIREWALL],
|
||||
[DEPLOY_PROVIDERS.ALIYUN_LIVE, "provider.aliyun.live", DEPLOY_CATEGORIES.AV],
|
||||
[DEPLOY_PROVIDERS.ALIYUN_VOD, "provider.aliyun.vod", DEPLOY_CATEGORIES.AV],
|
||||
[DEPLOY_PROVIDERS.ALIYUN_FC, "provider.aliyun.fc", DEPLOY_CATEGORIES.OTHER],
|
||||
[DEPLOY_PROVIDERS.ALIYUN_CAS_DEPLOY, "provider.aliyun.cas_deploy", DEPLOY_CATEGORIES.OTHER],
|
||||
[DEPLOY_PROVIDERS.TENCENTCLOUD_COS, "provider.tencentcloud.cos", DEPLOY_CATEGORIES.STORAGE],
|
||||
[DEPLOY_PROVIDERS.TENCENTCLOUD_CDN, "provider.tencentcloud.cdn", DEPLOY_CATEGORIES.CDN],
|
||||
@@ -322,6 +325,7 @@ export const deployProvidersMap: Map<DeployProvider["type"] | string, DeployProv
|
||||
[DEPLOY_PROVIDERS.TENCENTCLOUD_WAF, "provider.tencentcloud.waf", DEPLOY_CATEGORIES.FIREWALL],
|
||||
[DEPLOY_PROVIDERS.TENCENTCLOUD_CSS, "provider.tencentcloud.css", DEPLOY_CATEGORIES.AV],
|
||||
[DEPLOY_PROVIDERS.TENCENTCLOUD_VOD, "provider.tencentcloud.vod", DEPLOY_CATEGORIES.AV],
|
||||
// TODO: [DEPLOY_PROVIDERS.TENCENTCLOUD_SCF, "provider.tencentcloud.scf", DEPLOY_CATEGORIES.OTHER],
|
||||
[DEPLOY_PROVIDERS.TENCENTCLOUD_SSL_DEPLOY, "provider.tencentcloud.ssl_deploy", DEPLOY_CATEGORIES.OTHER],
|
||||
[DEPLOY_PROVIDERS.HUAWEICLOUD_CDN, "provider.huaweicloud.cdn", DEPLOY_CATEGORIES.CDN],
|
||||
[DEPLOY_PROVIDERS.HUAWEICLOUD_ELB, "provider.huaweicloud.elb", DEPLOY_CATEGORIES.LOADBALANCE],
|
||||
|
@@ -11,6 +11,7 @@
|
||||
"provider.aliyun.dcdn": "Alibaba Cloud - DCDN (Dynamic Route for Content Delivery Network)",
|
||||
"provider.aliyun.dns": "Alibaba Cloud - DNS (Domain Name Service)",
|
||||
"provider.aliyun.esa": "Alibaba Cloud - ESA (Edge Security Acceleration)",
|
||||
"provider.aliyun.fc": "Alibaba Cloud - FC (Function Compute)",
|
||||
"provider.aliyun.live": "Alibaba Cloud - ApsaraVideo Live",
|
||||
"provider.aliyun.nlb": "Alibaba Cloud - NLB (Network Load Balancer)",
|
||||
"provider.aliyun.oss": "Alibaba Cloud - OSS (Object Storage Service)",
|
||||
@@ -85,6 +86,7 @@
|
||||
"provider.tencentcloud.dns": "Tencent Cloud - DNS (Domain Name Service)",
|
||||
"provider.tencentcloud.ecdn": "Tencent Cloud - ECDN (Enterprise Content Delivery Network)",
|
||||
"provider.tencentcloud.eo": "Tencent Cloud - EdgeOne",
|
||||
"provider.tencentcloud.scf": "Tencent Cloud - SCF (Serverless Cloud Function)",
|
||||
"provider.tencentcloud.ssl_deploy": "Tencent Cloud - via SSL Certificate Service Deployment Job",
|
||||
"provider.tencentcloud.vod": "Tencent Cloud - VOD (Video on Demand)",
|
||||
"provider.tencentcloud.waf": "Tencent Cloud - WAF (Web Application Firewall)",
|
||||
|
@@ -154,6 +154,14 @@
|
||||
"workflow_node.deploy.form.aliyun_esa_site_id.label": "Alibaba Cloud ESA site ID",
|
||||
"workflow_node.deploy.form.aliyun_esa_site_id.placeholder": "Please enter Alibaba Cloud ESA site ID",
|
||||
"workflow_node.deploy.form.aliyun_esa_site_id.tooltip": "For more information, see <a href=\"https://esa.console.aliyun.com/siteManage/list\" target=\"_blank\">https://esa.console.aliyun.com/siteManage/list</a>",
|
||||
"workflow_node.deploy.form.aliyun_fc_region.label": "Alibaba Cloud FC region",
|
||||
"workflow_node.deploy.form.aliyun_fc_region.placeholder": "Please enter Alibaba Cloud FC region (e.g. cn-hangzhou)",
|
||||
"workflow_node.deploy.form.aliyun_fc_region.tooltip": "For more information, see <a href=\"https://www.alibabacloud.com/help/en/functioncompute/fc-3-0/product-overview/supported-regions\" target=\"_blank\">https://www.alibabacloud.com/help/en/functioncompute/fc-3-0/product-overview/supported-regions</a>",
|
||||
"workflow_node.deploy.form.aliyun_fc_service_version.label": "Alibaba Cloud FC version",
|
||||
"workflow_node.deploy.form.aliyun_fc_service_version.placeholder": "Please select Alibaba Cloud FC version",
|
||||
"workflow_node.deploy.form.aliyun_fc_domain.label": "Alibaba Cloud FC domain",
|
||||
"workflow_node.deploy.form.aliyun_fc_domain.placeholder": "Please enter Alibaba Cloud FC domain name",
|
||||
"workflow_node.deploy.form.aliyun_fc_domain.tooltip": "For more information, see <a href=\"https://fcnext.console.aliyun.com\" target=\"_blank\">https://fcnext.console.aliyun.com</a>",
|
||||
"workflow_node.deploy.form.aliyun_live_region.label": "Alibaba Cloud Live region",
|
||||
"workflow_node.deploy.form.aliyun_live_region.placeholder": "Please enter Alibaba Cloud Live region (e.g. cn-hangzhou)",
|
||||
"workflow_node.deploy.form.aliyun_live_region.tooltip": "For more information, see <a href=\"https://www.alibabacloud.com/help/en/live/product-overview/supported-regions\" target=\"_blank\">https://www.alibabacloud.com/help/en/live/product-overview/supported-regions</a>",
|
||||
|
@@ -10,6 +10,7 @@
|
||||
"provider.aliyun.clb": "阿里云 - 传统型负载均衡 CLB",
|
||||
"provider.aliyun.dcdn": "阿里云 - 全站加速 DCDN",
|
||||
"provider.aliyun.esa": "阿里云 - 边缘安全加速 ESA",
|
||||
"provider.aliyun.fc": "阿里云 - 函数计算 FC",
|
||||
"provider.aliyun.dns": "阿里云 - 云解析 DNS",
|
||||
"provider.aliyun.live": "阿里云 - 视频直播 Live",
|
||||
"provider.aliyun.nlb": "阿里云 - 网络型负载均衡 NLB",
|
||||
@@ -85,6 +86,7 @@
|
||||
"provider.tencentcloud.dns": "腾讯云 - 云解析 DNS",
|
||||
"provider.tencentcloud.ecdn": "腾讯云 - 全站加速网络 ECDN",
|
||||
"provider.tencentcloud.eo": "腾讯云 - 边缘安全加速平台 EdgeOne",
|
||||
"provider.tencentcloud.scf": "腾讯云 - 云函数 SCF",
|
||||
"provider.tencentcloud.ssl_deploy": "腾讯云 - 通过 SSL 证书服务创建部署任务",
|
||||
"provider.tencentcloud.vod": "腾讯云 - 云点播 VOD",
|
||||
"provider.tencentcloud.waf": "腾讯云 - Web 应用防火墙 WAF",
|
||||
|
@@ -154,6 +154,14 @@
|
||||
"workflow_node.deploy.form.aliyun_esa_site_id.label": "阿里云 ESA 站点 ID",
|
||||
"workflow_node.deploy.form.aliyun_esa_site_id.placeholder": "请输入阿里云 ESA 站点 ID",
|
||||
"workflow_node.deploy.form.aliyun_esa_site_id.tooltip": "这是什么?请参阅 <a href=\"https://esa.console.aliyun.com/siteManage/list\" target=\"_blank\">https://esa.console.aliyun.com/siteManage/list</a>",
|
||||
"workflow_node.deploy.form.aliyun_fc_region.label": "阿里云 FC 服务地域",
|
||||
"workflow_node.deploy.form.aliyun_fc_region.placeholder": "请输入阿里云 FC 服务地域(例如:cn-hangzhou)",
|
||||
"workflow_node.deploy.form.aliyun_fc_region.tooltip": "这是什么?请参阅 <a href=\"https://help.aliyun.com/zh/functioncompute/fc-3-0/product-overview/supported-regions\" target=\"_blank\">https://help.aliyun.com/zh/functioncompute/fc-3-0/product-overview/supported-regions</a>",
|
||||
"workflow_node.deploy.form.aliyun_fc_service_version.label": "阿里云 FC 服务版本",
|
||||
"workflow_node.deploy.form.aliyun_fc_service_version.placeholder": "请选择阿里云 FC 服务版本",
|
||||
"workflow_node.deploy.form.aliyun_fc_domain.label": "阿里云 FC 自定义域名",
|
||||
"workflow_node.deploy.form.aliyun_fc_domain.placeholder": "请输入阿里云 FC 自定义域名",
|
||||
"workflow_node.deploy.form.aliyun_fc_domain.tooltip": "这是什么?请参阅 see <a href=\"https://fcnext.console.aliyun.com/\" target=\"_blank\">https://fcnext.console.aliyun.com/</a>",
|
||||
"workflow_node.deploy.form.aliyun_live_region.label": "阿里云视频直播服务地域",
|
||||
"workflow_node.deploy.form.aliyun_live_region.placeholder": "请输入阿里云视频直播服务地域(例如:cn-hangzhou)",
|
||||
"workflow_node.deploy.form.aliyun_live_region.tooltip": "这是什么?请参阅 <a href=\"https://help.aliyun.com/zh/live/product-overview/supported-regions\" target=\"_blank\">https://help.aliyun.com/zh/live/product-overview/supported-regions</a>",
|
||||
|
Reference in New Issue
Block a user