Skip to content

Commit 40cf9a0

Browse files
authored
Merge pull request #66 from flashcatcloud/main-tmp
optimize zoom tmpl
2 parents 0b31407 + 6a62ae9 commit 40cf9a0

3 files changed

Lines changed: 229 additions & 218 deletions

File tree

flashduty/en/1. On-call/4. Configure On-call/4.7 Templates.md

Lines changed: 111 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -893,110 +893,121 @@ Responders: {{range .Responders}}@{{.PersonName}} {{end}}{{end}}
893893

894894
```json
895895
{
896-
"head": {
897-
"text": "{{fireReason .}}INC [#{{.Num}}] {{.Title}}",
898-
"style": {
899-
"bold": true,
900-
"italic": false,
901-
"color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}"
902-
}
903-
},
904-
"body": [
905-
{
906-
"type": "message",
907-
"text": {{printf "%q" (print "Channel: " .ChannelName)}},
908-
"style": {
909-
"bold": false,
910-
"italic": false
911-
}
912-
},
913-
{
914-
"type": "message",
915-
"text": "Severity: {{.IncidentSeverity}}",
916-
"style": {
917-
"bold": false,
918-
"italic": false,
919-
"color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}"
920-
}
921-
},
922-
{
923-
"type": "message",
924-
"text": "{{if .AlertCnt}}Grouped alerts: {{.AlertCnt}}{{end}}",
925-
"style": {
926-
"bold": false,
927-
"italic": false
928-
}
929-
},
930-
{{if .Labels.resource}}
931-
{
932-
"type": "message",
933-
"text": {{printf "%q" (print "Resources: " (joinAlertLabels . "resource" ", "))}},
896+
"content": {
897+
"head": {
898+
"text": "{{fireReason .}}INC [#{{.Num}}] {{.Title}}",
934899
"style": {
935-
"bold": false,
936-
"italic": false
900+
"bold": true,
901+
"italic": false,
902+
"color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}"
937903
}
938-
},
939-
{{end}}{{if .Labels.body_text}}
940-
{
941-
"type": "message",
942-
"text": {{printf "%q" (print "Description: " .Labels.body_text)}},
943-
"style": {
944-
"bold": false,
945-
"italic": false
904+
},
905+
"body": [
906+
{
907+
"type": "message",
908+
"text": {{printf "%q" (print "Channel: " .ChannelName)}},
909+
"style": {
910+
"bold": false,
911+
"italic": false
912+
}
913+
},
914+
{
915+
"type": "message",
916+
"text": "Severity: {{.IncidentSeverity}}",
917+
"style": {
918+
"bold": false,
919+
"italic": false,
920+
"color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}"
921+
}
946922
}
923+
{{- if .AlertCnt -}},
924+
{
925+
"type": "message",
926+
"text": "Grouped alerts: {{.AlertCnt}}",
927+
"style": {
928+
"bold": false,
929+
"italic": false
930+
}
931+
}
932+
{{- end -}}
933+
{{- if .Labels.resource -}},
934+
{
935+
"type": "message",
936+
"text": {{printf "%q" (print "Resources: " (joinAlertLabels . "resource" ", "))}},
937+
"style": {
938+
"bold": false,
939+
"italic": false
940+
}
941+
}
942+
{{- end -}}
943+
{{- if .Labels.body_text -}},
944+
{
945+
"type": "message",
946+
"text": {{printf "%q" (print "Description: " .Labels.body_text)}},
947+
"style": {
948+
"bold": false,
949+
"italic": false
950+
}
951+
}
952+
{{- else if .Description -}},
953+
{
954+
"type": "message",
955+
"text": {{printf "%q" (print "Description: " .Description)}},
956+
"style": {
957+
"bold": false,
958+
"italic": false
959+
}
960+
}
961+
{{- end -}}
962+
{{- if gt (len .Responders) 0 -}},
963+
{
964+
"type": "message",
965+
"text": "Responders: {{range .Responders}}@{{.PersonName}}{{end}}",
966+
"style": {
967+
"bold": false,
968+
"italic": false
969+
}
970+
}
971+
{{- end -}},
972+
{
973+
"type": "message",
974+
"text": "Details: {{.DetailUrl}}",
975+
"style": {
976+
"bold": true,
977+
"italic": false
978+
}
979+
},
980+
{
981+
"type": "message",
982+
"text": "Ack: {{.DetailUrl}}?ack=1",
983+
"style": {
984+
"bold": true,
985+
"italic": false
986+
}
987+
}
988+
{{- if .IsFlapping -}},
989+
{
990+
"type": "message",
991+
"text": "🔴 The current incident status changes frequently, notifications will be muted for {{.Flapping.MuteMinutes}} minute(s), it is recommended to optimize the alerting strategy.",
992+
"style": {
993+
"bold": true,
994+
"italic": false
995+
}
996+
}
997+
{{- end -}}
998+
{{- if .IsInStorm -}},
999+
{
1000+
"type": "message",
1001+
"text": "🔴 The current incident has grouped {{.AlertCnt}} alerts, triggering an alert storm, please handle it urgently!",
1002+
"style": {
1003+
"bold": true,
1004+
"italic": false
1005+
}
1006+
}
1007+
{{- end -}}
1008+
]
9471009
},
948-
{{else if .Description}}
949-
{
950-
"type": "message",
951-
"text": {{printf "%q" (print "Description: " .Description)}},
952-
"style": {
953-
"bold": false,
954-
"italic": false
955-
}
956-
},
957-
{{end}}{{if gt (len .Responders) 0}}
958-
{
959-
"type": "message",
960-
"text": "Responders: {{range .Responders}}@{{.PersonName}}{{end}}",
961-
"style": {
962-
"bold": false,
963-
"italic": false
964-
}
965-
},
966-
{{end}}
967-
{
968-
"type": "message",
969-
"text": "Details: {{.DetailUrl}}",
970-
"style": {
971-
"bold": true,
972-
"italic": false
973-
}
974-
},
975-
{
976-
"type": "message",
977-
"text": "Ack: {{.DetailUrl}}?ack=1",
978-
"style": {
979-
"bold": true,
980-
"italic": false
981-
}
982-
},
983-
{
984-
"type": "message",
985-
"text": "{{if .IsFlapping}}🔴 The current incident status changes frequently, notifications will be muted for {{.Flapping.MuteMinutes}} minute(s), it is recommended to optimize the alerting strategy.{{end}}",
986-
"style": {
987-
"bold": true,
988-
"italic": false
989-
}
990-
},
991-
{
992-
"type": "message",
993-
"text": "{{if .IsInStorm}}🔴 The current incident has grouped {{.AlertCnt}} alerts, triggering an alert storm, please handle it urgently!{{end}}",
994-
"style": {
995-
"bold": true,
996-
"italic": false
997-
}
998-
}
999-
]
1010+
"is_markdown_support": true
10001011
}
10011012
```
10021013
</div>

