refactor: Update health check logic in ServiceRow component to conditionally display health status based on health check configuration, improving clarity and user feedback
Build, Test, and Push CFDM Docker Image / test (push) Successful in 3m46s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Successful in 2m13s
Build, Test, and Push CFDM Docker Image / update-wiki (push) Successful in 7s
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped

This commit is contained in:
Denozordec
2026-06-25 23:24:44 +07:00
parent 934afa5c95
commit 7d0a013b56
@@ -73,7 +73,7 @@ export const ServiceRow = memo(function ServiceRow({
const fqdn = serviceDisplayFqdn(service)
const allFqdns = (service.domains ?? []).map((d) => bindingToFqdn(d))
const healthBindings = (service.domains ?? []).filter(
(d) => d.record_type === 'A' && (d.target_ips?.length ?? 0) > 0 && d.health_check_enabled,
(d) => d.record_type === 'A' && (d.target_ips?.length ?? 0) > 0,
)
const style = transform
@@ -208,11 +208,21 @@ export const ServiceRow = memo(function ServiceRow({
})
function BindingHealthBadge({ binding }: { binding: ServiceDomainBinding }) {
const enabled = Boolean(binding.health_check_enabled)
const { data: health } = useAggregatedHealth(
'binding',
binding.binding_id,
true,
enabled,
)
if (!enabled) {
return (
<HealthCheckBadge
status="unknown"
title={`${bindingToFqdn(binding)} (health-check выключен)`}
className="opacity-50"
/>
)
}
if (!health) return null
return (
<HealthCheckBadge