refactor: Integrate group health check logic into ServiceRow and ServiceGroupItem components, enhancing health status display and improving overall service monitoring capabilities
Build, Test, and Push CFDM Docker Image / test (push) Successful in 4m5s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Successful in 2m30s
Build, Test, and Push CFDM Docker Image / update-wiki (push) Successful in 8s
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped

This commit is contained in:
Denozordec committed 2026-06-25 23:39:00 +07:00
1 parent 7d0a013b56
commit 54fd22a42b
4 files changed
+70 -5

No files matched your search

+28 -1
View File
@@ -1516,5 +1516,32 @@ export function listHealthCheckTargets(db: Db): HealthCheckTarget[] {
AND (sg.enabled = 1)
`);
return [...bindingTargets, ...groupTargets];
// IPs of A-bindings of enabled services in a group whose group has health-check enabled.
// These inherit the group's health-check config (scope='binding', ref_id=binding_id),
// so per-domain badges reflect group rules. Skipped for bindings that already have
// their own health_check_enabled=1 (covered by bindingTargets above).
const groupInheritedBindingTargets = db.all<HealthCheckTarget>(sql`
SELECT 'binding' AS scope, sb.id AS ref_id, sbi.ip,
sb.hostname AS hostname,
sg.health_check_type AS type,
sg.health_check_port AS port,
sg.health_check_path AS path,
sg.health_check_expected_status AS expected_status,
sg.health_check_timeout_ms AS timeout_ms
FROM service_binding_ips sbi
JOIN service_bindings sb ON sb.id = sbi.binding_id
JOIN services s ON s.id = sb.service_id
JOIN service_groups sg ON sg.id = s.service_group_id
WHERE sg.health_check_enabled = 1
AND sg.domain IS NOT NULL
AND s.enabled = 1
AND sg.enabled = 1
AND sb.health_check_enabled = 0
`);
return [
...bindingTargets,
...groupTargets,
...groupInheritedBindingTargets,
];
}