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
3af891d0
Commit
3af891d0
authored
Sep 13, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(alerting): restored alert history
parent
b0c7e61e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
pkg/services/sqlstore/annotation.go
+2
-0
public/app/features/alerting/alert_tab_ctrl.ts
+1
-1
public/app/features/alerting/partials/alert_tab.html
+3
-4
No files found.
pkg/services/sqlstore/annotation.go
View file @
3af891d0
...
@@ -53,8 +53,10 @@ func (r *SqlAnnotationRepo) Find(query *annotations.ItemQuery) ([]*annotations.I
...
@@ -53,8 +53,10 @@ func (r *SqlAnnotationRepo) Find(query *annotations.ItemQuery) ([]*annotations.I
params
=
append
(
params
,
query
.
PanelId
)
params
=
append
(
params
,
query
.
PanelId
)
}
}
if
query
.
From
>
0
&&
query
.
To
>
0
{
sql
.
WriteString
(
` AND epoch BETWEEN ? AND ?`
)
sql
.
WriteString
(
` AND epoch BETWEEN ? AND ?`
)
params
=
append
(
params
,
query
.
From
,
query
.
To
)
params
=
append
(
params
,
query
.
From
,
query
.
To
)
}
if
query
.
Type
!=
""
{
if
query
.
Type
!=
""
{
sql
.
WriteString
(
` AND type = ?`
)
sql
.
WriteString
(
` AND type = ?`
)
...
...
public/app/features/alerting/alert_tab_ctrl.ts
View file @
3af891d0
...
@@ -86,7 +86,7 @@ export class AlertTabCtrl {
...
@@ -86,7 +86,7 @@ export class AlertTabCtrl {
}
}
getAlertHistory
()
{
getAlertHistory
()
{
this
.
backendSrv
.
get
(
`/api/a
lert-history
?dashboardId=
${
this
.
panelCtrl
.
dashboard
.
id
}
&panelId=
${
this
.
panel
.
id
}
&limit=50`
).
then
(
res
=>
{
this
.
backendSrv
.
get
(
`/api/a
nnotations
?dashboardId=
${
this
.
panelCtrl
.
dashboard
.
id
}
&panelId=
${
this
.
panel
.
id
}
&limit=50`
).
then
(
res
=>
{
this
.
alertHistory
=
_
.
map
(
res
,
ah
=>
{
this
.
alertHistory
=
_
.
map
(
res
,
ah
=>
{
ah
.
time
=
moment
(
ah
.
timestamp
).
format
(
'MMM D, YYYY HH:mm:ss'
);
ah
.
time
=
moment
(
ah
.
timestamp
).
format
(
'MMM D, YYYY HH:mm:ss'
);
ah
.
stateModel
=
alertDef
.
getStateDisplayModel
(
ah
.
newState
);
ah
.
stateModel
=
alertDef
.
getStateDisplayModel
(
ah
.
newState
);
...
...
public/app/features/alerting/partials/alert_tab.html
View file @
3af891d0
...
@@ -27,13 +27,12 @@
...
@@ -27,13 +27,12 @@
<div
class=
"gf-form-group"
>
<div
class=
"gf-form-group"
>
<h5
class=
"section-heading"
>
Alert Config
</h5>
<h5
class=
"section-heading"
>
Alert Config
</h5>
<div
class=
"gf-form"
>
<div
class=
"gf-form"
>
<span
class=
"gf-form-label width-
8
"
>
Name
</span>
<span
class=
"gf-form-label width-
6
"
>
Name
</span>
<input
type=
"text"
class=
"gf-form-input width-2
5
"
ng-model=
"ctrl.alert.name"
>
<input
type=
"text"
class=
"gf-form-input width-2
0
"
ng-model=
"ctrl.alert.name"
>
<span
class=
"gf-form-label
width-8
"
>
Evaluate every
</span>
<span
class=
"gf-form-label"
>
Evaluate every
</span>
<input
class=
"gf-form-input max-width-5"
type=
"text"
ng-model=
"ctrl.alert.frequency"
></input>
<input
class=
"gf-form-input max-width-5"
type=
"text"
ng-model=
"ctrl.alert.frequency"
></input>
</div>
</div>
</div>
</div>
</div>
<div
class=
"gf-form-group"
>
<div
class=
"gf-form-group"
>
<h5
class=
"section-heading"
>
Conditions
</h5>
<h5
class=
"section-heading"
>
Conditions
</h5>
...
...
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