Merge branch 'master' into alerting_reminder
* master: (84 commits) docs: adds info about grafana-dev container changelog: add notes about closing #12282 Added Litre/min and milliLitre/min in Flow (#12282) remove papaparse dependency list name is deleteDatasources, not delete_datasources remove internal influx ifql datasource Document the endpoint for deleting an org tests: rewrite into table tests influxdb: adds mode func to backend changelog: add notes about closing #11484 changelog: add notes about closing #11233 Remove import Fix PR feedback Removed papaparse from external plugin exports Karma to Jest: query_builder dsproxy: move http client variable back Karma to Jest: threshold_mapper Expose react and slate to external plugins Karma to Jest: threshold_manager Karma to Jest: query_def, index_pattern ...
This commit is contained in:
@@ -41,10 +41,8 @@ func NewTeamsNotifier(model *m.AlertNotification) (alerting.Notifier, error) {
|
||||
|
||||
type TeamsNotifier struct {
|
||||
NotifierBase
|
||||
Url string
|
||||
Recipient string
|
||||
Mention string
|
||||
log log.Logger
|
||||
Url string
|
||||
log log.Logger
|
||||
}
|
||||
|
||||
func (this *TeamsNotifier) Notify(evalContext *alerting.EvalContext) error {
|
||||
@@ -75,17 +73,17 @@ func (this *TeamsNotifier) Notify(evalContext *alerting.EvalContext) error {
|
||||
})
|
||||
}
|
||||
|
||||
message := this.Mention
|
||||
if evalContext.Rule.State != m.AlertStateOK { //don't add message when going back to alert state ok.
|
||||
message += " " + evalContext.Rule.Message
|
||||
} else {
|
||||
message += " " // summary must not be empty
|
||||
message := ""
|
||||
if evalContext.Rule.State != m.AlertStateOK { //dont add message when going back to alert state ok.
|
||||
message = evalContext.Rule.Message
|
||||
}
|
||||
|
||||
body := map[string]interface{}{
|
||||
"@type": "MessageCard",
|
||||
"@context": "http://schema.org/extensions",
|
||||
"summary": message,
|
||||
"@type": "MessageCard",
|
||||
"@context": "http://schema.org/extensions",
|
||||
// summary MUST not be empty or the webhook request fails
|
||||
// summary SHOULD contain some meaningful information, since it is used for mobile notifications
|
||||
"summary": evalContext.GetNotificationTitle(),
|
||||
"title": evalContext.GetNotificationTitle(),
|
||||
"themeColor": evalContext.GetStateModel().Color,
|
||||
"sections": []map[string]interface{}{
|
||||
|
||||
@@ -89,7 +89,7 @@ func (ss *SqlStore) ensureAdminUser() error {
|
||||
systemUserCountQuery := m.GetSystemUserCountStatsQuery{}
|
||||
|
||||
if err := bus.Dispatch(&systemUserCountQuery); err != nil {
|
||||
fmt.Errorf("Could not determine if admin user exists: %v", err)
|
||||
return fmt.Errorf("Could not determine if admin user exists: %v", err)
|
||||
}
|
||||
|
||||
if systemUserCountQuery.Result.Count > 0 {
|
||||
|
||||
Reference in New Issue
Block a user