File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
public/app/features/alerting Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ var evalFunctions = [
28
28
{ text : 'HAS NO VALUE' , value : 'no_value' }
29
29
] ;
30
30
31
+ var evalOperators = [
32
+ { text : 'OR' , value : 'or' } ,
33
+ { text : 'AND' , value : 'and' } ,
34
+ ] ;
35
+
31
36
var reducerTypes = [
32
37
{ text : 'avg()' , value : 'avg' } ,
33
38
{ text : 'min()' , value : 'min' } ,
@@ -116,6 +121,7 @@ export default {
116
121
getStateDisplayModel : getStateDisplayModel ,
117
122
conditionTypes : conditionTypes ,
118
123
evalFunctions : evalFunctions ,
124
+ evalOperators : evalOperators ,
119
125
noDataModes : noDataModes ,
120
126
executionErrorModes : executionErrorModes ,
121
127
reducerTypes : reducerTypes ,
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export class AlertTabCtrl {
18
18
alert : any ;
19
19
conditionModels : any ;
20
20
evalFunctions : any ;
21
+ evalOperators : any ;
21
22
noDataModes : any ;
22
23
executionErrorModes : any ;
23
24
addNotificationSegment ;
@@ -41,6 +42,7 @@ export class AlertTabCtrl {
41
42
this . $scope . ctrl = this ;
42
43
this . subTabIndex = 0 ;
43
44
this . evalFunctions = alertDef . evalFunctions ;
45
+ this . evalOperators = alertDef . evalOperators ;
44
46
this . conditionTypes = alertDef . conditionTypes ;
45
47
this . noDataModes = alertDef . noDataModes ;
46
48
this . executionErrorModes = alertDef . executionErrorModes ;
@@ -194,6 +196,7 @@ export class AlertTabCtrl {
194
196
query : { params : [ 'A' , '5m' , 'now' ] } ,
195
197
reducer : { type : 'avg' , params : [ ] } ,
196
198
evaluator : { type : 'gt' , params : [ null ] } ,
199
+ operator : { type : 'and' } ,
197
200
} ;
198
201
}
199
202
@@ -250,6 +253,7 @@ export class AlertTabCtrl {
250
253
cm . queryPart = new QueryPart ( source . query , alertDef . alertQueryDef ) ;
251
254
cm . reducerPart = alertDef . createReducerPart ( source . reducer ) ;
252
255
cm . evaluator = source . evaluator ;
256
+ cm . operator = source . operator ;
253
257
254
258
return cm ;
255
259
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ <h5 class="section-heading">Alert Config</h5>
38
38
< h5 class ="section-heading "> Conditions</ h5 >
39
39
< div class ="gf-form-inline " ng-repeat ="conditionModel in ctrl.conditionModels ">
40
40
< div class ="gf-form ">
41
- < span class ="gf-form-label query-keyword width-5 " ng-if ="$index "> AND </ span >
41
+ < metric-segment-model css- class ="query-keyword " ng-if ="$index " property =" conditionModel.operator.type " options =" ctrl.evalOperators " custom =" false " > </ metric-segment-model >
42
42
< span class ="gf-form-label query-keyword width-5 " ng-if ="$index===0 "> WHEN</ span >
43
43
</ div >
44
44
< div class ="gf-form ">
You can’t perform that action at this time.
0 commit comments