diff --git a/package.json b/package.json index 5490435309f..bc356554859 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "zone.js": "^0.6.6", - "autoprefixer": "^6.3.3", + "autoprefixer": "^6.4.0", "es6-promise": "^3.0.2", "es6-shim": "^0.35.1", "expect.js": "~0.2.0", diff --git a/pkg/services/alerting/conditions/evaluator.go b/pkg/services/alerting/conditions/evaluator.go index 943d18506b5..3ef8576afc7 100644 --- a/pkg/services/alerting/conditions/evaluator.go +++ b/pkg/services/alerting/conditions/evaluator.go @@ -19,9 +19,9 @@ type DefaultAlertEvaluator struct { func (e *DefaultAlertEvaluator) Eval(series *tsdb.TimeSeries, reducedValue float64) bool { switch e.Type { - case ">": + case "gt": return reducedValue > e.Threshold - case "<": + case "lt": return reducedValue < e.Threshold } diff --git a/pkg/services/alerting/conditions/query_test.go b/pkg/services/alerting/conditions/query_test.go index 558293ba4be..f12562dec0b 100644 --- a/pkg/services/alerting/conditions/query_test.go +++ b/pkg/services/alerting/conditions/query_test.go @@ -18,7 +18,7 @@ func TestQueryCondition(t *testing.T) { queryConditionScenario("Given avg() and > 100", func(ctx *queryConditionTestContext) { ctx.reducer = `{"type": "avg"}` - ctx.evaluator = `{"type": ">", "params": [100]}` + ctx.evaluator = `{"type": "gt "params": [100]}` Convey("Can read query condition from json model", func() { ctx.exec() diff --git a/public/app/features/alerting/alert_tab_ctrl.ts b/public/app/features/alerting/alert_tab_ctrl.ts index 328c8d0f874..217f67124ef 100644 --- a/public/app/features/alerting/alert_tab_ctrl.ts +++ b/public/app/features/alerting/alert_tab_ctrl.ts @@ -172,7 +172,9 @@ export class AlertTabCtrl { delete() { this.panel.alert = {enabled: false}; - this.initModel(); + this.panel.thresholds = []; + this.conditionModels = []; + this.panelCtrl.render(); } enable() { diff --git a/public/app/plugins/panel/graph/module.ts b/public/app/plugins/panel/graph/module.ts index 3c2894ba922..05da5652b74 100644 --- a/public/app/plugins/panel/graph/module.ts +++ b/public/app/plugins/panel/graph/module.ts @@ -3,6 +3,7 @@ import './graph'; import './legend'; import './series_overrides_ctrl'; +import './thresholds_form'; import template from './template'; import angular from 'angular'; @@ -327,14 +328,6 @@ class GraphCtrl extends MetricsPanelCtrl { fileExport.exportSeriesListToCsvColumns(this.seriesList); } - addThreshold() { - this.panel.thresholds.push({value: undefined, colorMode: "critical", op: 'gt', fill: true, line: true}); - } - - removeThreshold(index) { - this.panel.thresholds.splice(index, 1); - this.render(); - } } export {GraphCtrl, GraphCtrl as PanelCtrl} diff --git a/public/app/plugins/panel/graph/tab_display.html b/public/app/plugins/panel/graph/tab_display.html index 20973d3d56b..14c8c4cf6fc 100644 --- a/public/app/plugins/panel/graph/tab_display.html +++ b/public/app/plugins/panel/graph/tab_display.html @@ -10,7 +10,9 @@
+ Visual thresholds options disabled.
+ Visit the Alert tab update your thresholds.
+ To re-enable thresholds, the alert rule must be deleted from this panel.
+