mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-03 11:04:19 +00:00
Adjust the form
This commit is contained in:
@@ -1862,6 +1862,7 @@
|
|||||||
"healthCheckTimeoutMin": "Timeout must be at least 1 second",
|
"healthCheckTimeoutMin": "Timeout must be at least 1 second",
|
||||||
"healthCheckRetryMin": "Retry attempts must be at least 1",
|
"healthCheckRetryMin": "Retry attempts must be at least 1",
|
||||||
"healthCheckMode": "Check Mode",
|
"healthCheckMode": "Check Mode",
|
||||||
|
"healthCheckStrategy": "Strategy",
|
||||||
"healthCheckModeDescription": "TCP mode verifies connectivity only. HTTP mode validates the HTTP response.",
|
"healthCheckModeDescription": "TCP mode verifies connectivity only. HTTP mode validates the HTTP response.",
|
||||||
"healthyThreshold": "Healthy Threshold",
|
"healthyThreshold": "Healthy Threshold",
|
||||||
"healthyThresholdDescription": "Consecutive successes required before marking as healthy.",
|
"healthyThresholdDescription": "Consecutive successes required before marking as healthy.",
|
||||||
@@ -1869,8 +1870,8 @@
|
|||||||
"unhealthyThresholdDescription": "Consecutive failures required before marking as unhealthy.",
|
"unhealthyThresholdDescription": "Consecutive failures required before marking as unhealthy.",
|
||||||
"healthCheckHealthyThresholdMin": "Healthy threshold must be at least 1",
|
"healthCheckHealthyThresholdMin": "Healthy threshold must be at least 1",
|
||||||
"healthCheckUnhealthyThresholdMin": "Unhealthy threshold must be at least 1",
|
"healthCheckUnhealthyThresholdMin": "Unhealthy threshold must be at least 1",
|
||||||
"httpMethod": "HTTP Method",
|
"httpMethod": "Scheme",
|
||||||
"selectHttpMethod": "Select HTTP method",
|
"selectHttpMethod": "Select scheme",
|
||||||
"domainPickerSubdomainLabel": "Subdomain",
|
"domainPickerSubdomainLabel": "Subdomain",
|
||||||
"domainPickerBaseDomainLabel": "Base Domain",
|
"domainPickerBaseDomainLabel": "Base Domain",
|
||||||
"domainPickerSearchDomains": "Search domains...",
|
"domainPickerSearchDomains": "Search domains...",
|
||||||
|
|||||||
@@ -78,11 +78,8 @@ export function HealthCheckFormFields({
|
|||||||
name="hcEnabled"
|
name="hcEnabled"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-4">
|
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-4">
|
||||||
<div className="space-y-0.5">
|
<div>
|
||||||
<FormLabel>{t("enableHealthChecks")}</FormLabel>
|
<FormLabel>{t("enableHealthChecks")}</FormLabel>
|
||||||
<FormDescription>
|
|
||||||
{t("enableHealthChecksDescription")}
|
|
||||||
</FormDescription>
|
|
||||||
</div>
|
</div>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Switch
|
<Switch
|
||||||
@@ -99,13 +96,13 @@ export function HealthCheckFormFields({
|
|||||||
|
|
||||||
{showFields && (
|
{showFields && (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
{/* Mode */}
|
{/* Strategy */}
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="hcMode"
|
name="hcMode"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>{t("healthCheckMode")}</FormLabel>
|
<FormLabel>{t("healthCheckStrategy")}</FormLabel>
|
||||||
<Select
|
<Select
|
||||||
onValueChange={(value) =>
|
onValueChange={(value) =>
|
||||||
handleChange("hcMode", value, field.onChange)
|
handleChange("hcMode", value, field.onChange)
|
||||||
@@ -122,9 +119,6 @@ export function HealthCheckFormFields({
|
|||||||
<SelectItem value="tcp">TCP</SelectItem>
|
<SelectItem value="tcp">TCP</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
<FormDescription>
|
|
||||||
{t("healthCheckModeDescription")}
|
|
||||||
</FormDescription>
|
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
@@ -164,6 +158,9 @@ export function HealthCheckFormFields({
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<Input
|
||||||
{...field}
|
{...field}
|
||||||
|
type="number"
|
||||||
|
min={1}
|
||||||
|
max={65535}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
handleChange("hcPort", value, field.onChange);
|
handleChange("hcPort", value, field.onChange);
|
||||||
@@ -176,7 +173,7 @@ export function HealthCheckFormFields({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
|
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="hcScheme"
|
name="hcScheme"
|
||||||
@@ -236,6 +233,9 @@ export function HealthCheckFormFields({
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<Input
|
||||||
{...field}
|
{...field}
|
||||||
|
type="number"
|
||||||
|
min={1}
|
||||||
|
max={65535}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
handleChange("hcPort", value, field.onChange);
|
handleChange("hcPort", value, field.onChange);
|
||||||
@@ -246,33 +246,12 @@ export function HealthCheckFormFields({
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="hcPath"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>{t("healthCheckPath")}</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<Input
|
|
||||||
{...field}
|
|
||||||
onChange={(e) =>
|
|
||||||
handleChange(
|
|
||||||
"hcPath",
|
|
||||||
e.target.value,
|
|
||||||
(v) => field.onChange(e)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* HTTP Method */}
|
{/* HTTP Method + Timeout (shown when not TCP) */}
|
||||||
{watchedMode !== "tcp" && (
|
{watchedMode !== "tcp" && (
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="hcMethod"
|
name="hcMethod"
|
||||||
@@ -304,10 +283,77 @@ export function HealthCheckFormFields({
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="hcPath"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t("healthCheckPath")}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input
|
||||||
|
{...field}
|
||||||
|
onChange={(e) =>
|
||||||
|
handleChange(
|
||||||
|
"hcPath",
|
||||||
|
e.target.value,
|
||||||
|
(v) => field.onChange(e)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="hcTimeout"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t("timeoutSeconds")}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input
|
||||||
|
type="number"
|
||||||
|
{...field}
|
||||||
|
onChange={(e) => {
|
||||||
|
const value = parseInt(e.target.value);
|
||||||
|
handleChange("hcTimeout", value, field.onChange);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Check Interval, Unhealthy Interval, and Timeout */}
|
{/* TCP timeout (shown only for TCP) */}
|
||||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
{watchedMode === "tcp" && (
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="hcTimeout"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t("timeoutSeconds")}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input
|
||||||
|
type="number"
|
||||||
|
{...field}
|
||||||
|
onChange={(e) => {
|
||||||
|
const value = parseInt(e.target.value);
|
||||||
|
handleChange("hcTimeout", value, field.onChange);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Healthy interval + healthy threshold */}
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="hcInterval"
|
name="hcInterval"
|
||||||
@@ -328,7 +374,34 @@ export function HealthCheckFormFields({
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="hcHealthyThreshold"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>{t("healthyThreshold")}</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input
|
||||||
|
type="number"
|
||||||
|
{...field}
|
||||||
|
onChange={(e) => {
|
||||||
|
const value = parseInt(e.target.value);
|
||||||
|
handleChange(
|
||||||
|
"hcHealthyThreshold",
|
||||||
|
value,
|
||||||
|
field.onChange
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Unhealthy interval + unhealthy threshold */}
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="hcUnhealthyInterval"
|
name="hcUnhealthyInterval"
|
||||||
@@ -353,59 +426,6 @@ export function HealthCheckFormFields({
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="hcTimeout"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>{t("timeoutSeconds")}</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<Input
|
|
||||||
type="number"
|
|
||||||
{...field}
|
|
||||||
onChange={(e) => {
|
|
||||||
const value = parseInt(e.target.value);
|
|
||||||
handleChange("hcTimeout", value, field.onChange);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Healthy and Unhealthy Thresholds */}
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="hcHealthyThreshold"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel>{t("healthyThreshold")}</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<Input
|
|
||||||
type="number"
|
|
||||||
{...field}
|
|
||||||
onChange={(e) => {
|
|
||||||
const value = parseInt(e.target.value);
|
|
||||||
handleChange(
|
|
||||||
"hcHealthyThreshold",
|
|
||||||
value,
|
|
||||||
field.onChange
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
<FormDescription>
|
|
||||||
{t("healthyThresholdDescription")}
|
|
||||||
</FormDescription>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="hcUnhealthyThreshold"
|
name="hcUnhealthyThreshold"
|
||||||
@@ -426,9 +446,6 @@ export function HealthCheckFormFields({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>
|
|
||||||
{t("unhealthyThresholdDescription")}
|
|
||||||
</FormDescription>
|
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
@@ -438,7 +455,8 @@ export function HealthCheckFormFields({
|
|||||||
{/* HTTP-only fields */}
|
{/* HTTP-only fields */}
|
||||||
{watchedMode !== "tcp" && (
|
{watchedMode !== "tcp" && (
|
||||||
<>
|
<>
|
||||||
{/* Expected Response Code */}
|
{/* Expected Response Codes + TLS Server Name + Follow Redirects */}
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="hcStatus"
|
name="hcStatus"
|
||||||
@@ -456,15 +474,10 @@ export function HealthCheckFormFields({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>
|
|
||||||
{t("expectedResponseCodesDescription")}
|
|
||||||
</FormDescription>
|
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* TLS Server Name */}
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="hcTlsServerName"
|
name="hcTlsServerName"
|
||||||
@@ -483,13 +496,36 @@ export function HealthCheckFormFields({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>
|
|
||||||
{t("tlsServerNameDescription")}
|
|
||||||
</FormDescription>
|
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Follow Redirects inline toggle */}
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="hcFollowRedirects"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-3">
|
||||||
|
<FormLabel className="cursor-pointer">
|
||||||
|
{t("followRedirects")}
|
||||||
|
</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Switch
|
||||||
|
checked={field.value}
|
||||||
|
onCheckedChange={(value) =>
|
||||||
|
handleChange(
|
||||||
|
"hcFollowRedirects",
|
||||||
|
value,
|
||||||
|
field.onChange
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
{/* Custom Headers */}
|
{/* Custom Headers */}
|
||||||
<FormField
|
<FormField
|
||||||
@@ -518,34 +554,6 @@ export function HealthCheckFormFields({
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Follow Redirects */}
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="hcFollowRedirects"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-4">
|
|
||||||
<div className="space-y-0.5">
|
|
||||||
<FormLabel>{t("followRedirects")}</FormLabel>
|
|
||||||
<FormDescription>
|
|
||||||
{t("followRedirectsDescription")}
|
|
||||||
</FormDescription>
|
|
||||||
</div>
|
|
||||||
<FormControl>
|
|
||||||
<Switch
|
|
||||||
checked={field.value}
|
|
||||||
onCheckedChange={(value) =>
|
|
||||||
handleChange(
|
|
||||||
"hcFollowRedirects",
|
|
||||||
value,
|
|
||||||
field.onChange
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user