flashduty/zh/1. On-call/3. 配置管理/4.13 通知机器人.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -269,24 +269,13 @@ FlashDuty 支持多种通知渠道,包括手机短信、邮件、语音通话
269269

270270
**配置步骤:**
271271

272-
1. **安装 Incoming Webhook 应用**
273-
- 在 Zoom App 中搜索 "Incoming Webhook"
274-
- 点击"添加"安装应用
275-
276-
2. **连接 FlashDuty**
277-
- 在频道或 Incoming Webhook 应用中输入:`/inc connect flashduty`
278-
- 应用将返回连接信息
279-
280-
3. **配置 Webhook 信息**
281-
- 复制 Endpoint 中的标识符(例如:`V9S5as-zTXOSUdgMITNEwA`
282-
- 将其填入 FlashDuty 通知渠道的 Webhook 地址
283-
- 复制 Verification Token 并填入对应字段
284-
285-
4. **添加成员**
286-
- 点击 Incoming Webhook 右上角的成员管理
287-
- 添加相关人员
288-
289-
> **注意:** 如需使用 @ 功能,请联系管理员
272+
1. 打开 Zoom 应用,进入 Add Apps,搜索并添加 Incoming Webhook 应用。
273+
2. 返回聊天界面,确认已成功添加“Incoming Webhook”应用。
274+
3. 在频道或 Incoming Webhook 应用中输入命令:
275+
/inc connect flashduty 系统会返回应用连接信息。
276+
- 复制返回信息中的 Endpoint 地址(如:https://integrations.zoom.us/chat/webhooks/incomingwebhook/V9S5as-zTXOSUdgMITNEwA),将其填写到通知渠道的 Zoom 机器人 Webhook 地址或 Token 字段中。
277+
4. 复制返回信息中的 Verification Token,填写到通知渠道的 Zoom 机器人 Verify Token 字段中。
278+
5. 如需使用 @ 功能,需保证 Zoom 和 Flashduty 中的邮箱一致。管理员可在 Zoom 控制后台获取 zoom 的 user_id,并在 Flashduty 的集成中心-映射数据中创建映射表(源标签填写 email,结果标签填写 zoom_jid),最后在协作空间-分派策略中关联对应 Zoom 机器人和 映射表。
290279

291280
<img src="https://api.apifox.com/api/v1/projects/4169655/resources/436270/image-preview" alt="Zoom 机器人配置界面" style="display: block; margin: 0 auto;" width="500">
292281

0 commit comments

Comments
 (0)