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
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:
@@ -73,7 +73,7 @@ export const ServiceRow = memo(function ServiceRow({
|
|||||||
const fqdn = serviceDisplayFqdn(service)
|
const fqdn = serviceDisplayFqdn(service)
|
||||||
const allFqdns = (service.domains ?? []).map((d) => bindingToFqdn(d))
|
const allFqdns = (service.domains ?? []).map((d) => bindingToFqdn(d))
|
||||||
const healthBindings = (service.domains ?? []).filter(
|
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
|
const style = transform
|
||||||
@@ -208,11 +208,21 @@ export const ServiceRow = memo(function ServiceRow({
|
|||||||
})
|
})
|
||||||
|
|
||||||
function BindingHealthBadge({ binding }: { binding: ServiceDomainBinding }) {
|
function BindingHealthBadge({ binding }: { binding: ServiceDomainBinding }) {
|
||||||
|
const enabled = Boolean(binding.health_check_enabled)
|
||||||
const { data: health } = useAggregatedHealth(
|
const { data: health } = useAggregatedHealth(
|
||||||
'binding',
|
'binding',
|
||||||
binding.binding_id,
|
binding.binding_id,
|
||||||
true,
|
enabled,
|
||||||
)
|
)
|
||||||
|
if (!enabled) {
|
||||||
|
return (
|
||||||
|
<HealthCheckBadge
|
||||||
|
status="unknown"
|
||||||
|
title={`${bindingToFqdn(binding)} (health-check выключен)`}
|
||||||
|
className="opacity-50"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
if (!health) return null
|
if (!health) return null
|
||||||
return (
|
return (
|
||||||
<HealthCheckBadge
|
<HealthCheckBadge
|
||||||
|
|||||||
Reference in New Issue
Block a user