Add prefix to ui and resource

This commit is contained in:
Owen
2025-09-11 21:20:33 -07:00
parent 2551e0c291
commit d51e7f7e40
8 changed files with 280 additions and 17 deletions

View File

@@ -30,7 +30,9 @@ const createTargetSchema = z
ip: z.string().refine(isTargetValid),
method: z.string().optional().nullable(),
port: z.number().int().min(1).max(65535),
enabled: z.boolean().default(true)
enabled: z.boolean().default(true),
path: z.string().optional().nullable(),
pathMatchType: z.enum(["exact", "prefix", "regex"]).optional().nullable()
})
.strict();

View File

@@ -44,7 +44,9 @@ function queryTargets(resourceId: number) {
enabled: targets.enabled,
resourceId: targets.resourceId,
siteId: targets.siteId,
siteType: sites.type
siteType: sites.type,
path: targets.path,
pathMatchType: targets.pathMatchType
})
.from(targets)
.leftJoin(sites, eq(sites.siteId, targets.siteId))

View File

@@ -26,7 +26,9 @@ const updateTargetBodySchema = z
ip: z.string().refine(isTargetValid),
method: z.string().min(1).max(10).optional().nullable(),
port: z.number().int().min(1).max(65535).optional(),
enabled: z.boolean().optional()
enabled: z.boolean().optional(),
path: z.string().optional().nullable(),
pathMatchType: z.enum(["exact", "prefix", "regex"]).optional().nullable()
})
.strict()
.refine((data) => Object.keys(data).length > 0, {