priority add for traefik config setup

This commit is contained in:
Owen
2025-10-04 21:29:59 -07:00
committed by Pallavi Kumari
parent ff2bcfb0e7
commit 1e4ca69c89
7 changed files with 67 additions and 29 deletions

View File

@@ -305,7 +305,8 @@ export default function ReverseProxyTargets(props: {
path: null,
pathMatchType: null,
rewritePath: null,
rewritePathType: null
rewritePathType: null,
priority: 100
} as z.infer<typeof addTargetSchema>
});
@@ -514,7 +515,8 @@ export default function ReverseProxyTargets(props: {
path: null,
pathMatchType: null,
rewritePath: null,
rewritePathType: null
rewritePathType: null,
priority: 100,
});
}
@@ -592,7 +594,8 @@ export default function ReverseProxyTargets(props: {
path: target.path,
pathMatchType: target.pathMatchType,
rewritePath: target.rewritePath,
rewritePathType: target.rewritePathType
rewritePathType: target.rewritePathType,
priority: target.priority
};
if (target.new) {
@@ -676,7 +679,7 @@ export default function ReverseProxyTargets(props: {
<Info className="h-4 w-4 text-muted-foreground" />
</TooltipTrigger>
<TooltipContent className="max-w-xs">
<p>Higher priority routes are evaluated first. Use this to ensure specific paths like /api/v1 are checked before catch-all routes like /</p>
<p>Higher priority routes are evaluated first. Priority = 100 means automatic ordering (system decides). Use another number to enforce manual priority.</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>

View File

@@ -120,7 +120,8 @@ const addTargetSchema = z.object({
path: z.string().optional().nullable(),
pathMatchType: z.enum(["exact", "prefix", "regex"]).optional().nullable(),
rewritePath: z.string().optional().nullable(),
rewritePathType: z.enum(["exact", "prefix", "regex", "stripPrefix"]).optional().nullable()
rewritePathType: z.enum(["exact", "prefix", "regex", "stripPrefix"]).optional().nullable(),
priority: z.number().int().min(1).max(1000)
}).refine(
(data) => {
// If path is provided, pathMatchType must be provided
@@ -263,6 +264,7 @@ export default function Page() {
pathMatchType: null,
rewritePath: null,
rewritePathType: null,
priority: 100,
} as z.infer<typeof addTargetSchema>
});
@@ -368,6 +370,7 @@ export default function Page() {
pathMatchType: null,
rewritePath: null,
rewritePathType: null,
priority: 100,
});
}
@@ -477,7 +480,8 @@ export default function Page() {
path: target.path,
pathMatchType: target.pathMatchType,
rewritePath: target.rewritePath,
rewritePathType: target.rewritePathType
rewritePathType: target.rewritePathType,
priority: target.priority
};
await api.put(`/resource/${id}/target`, data);
@@ -611,7 +615,7 @@ export default function Page() {
<Info className="h-4 w-4 text-muted-foreground" />
</TooltipTrigger>
<TooltipContent className="max-w-xs">
<p>Higher priority routes are evaluated first. Use this to ensure specific paths like /api/v1 are checked before catch-all routes like /</p>
<p>Higher priority routes are evaluated first. Priority = 100 means automatic ordering (system decides). Use another number to enforce manual priority.</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>