Merge pull request #13167 from holiiveira/teams-image

Alert Teams - Adding Action to view the graph by its public URL.
This commit is contained in:
Marcus Efraimsson 2018-09-07 11:24:06 +02:00 committed by GitHub
commit fc597260c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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{}{
{
"@context": "http://schema.org",
"@type": "ViewAction",
"name": "View Rule",
"target": []string{
ruleUrl,
},
"os": "default", "uri": ruleUrl,
},
},
},
{
"@context": "http://schema.org",
"@type": "OpenUri",
"name": "View Graph",
"targets": []map[string]interface{}{
{
"os": "default", "uri": evalContext.ImagePublicUrl,
},
},
},