Przeglądaj źródła

Merge pull request #13167 from holiiveira/teams-image

Alert Teams - Adding Action to view the graph by its public URL.
Marcus Efraimsson 7 lat temu
rodzic
commit
fc597260c0
1 zmienionych plików z 19 dodań i 7 usunięć
  1. 19 7
      pkg/services/alerting/notifiers/teams.go

+ 19 - 7
pkg/services/alerting/notifiers/teams.go

@@ -96,14 +96,26 @@ func (this *TeamsNotifier) Notify(evalContext *alerting.EvalContext) error {
 					},
 				},
 				"text": message,
-				"potentialAction": []map[string]interface{}{
+			},
+		},
+		"potentialAction": []map[string]interface{}{
+			{
+				"@context": "http://schema.org",
+				"@type":    "OpenUri",
+				"name":     "View Rule",
+				"targets": []map[string]interface{}{
+					{
+						"os": "default", "uri": ruleUrl,
+					},
+				},
+			},
+			{
+				"@context": "http://schema.org",
+				"@type":    "OpenUri",
+				"name":     "View Graph",
+				"targets": []map[string]interface{}{
 					{
-						"@context": "http://schema.org",
-						"@type":    "ViewAction",
-						"name":     "View Rule",
-						"target": []string{
-							ruleUrl,
-						},
+						"os": "default", "uri": evalContext.ImagePublicUrl,
 					},
 				},
 			},