From dc115331fa6da2daab0e4e0963ff49d2df7c1278 Mon Sep 17 00:00:00 2001 From: debidong <1953531014@qq.com> Date: Sat, 26 Sep 2026 16:32:30 +0800 Subject: [PATCH] feat(alert): add detail_url to AlertInfo Incident alert lists return this shape. The console URL was only on AlertItem, so fduty incident alerts dropped it when printing json or toon. --- models_gen.go | 2 ++ openapi/openapi.en.json | 4 ++++ openapi/openapi.zh.json | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/models_gen.go b/models_gen.go index 5f94e71..bab3084 100644 --- a/models_gen.go +++ b/models_gen.go @@ -564,6 +564,8 @@ type AlertInfo struct { DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"` // Alert description. Description string `json:"description" toon:"description"` + // Console URL of this alert (`{console}/alert/detail/{alert_id}`). Empty when the deployment has no console base configured. + DetailURL string `json:"detail_url" toon:"detail_url"` // Unix timestamp (seconds) when the alert recovered. 0 if still active. EndTime Timestamp `json:"end_time" toon:"end_time"` // Total number of raw events merged into this alert. diff --git a/openapi/openapi.en.json b/openapi/openapi.en.json index d9e361c..9d97f3e 100644 --- a/openapi/openapi.en.json +++ b/openapi/openapi.en.json @@ -1320,6 +1320,10 @@ "description": "Alert description.", "type": "string" }, + "detail_url": { + "description": "Console URL of this alert (`{console}/alert/detail/{alert_id}`). Empty when the deployment has no console base configured.", + "type": "string" + }, "end_time": { "description": "Unix timestamp (seconds) when the alert recovered. 0 if still active.", "format": "int64", diff --git a/openapi/openapi.zh.json b/openapi/openapi.zh.json index 19ed073..dbcc592 100644 --- a/openapi/openapi.zh.json +++ b/openapi/openapi.zh.json @@ -1320,6 +1320,10 @@ "description": "告警描述。", "type": "string" }, + "detail_url": { + "description": "这条告警的控制台页面(`{控制台}/alert/detail/{alert_id}`)。部署没有配置控制台地址时为空。", + "type": "string" + }, "end_time": { "description": "告警恢复的 Unix 时间戳(秒),仍活跃时为 0。", "format": "int64",