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
abb8f33d
Commit
abb8f33d
authored
Nov 10, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(alertlist): make it possible to filter on alerts from current dashboard
parent
f924b241
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
public/app/plugins/panel/alertlist/editor.html
+1
-0
public/app/plugins/panel/alertlist/module.ts
+11
-2
No files found.
public/app/plugins/panel/alertlist/editor.html
View file @
abb8f33d
...
...
@@ -11,6 +11,7 @@
<span
class=
"gf-form-label width-8"
>
Max items
</span>
<input
type=
"text"
class=
"gf-form-input max-width-15"
ng-model=
"ctrl.panel.limit"
ng-change=
"ctrl.onRender()"
/>
</div>
<gf-form-switch
class=
"gf-form"
label=
"Alerts from this dashboard"
label-class=
"width-18"
checked=
"ctrl.panel.onlyAlertsOnDashboard"
on-change=
"ctrl.updateStateFilter()"
></gf-form-switch>
</div>
<div
class=
"section gf-form-group"
>
<h5
class=
"section-heading"
>
State filter
</h5>
...
...
public/app/plugins/panel/alertlist/module.ts
View file @
abb8f33d
...
...
@@ -25,7 +25,8 @@ class AlertListPanel extends PanelCtrl {
panelDefaults
=
{
show
:
'current'
,
limit
:
10
,
stateFilter
:
[]
stateFilter
:
[],
onlyAlertsOnDashboard
:
false
};
...
...
@@ -71,9 +72,13 @@ class AlertListPanel extends PanelCtrl {
var
params
:
any
=
{
limit
:
this
.
panel
.
limit
,
type
:
'alert'
,
newState
:
this
.
panel
.
stateFilter
newState
:
this
.
panel
.
stateFilter
,
};
if
(
this
.
panel
.
onlyAlertsOnDashboard
)
{
params
.
dashboardId
=
this
.
dashboard
.
id
;
}
params
.
from
=
dateMath
.
parse
(
this
.
dashboard
.
time
.
from
).
unix
()
*
1000
;
params
.
to
=
dateMath
.
parse
(
this
.
dashboard
.
time
.
to
).
unix
()
*
1000
;
...
...
@@ -93,6 +98,10 @@ class AlertListPanel extends PanelCtrl {
state
:
this
.
panel
.
stateFilter
};
if
(
this
.
panel
.
onlyAlertsOnDashboard
)
{
params
.
dashboardId
=
this
.
dashboard
.
id
;
}
this
.
backendSrv
.
get
(
`/api/alerts`
,
params
)
.
then
(
res
=>
{
this
.
currentAlerts
=
_
.
map
(
res
,
al
=>
{
...
...
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