refactor(ui): clean code
This commit is contained in:
@@ -10,7 +10,7 @@ type DeployNodeConfigFormAliyunCLBConfigFieldValues = Nullish<{
|
||||
resourceType: string;
|
||||
region: string;
|
||||
loadbalancerId?: string;
|
||||
listenerPort?: string | number;
|
||||
listenerPort?: number;
|
||||
domain?: string;
|
||||
}>;
|
||||
|
||||
@@ -53,10 +53,13 @@ const DeployNodeConfigFormAliyunCLBConfig = ({
|
||||
.min(1, t("workflow_node.deploy.form.aliyun_clb_loadbalancer_id.placeholder"))
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 }))
|
||||
.trim(),
|
||||
listenerPort: z
|
||||
.union([z.number(), z.string()])
|
||||
.refine((v) => fieldResourceType === RESOURCE_TYPE_LISTENER && validPortNumber(v), t("workflow_node.deploy.form.aliyun_clb_listener_port.placeholder"))
|
||||
.nullish(),
|
||||
listenerPort: z.preprocess(
|
||||
(v) => (v == null || v === "" ? undefined : Number(v)),
|
||||
z
|
||||
.number()
|
||||
.nullish()
|
||||
.refine((v) => fieldResourceType === RESOURCE_TYPE_LISTENER && validPortNumber(v!), t("workflow_node.deploy.form.aliyun_clb_listener_port.placeholder"))
|
||||
),
|
||||
domain: z
|
||||
.string()
|
||||
.nullish()
|
||||
|
||||
Reference in New Issue
Block a user