feat: new deployment provider: tencentcloud gaap
This commit is contained in:
@@ -72,6 +72,7 @@ const DeploymentProviderPicker = ({ className, style, autoFocus, filter, placeho
|
||||
DEPLOYMENT_CATEGORIES.LOADBALANCE,
|
||||
DEPLOYMENT_CATEGORIES.FIREWALL,
|
||||
DEPLOYMENT_CATEGORIES.AV,
|
||||
DEPLOYMENT_CATEGORIES.ACCELERATOR,
|
||||
DEPLOYMENT_CATEGORIES.APIGATEWAY,
|
||||
DEPLOYMENT_CATEGORIES.SERVERLESS,
|
||||
DEPLOYMENT_CATEGORIES.WEBSITE,
|
||||
|
||||
@@ -77,6 +77,7 @@ import DeployNodeConfigFormTencentCloudCOSConfig from "./DeployNodeConfigFormTen
|
||||
import DeployNodeConfigFormTencentCloudCSSConfig from "./DeployNodeConfigFormTencentCloudCSSConfig.tsx";
|
||||
import DeployNodeConfigFormTencentCloudECDNConfig from "./DeployNodeConfigFormTencentCloudECDNConfig.tsx";
|
||||
import DeployNodeConfigFormTencentCloudEOConfig from "./DeployNodeConfigFormTencentCloudEOConfig.tsx";
|
||||
import DeployNodeConfigFormTencentCloudGAAPConfig from "./DeployNodeConfigFormTencentCloudGAAPConfig.tsx";
|
||||
import DeployNodeConfigFormTencentCloudSCFConfig from "./DeployNodeConfigFormTencentCloudSCFConfig";
|
||||
import DeployNodeConfigFormTencentCloudSSLDeployConfig from "./DeployNodeConfigFormTencentCloudSSLDeployConfig";
|
||||
import DeployNodeConfigFormTencentCloudVODConfig from "./DeployNodeConfigFormTencentCloudVODConfig";
|
||||
@@ -321,6 +322,8 @@ const DeployNodeConfigForm = forwardRef<DeployNodeConfigFormInstance, DeployNode
|
||||
return <DeployNodeConfigFormTencentCloudECDNConfig {...nestedFormProps} />;
|
||||
case DEPLOYMENT_PROVIDERS.TENCENTCLOUD_EO:
|
||||
return <DeployNodeConfigFormTencentCloudEOConfig {...nestedFormProps} />;
|
||||
case DEPLOYMENT_PROVIDERS.TENCENTCLOUD_GAAP:
|
||||
return <DeployNodeConfigFormTencentCloudGAAPConfig {...nestedFormProps} />;
|
||||
case DEPLOYMENT_PROVIDERS.TENCENTCLOUD_SCF:
|
||||
return <DeployNodeConfigFormTencentCloudSCFConfig {...nestedFormProps} />;
|
||||
case DEPLOYMENT_PROVIDERS.TENCENTCLOUD_SSL_DEPLOY:
|
||||
|
||||
@@ -26,7 +26,9 @@ const RESOURCE_TYPE_LOADBALANCER = "loadbalancer" as const;
|
||||
const RESOURCE_TYPE_LISTENER = "listener" as const;
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormAliyunALBConfigFieldValues => {
|
||||
return {};
|
||||
return {
|
||||
resourceType: RESOURCE_TYPE_LISTENER,
|
||||
};
|
||||
};
|
||||
|
||||
const DeployNodeConfigFormAliyunALBConfig = ({
|
||||
|
||||
@@ -27,6 +27,7 @@ const RESOURCE_TYPE_LISTENER = "listener" as const;
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormAliyunCLBConfigFieldValues => {
|
||||
return {
|
||||
resourceType: RESOURCE_TYPE_LISTENER,
|
||||
listenerPort: 443,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -25,7 +25,9 @@ const RESOURCE_TYPE_ACCELERATOR = "accelerator" as const;
|
||||
const RESOURCE_TYPE_LISTENER = "listener" as const;
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormAliyunGAConfigFieldValues => {
|
||||
return {};
|
||||
return {
|
||||
resourceType: RESOURCE_TYPE_LISTENER,
|
||||
};
|
||||
};
|
||||
|
||||
const DeployNodeConfigFormAliyunGAConfig = ({ form: formInst, formName, disabled, initialValues, onValuesChange }: DeployNodeConfigFormAliyunGAConfigProps) => {
|
||||
|
||||
@@ -24,7 +24,9 @@ const RESOURCE_TYPE_LOADBALANCER = "loadbalancer" as const;
|
||||
const RESOURCE_TYPE_LISTENER = "listener" as const;
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormAliyunNLBConfigFieldValues => {
|
||||
return {};
|
||||
return {
|
||||
resourceType: RESOURCE_TYPE_LISTENER,
|
||||
};
|
||||
};
|
||||
|
||||
const DeployNodeConfigFormAliyunNLBConfig = ({
|
||||
|
||||
@@ -27,6 +27,7 @@ const RESOURCE_TYPE_LISTENER = "listener" as const;
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormBaiduCloudAppBLBConfigFieldValues => {
|
||||
return {
|
||||
resourceType: RESOURCE_TYPE_LISTENER,
|
||||
listenerPort: 443,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -27,6 +27,7 @@ const RESOURCE_TYPE_LISTENER = "listener" as const;
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormBaiduCloudBLBConfigFieldValues => {
|
||||
return {
|
||||
resourceType: RESOURCE_TYPE_LISTENER,
|
||||
listenerPort: 443,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -26,7 +26,9 @@ const RESOURCE_TYPE_LOADBALANCER = "loadbalancer" as const;
|
||||
const RESOURCE_TYPE_LISTENER = "listener" as const;
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormHuaweiCloudELBConfigFieldValues => {
|
||||
return {};
|
||||
return {
|
||||
resourceType: RESOURCE_TYPE_LISTENER,
|
||||
};
|
||||
};
|
||||
|
||||
const DeployNodeConfigFormHuaweiCloudELBConfig = ({
|
||||
|
||||
@@ -26,7 +26,9 @@ const RESOURCE_TYPE_LOADBALANCER = "loadbalancer" as const;
|
||||
const RESOURCE_TYPE_LISTENER = "listener" as const;
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormJDCloudALBConfigFieldValues => {
|
||||
return {};
|
||||
return {
|
||||
resourceType: RESOURCE_TYPE_LISTENER,
|
||||
};
|
||||
};
|
||||
|
||||
const DeployNodeConfigFormJDCloudALBConfig = ({
|
||||
|
||||
@@ -29,7 +29,7 @@ const RESOURCE_TYPE_RULEDOMAIN = "ruledomain" as const;
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormTencentCloudCLBConfigFieldValues => {
|
||||
return {
|
||||
resourceType: RESOURCE_TYPE_VIA_SSLDEPLOY,
|
||||
resourceType: RESOURCE_TYPE_LISTENER,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Form, type FormInstance, Input, Select } from "antd";
|
||||
import { createSchemaFieldRule } from "antd-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
import Show from "@/components/Show";
|
||||
|
||||
type DeployNodeConfigFormTencentCloudGAAPConfigFieldValues = Nullish<{
|
||||
resourceType: string;
|
||||
proxyId?: string;
|
||||
listenerId?: string;
|
||||
}>;
|
||||
|
||||
export type DeployNodeConfigFormTencentCloudGAAPConfigProps = {
|
||||
form: FormInstance;
|
||||
formName: string;
|
||||
disabled?: boolean;
|
||||
initialValues?: DeployNodeConfigFormTencentCloudGAAPConfigFieldValues;
|
||||
onValuesChange?: (values: DeployNodeConfigFormTencentCloudGAAPConfigFieldValues) => void;
|
||||
};
|
||||
|
||||
const RESOURCE_TYPE_LISTENER = "listener" as const;
|
||||
|
||||
const initFormModel = (): DeployNodeConfigFormTencentCloudGAAPConfigFieldValues => {
|
||||
return {
|
||||
resourceType: RESOURCE_TYPE_LISTENER,
|
||||
listenerId: "",
|
||||
};
|
||||
};
|
||||
|
||||
const DeployNodeConfigFormTencentCloudGAAPConfig = ({
|
||||
form: formInst,
|
||||
formName,
|
||||
disabled,
|
||||
initialValues,
|
||||
onValuesChange,
|
||||
}: DeployNodeConfigFormTencentCloudGAAPConfigProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
resourceType: z.literal(RESOURCE_TYPE_LISTENER, { message: t("workflow_node.deploy.form.tencentcloud_gaap_resource_type.placeholder") }),
|
||||
proxyId: z.string().trim().nullish(),
|
||||
listenerId: z
|
||||
.string()
|
||||
.trim()
|
||||
.nullish()
|
||||
.refine(
|
||||
(v) => ![RESOURCE_TYPE_LISTENER].includes(fieldResourceType) || !!v?.trim(),
|
||||
t("workflow_node.deploy.form.tencentcloud_gaap_listener_id.placeholder")
|
||||
),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
|
||||
const fieldResourceType = Form.useWatch("resourceType", formInst);
|
||||
|
||||
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="resourceType" label={t("workflow_node.deploy.form.tencentcloud_gaap_resource_type.label")} rules={[formRule]}>
|
||||
<Select placeholder={t("workflow_node.deploy.form.tencentcloud_gaap_resource_type.placeholder")}>
|
||||
<Select.Option key={RESOURCE_TYPE_LISTENER} value={RESOURCE_TYPE_LISTENER}>
|
||||
{t("workflow_node.deploy.form.tencentcloud_gaap_resource_type.option.listener.label")}
|
||||
</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="proxyId"
|
||||
label={t("workflow_node.deploy.form.tencentcloud_gaap_proxy_id.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.tencentcloud_gaap_proxy_id.tooltip") }}></span>}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.tencentcloud_gaap_proxy_id.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Show when={fieldResourceType === RESOURCE_TYPE_LISTENER}>
|
||||
<Form.Item
|
||||
name="listenerId"
|
||||
label={t("workflow_node.deploy.form.tencentcloud_gaap_listener_id.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.tencentcloud_gaap_listener_id.tooltip") }}></span>}
|
||||
>
|
||||
<Input placeholder={t("workflow_node.deploy.form.tencentcloud_gaap_listener_id.placeholder")} />
|
||||
</Form.Item>
|
||||
</Show>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
export default DeployNodeConfigFormTencentCloudGAAPConfig;
|
||||
Reference in New Issue
Block a user