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
0c5da915
Commit
0c5da915
authored
Jun 20, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(alerting): only expose DTO info when requesting all notifications
parent
96e5ad3f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
2 deletions
+27
-2
pkg/api/alerting.go
+13
-1
pkg/api/api.go
+1
-1
pkg/api/dtos/alerting.go
+10
-0
public/app/plugins/panel/graph/partials/tab_alerting.html
+3
-0
No files found.
pkg/api/alerting.go
View file @
0c5da915
...
...
@@ -166,7 +166,19 @@ func GetAlertNotifications(c *middleware.Context) Response {
return
ApiError
(
500
,
"Failed to get alert notifications"
,
err
)
}
return
Json
(
200
,
query
.
Result
)
var
result
[]
dtos
.
AlertNotificationDTO
for
_
,
notification
:=
range
query
.
Result
{
result
=
append
(
result
,
dtos
.
AlertNotificationDTO
{
Id
:
notification
.
Id
,
Name
:
notification
.
Name
,
Type
:
notification
.
Type
,
Created
:
notification
.
Created
,
Updated
:
notification
.
Updated
,
})
}
return
Json
(
200
,
result
)
}
func
GetAlertNotificationById
(
c
*
middleware
.
Context
)
Response
{
...
...
pkg/api/api.go
View file @
0c5da915
...
...
@@ -263,7 +263,7 @@ func Register(r *macaron.Macaron) {
r
.
Delete
(
"/:notificationId"
,
wrap
(
DeleteAlertNotification
))
})
r
.
Get
(
"/changes"
,
wrap
(
GetAlertChanges
))
//
r.Get("/changes", wrap(GetAlertChanges))
})
// error test
...
...
pkg/api/dtos/alerting.go
View file @
0c5da915
package
dtos
import
"time"
type
AlertRuleDTO
struct
{
Id
int64
`json:"id"`
DashboardId
int64
`json:"dashboardId"`
...
...
@@ -19,3 +21,11 @@ type AlertRuleDTO struct {
DashbboardUri
string
`json:"dashboardUri"`
}
type
AlertNotificationDTO
struct
{
Id
int64
`json:"id"`
Name
string
`json:"name"`
Type
string
`json:"type"`
Created
time
.
Time
`json:"created"`
Updated
time
.
Time
`json:"updated"`
}
public/app/plugins/panel/graph/partials/tab_alerting.html
View file @
0c5da915
...
...
@@ -109,8 +109,11 @@
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form"
>
<span
class=
"gf-form-label"
>
Groups
</span>
<input
class=
"gf-form-input max-width-7"
type=
"text"
ng-model=
"ctrl.alert.notify"
></input>
<!--
<bootstrap-tagsinput ng-model="ctrl.alert.notify" tagclass="label label-tag" placeholder="add tags">
</bootstrap-tagsinput>
-->
</div>
</div>
</div>
...
...
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