fix: 适配通知平台健康状态

This commit is contained in:
湛兮
2026-06-11 21:07:54 +08:00
parent 60931e2c21
commit f74454f00a
3 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -100,12 +100,12 @@ export const integrations: IntegrationStatus[] = [
key: 'gitea', key: 'gitea',
name: 'Gitea', name: 'Gitea',
state: 'healthy', state: 'healthy',
summary: '四个仓库 mock 同步完成,生产发布优先 tag', summary: '纳管仓库 mock 同步完成,生产发布按项目策略选择 ref/tag',
checkedAt: '2026-06-11 17:40', checkedAt: '2026-06-11 17:40',
latencyMs: 42, latencyMs: 42,
}, },
{ {
key: 'wecom', key: 'notification',
name: '通知平台', name: '通知平台',
state: 'warning', state: 'warning',
summary: '机器人未配置,当前保留企微/飞书/通用 webhook 方案', summary: '机器人未配置,当前保留企微/飞书/通用 webhook 方案',
+5 -2
View File
@@ -372,7 +372,7 @@ function toIntegrationStatuses(health: BackendHealth): IntegrationStatus[] {
return [ return [
toIntegrationStatus('jenkins', 'Jenkins', health), toIntegrationStatus('jenkins', 'Jenkins', health),
toIntegrationStatus('gitea', 'Gitea', health), toIntegrationStatus('gitea', 'Gitea', health),
toIntegrationStatus('wecom', '通知平台', health), toIntegrationStatus('notification', '通知平台', health),
toIntegrationStatus('llm', 'LLM Agent', health), toIntegrationStatus('llm', 'LLM Agent', health),
] ]
} }
@@ -382,7 +382,10 @@ function toIntegrationStatus(
name: string, name: string,
health: BackendHealth, health: BackendHealth,
): IntegrationStatus { ): IntegrationStatus {
const dependency = health.dependencies[key] ?? { status: 'unavailable' as const } const dependency =
health.dependencies[key] ??
(key === 'notification' ? health.dependencies.wecom : undefined) ??
{ status: 'unavailable' as const }
return { return {
key, key,
+1 -1
View File
@@ -66,7 +66,7 @@ export interface IntegrationConfigStatus {
} }
export interface IntegrationStatus { export interface IntegrationStatus {
key: 'jenkins' | 'gitea' | 'wecom' | 'llm' key: 'jenkins' | 'gitea' | 'notification' | 'wecom' | 'llm'
name: string name: string
state: HealthState state: HealthState
summary: string summary: string