From b958537f3ed4eab63249b2206eda2b09fc1fa5f9 Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 16 Apr 2026 17:05:25 -0700 Subject: [PATCH] Adjust the form --- messages/en-US.json | 5 +- src/components/HealthCheckFormFields.tsx | 328 ++++++++++++----------- 2 files changed, 171 insertions(+), 162 deletions(-) diff --git a/messages/en-US.json b/messages/en-US.json index 0b4dde100..5d53ea03b 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -1862,6 +1862,7 @@ "healthCheckTimeoutMin": "Timeout must be at least 1 second", "healthCheckRetryMin": "Retry attempts must be at least 1", "healthCheckMode": "Check Mode", + "healthCheckStrategy": "Strategy", "healthCheckModeDescription": "TCP mode verifies connectivity only. HTTP mode validates the HTTP response.", "healthyThreshold": "Healthy Threshold", "healthyThresholdDescription": "Consecutive successes required before marking as healthy.", @@ -1869,8 +1870,8 @@ "unhealthyThresholdDescription": "Consecutive failures required before marking as unhealthy.", "healthCheckHealthyThresholdMin": "Healthy threshold must be at least 1", "healthCheckUnhealthyThresholdMin": "Unhealthy threshold must be at least 1", - "httpMethod": "HTTP Method", - "selectHttpMethod": "Select HTTP method", + "httpMethod": "Scheme", + "selectHttpMethod": "Select scheme", "domainPickerSubdomainLabel": "Subdomain", "domainPickerBaseDomainLabel": "Base Domain", "domainPickerSearchDomains": "Search domains...", diff --git a/src/components/HealthCheckFormFields.tsx b/src/components/HealthCheckFormFields.tsx index 249fb2e24..f6f32dd34 100644 --- a/src/components/HealthCheckFormFields.tsx +++ b/src/components/HealthCheckFormFields.tsx @@ -78,11 +78,8 @@ export function HealthCheckFormFields({ name="hcEnabled" render={({ field }) => ( -
+
{t("enableHealthChecks")} - - {t("enableHealthChecksDescription")} -
- {/* Mode */} + {/* Strategy */} ( - {t("healthCheckMode")} + {t("healthCheckStrategy")} - - {t("healthCheckModeDescription")} - )} @@ -164,6 +158,9 @@ export function HealthCheckFormFields({ { const value = e.target.value; handleChange("hcPort", value, field.onChange); @@ -176,7 +173,7 @@ export function HealthCheckFormFields({ />
) : ( -
+
{ const value = e.target.value; handleChange("hcPort", value, field.onChange); @@ -246,6 +246,43 @@ export function HealthCheckFormFields({ )} /> +
+ )} + + {/* HTTP Method + Timeout (shown when not TCP) */} + {watchedMode !== "tcp" && ( +
+ ( + + {t("httpMethod")} + + + + )} + /> )} /> + ( + + {t("timeoutSeconds")} + + { + const value = parseInt(e.target.value); + handleChange("hcTimeout", value, field.onChange); + }} + /> + + + + )} + />
)} - {/* HTTP Method */} - {watchedMode !== "tcp" && ( + {/* TCP timeout (shown only for TCP) */} + {watchedMode === "tcp" && ( ( - {t("httpMethod")} - + {t("timeoutSeconds")} + + { + const value = parseInt(e.target.value); + handleChange("hcTimeout", value, field.onChange); + }} + /> + )} /> )} - {/* Check Interval, Unhealthy Interval, and Timeout */} -
+ {/* Healthy interval + healthy threshold */} +
)} /> + ( + + {t("healthyThreshold")} + + { + const value = parseInt(e.target.value); + handleChange( + "hcHealthyThreshold", + value, + field.onChange + ); + }} + /> + + + + )} + /> +
+ {/* Unhealthy interval + unhealthy threshold */} +
)} /> - - ( - - {t("timeoutSeconds")} - - { - const value = parseInt(e.target.value); - handleChange("hcTimeout", value, field.onChange); - }} - /> - - - - )} - /> -
- - {/* Healthy and Unhealthy Thresholds */} -
- ( - - {t("healthyThreshold")} - - { - const value = parseInt(e.target.value); - handleChange( - "hcHealthyThreshold", - value, - field.onChange - ); - }} - /> - - - {t("healthyThresholdDescription")} - - - - )} - /> - - - {t("unhealthyThresholdDescription")} - )} @@ -438,55 +455,74 @@ export function HealthCheckFormFields({ {/* HTTP-only fields */} {watchedMode !== "tcp" && ( <> - {/* Expected Response Code */} - ( - - {t("expectedResponseCodes")} - - { - const val = e.target.value; - const value = val ? parseInt(val) : null; - handleChange("hcStatus", value, field.onChange); - }} - /> - - - {t("expectedResponseCodesDescription")} - - - - )} - /> + {/* Expected Response Codes + TLS Server Name + Follow Redirects */} +
+ ( + + {t("expectedResponseCodes")} + + { + const val = e.target.value; + const value = val ? parseInt(val) : null; + handleChange("hcStatus", value, field.onChange); + }} + /> + + + + )} + /> + ( + + {t("tlsServerName")} + + + handleChange( + "hcTlsServerName", + e.target.value, + (v) => field.onChange(e) + ) + } + /> + + + + )} + /> +
- {/* TLS Server Name */} + {/* Follow Redirects inline toggle */} ( - - {t("tlsServerName")} + + + {t("followRedirects")} + - + handleChange( - "hcTlsServerName", - e.target.value, - (v) => field.onChange(e) + "hcFollowRedirects", + value, + field.onChange ) } /> - - {t("tlsServerNameDescription")} - - )} /> @@ -518,34 +554,6 @@ export function HealthCheckFormFields({ )} /> - - {/* Follow Redirects */} - ( - -
- {t("followRedirects")} - - {t("followRedirectsDescription")} - -
- - - handleChange( - "hcFollowRedirects", - value, - field.onChange - ) - } - /> - -
- )} - /> )}