|
@@ -11,7 +11,12 @@ export type TunnelNetwork = z.infer<typeof TunnelNetworkSchema>;
|
|
|
// with arr=false.
|
|
// with arr=false.
|
|
|
export const TunnelInboundSettingsSchema = z.object({
|
|
export const TunnelInboundSettingsSchema = z.object({
|
|
|
rewriteAddress: z.string().optional(),
|
|
rewriteAddress: z.string().optional(),
|
|
|
- rewritePort: PortSchema.optional(),
|
|
|
|
|
|
|
+ // AntD InputNumber writes null when cleared; accept it and collapse to
|
|
|
|
|
+ // undefined so the field is omitted from the payload instead of crashing
|
|
|
|
|
+ // validation with "Invalid input" (issue #5516). The trailing .optional()
|
|
|
|
|
+ // keeps the key optional in the inferred type (a bare .transform() would
|
|
|
|
|
+ // make it required).
|
|
|
|
|
+ rewritePort: PortSchema.nullable().transform((v) => v ?? undefined).optional(),
|
|
|
portMap: z.record(z.string(), z.string()).default({}),
|
|
portMap: z.record(z.string(), z.string()).default({}),
|
|
|
allowedNetwork: TunnelNetworkSchema.default('tcp,udp'),
|
|
allowedNetwork: TunnelNetworkSchema.default('tcp,udp'),
|
|
|
followRedirect: z.boolean().default(false),
|
|
followRedirect: z.boolean().default(false),
|