File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
public/app/plugins/panel/alertlist Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ <h5 class="section-heading">Options</h5>
11
11
< span class ="gf-form-label width-8 "> Max items</ span >
12
12
< input type ="text " class ="gf-form-input max-width-15 " ng-model ="ctrl.panel.limit " ng-change ="ctrl.onRender() " />
13
13
</ div >
14
+ < 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 >
14
15
</ div >
15
16
< div class ="section gf-form-group ">
16
17
< h5 class ="section-heading "> State filter</ h5 >
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ class AlertListPanel extends PanelCtrl {
25
25
panelDefaults = {
26
26
show : 'current' ,
27
27
limit : 10 ,
28
- stateFilter : [ ]
28
+ stateFilter : [ ] ,
29
+ onlyAlertsOnDashboard : false
29
30
} ;
30
31
31
32
@@ -71,9 +72,13 @@ class AlertListPanel extends PanelCtrl {
71
72
var params : any = {
72
73
limit : this . panel . limit ,
73
74
type : 'alert' ,
74
- newState : this . panel . stateFilter
75
+ newState : this . panel . stateFilter ,
75
76
} ;
76
77
78
+ if ( this . panel . onlyAlertsOnDashboard ) {
79
+ params . dashboardId = this . dashboard . id ;
80
+ }
81
+
77
82
params . from = dateMath . parse ( this . dashboard . time . from ) . unix ( ) * 1000 ;
78
83
params . to = dateMath . parse ( this . dashboard . time . to ) . unix ( ) * 1000 ;
79
84
@@ -93,6 +98,10 @@ class AlertListPanel extends PanelCtrl {
93
98
state : this . panel . stateFilter
94
99
} ;
95
100
101
+ if ( this . panel . onlyAlertsOnDashboard ) {
102
+ params . dashboardId = this . dashboard . id ;
103
+ }
104
+
96
105
this . backendSrv . get ( `/api/alerts` , params )
97
106
. then ( res => {
98
107
this . currentAlerts = _ . map ( res , al => {
You can’t perform that action at this time.
0 commit comments