mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-09 05:59:50 +00:00
Merge pull request #328 from fudiwei/bugfix/tencentcloud-deploy-config-not-saving
bugfix #324
This commit is contained in:
commit
6ac7a51ce0
@ -44,9 +44,7 @@ const DeployToTencentCLB = () => {
|
||||
}),
|
||||
loadbalancerId: z.string().min(1, t("domain.deployment.form.tencent_clb_loadbalancer_id.placeholder")),
|
||||
listenerId: z.string().optional(),
|
||||
domain: z.string().regex(/^$|^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/, {
|
||||
message: t("common.errmsg.domain_invalid"),
|
||||
}),
|
||||
domain: z.string().optional(),
|
||||
})
|
||||
.refine(
|
||||
(data) => {
|
||||
@ -63,10 +61,20 @@ const DeployToTencentCLB = () => {
|
||||
path: ["listenerId"],
|
||||
}
|
||||
)
|
||||
.refine((data) => (data.resourceType === "ruledomain" ? !!data.domain?.trim() : true), {
|
||||
message: t("domain.deployment.form.tencent_clb_ruledomain.placeholder"),
|
||||
path: ["domain"],
|
||||
});
|
||||
.refine(
|
||||
(data) => {
|
||||
switch (data.resourceType) {
|
||||
case "ssl-deploy":
|
||||
case "ruledomain":
|
||||
return !!data.domain?.trim() && /^$|^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(data.domain);
|
||||
}
|
||||
return true;
|
||||
},
|
||||
{
|
||||
message: t("domain.deployment.form.tencent_clb_ruledomain.placeholder"),
|
||||
path: ["domain"],
|
||||
}
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const res = formSchema.safeParse(config.config);
|
||||
|
Loading…
x
Reference in New Issue
Block a user