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
773fb5d1
Commit
773fb5d1
authored
Nov 23, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(alerting): check if dashboard is saved before testing alert rule, fixes #6549
parent
c365d52a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
pkg/api/alerting.go
+4
-0
No files found.
pkg/api/alerting.go
View file @
773fb5d1
...
@@ -103,6 +103,10 @@ func GetAlerts(c *middleware.Context) Response {
...
@@ -103,6 +103,10 @@ func GetAlerts(c *middleware.Context) Response {
// POST /api/alerts/test
// POST /api/alerts/test
func
AlertTest
(
c
*
middleware
.
Context
,
dto
dtos
.
AlertTestCommand
)
Response
{
func
AlertTest
(
c
*
middleware
.
Context
,
dto
dtos
.
AlertTestCommand
)
Response
{
if
_
,
idErr
:=
dto
.
Dashboard
.
Get
(
"id"
)
.
Int64
();
idErr
!=
nil
{
return
ApiError
(
400
,
"The dashboard needs to be saved at least once before you can test an alert rule"
,
nil
)
}
backendCmd
:=
alerting
.
AlertTestCommand
{
backendCmd
:=
alerting
.
AlertTestCommand
{
OrgId
:
c
.
OrgId
,
OrgId
:
c
.
OrgId
,
Dashboard
:
dto
.
Dashboard
,
Dashboard
:
dto
.
Dashboard
,
...
...
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