Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
be0d4714
Commit
be0d4714
authored
Oct 02, 2017
by
Matthew McGinn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
properly parse & pass upload image bool from config
parent
122e2b5c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
pkg/services/alerting/notifiers/slack.go
+4
-1
No files found.
pkg/services/alerting/notifiers/slack.go
View file @
be0d4714
...
...
@@ -74,6 +74,7 @@ func NewSlackNotifier(model *m.AlertNotification) (alerting.Notifier, error) {
recipient
:=
model
.
Settings
.
Get
(
"recipient"
)
.
MustString
()
mention
:=
model
.
Settings
.
Get
(
"mention"
)
.
MustString
()
token
:=
model
.
Settings
.
Get
(
"token"
)
.
MustString
()
uploadImage
:=
model
.
Settings
.
Get
(
"uploadImage"
)
.
MustBool
(
true
)
return
&
SlackNotifier
{
NotifierBase
:
NewNotifierBase
(
model
.
Id
,
model
.
IsDefault
,
model
.
Name
,
model
.
Type
,
model
.
Settings
),
...
...
@@ -81,6 +82,7 @@ func NewSlackNotifier(model *m.AlertNotification) (alerting.Notifier, error) {
Recipient
:
recipient
,
Mention
:
mention
,
Token
:
token
,
Upload
:
uploadImage
,
log
:
log
.
New
(
"alerting.notifier.slack"
),
},
nil
}
...
...
@@ -91,6 +93,7 @@ type SlackNotifier struct {
Recipient
string
Mention
string
Token
string
Upload
bool
log
log
.
Logger
}
...
...
@@ -162,7 +165,7 @@ func (this *SlackNotifier) Notify(evalContext *alerting.EvalContext) error {
this
.
log
.
Error
(
"Failed to send slack notification"
,
"error"
,
err
,
"webhook"
,
this
.
Name
)
return
err
}
if
this
.
Token
!=
""
{
if
this
.
Token
!=
""
&&
this
.
UploadImage
{
err
=
SlackFileUpload
(
evalContext
,
this
.
log
,
"https://slack.com/api/files.upload"
,
this
.
Recipient
,
this
.
Token
)
if
err
!=
nil
{
return
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment