feat(ui): new DeployNodeForm using antd

This commit is contained in:
Fu Diwei
2024-12-31 19:55:34 +08:00
parent cb7a465d6c
commit 6f088fd76a
53 changed files with 2808 additions and 285 deletions

View File

@@ -0,0 +1,32 @@
import { useTranslation } from "react-i18next";
import { Form, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";
import { validDomainName } from "@/utils/validators";
const DeployNodeFormVolcEngineCDNFields = () => {
const { t } = useTranslation();
const formSchema = z.object({
domain: z
.string({ message: t("workflow_node.deploy.form.volcengine_cdn_domain.placeholder") })
.refine((v) => validDomainName(v, true), t("common.errmsg.domain_invalid")),
});
const formRule = createSchemaFieldRule(formSchema);
return (
<>
<Form.Item
name="domain"
label={t("workflow_node.deploy.form.volcengine_cdn_domain.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.volcengine_cdn_domain.tooltip") }}></span>}
>
<Input placeholder={t("workflow_node.deploy.form.volcengine_cdn_domain.placeholder")} />
</Form.Item>
</>
);
};
export default DeployNodeFormVolcEngineCDNFields;