From ea7fe0c7614459637788855675e47b929cdbfcb9 Mon Sep 17 00:00:00 2001 From: ubhatnagar Date: Thu, 24 Sep 2015 09:40:09 +0530 Subject: [PATCH 1/6] Single stat panel throws warning on multiple series result. --- public/app/panels/singlestat/module.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/app/panels/singlestat/module.js b/public/app/panels/singlestat/module.js index 152a12ab44f..0e18804df11 100644 --- a/public/app/panels/singlestat/module.js +++ b/public/app/panels/singlestat/module.js @@ -171,6 +171,12 @@ function (angular, app, _, kbn, TimeSeries, PanelMeta) { $scope.render = function() { var data = {}; + if($scope.series.length > 1) { + $scope.appEvent('alert-warning', ['Multiple Series Error', 'Metric query returns ' + + $scope.series.length + ' series. Single Stat Panel expects a single series.']); + $scope.series = []; + } + $scope.setValues(data); data.thresholds = $scope.panel.thresholds.split(',').map(function(strVale) { @@ -185,7 +191,6 @@ function (angular, app, _, kbn, TimeSeries, PanelMeta) { $scope.setValues = function(data) { data.flotpairs = []; - if ($scope.series && $scope.series.length > 0) { var lastPoint = _.last($scope.series[0].datapoints); var lastValue = _.isArray(lastPoint) ? lastPoint[0] : null; From 9da5ef3cbfb480d164fca13382241a44b92fc809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 24 Sep 2015 11:36:25 +0200 Subject: [PATCH 2/6] fix(singestat): fixed missing sparklines, caused by recent changes to time range handling, fixes #2815 --- public/app/panels/singlestat/singleStatPanel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/panels/singlestat/singleStatPanel.js b/public/app/panels/singlestat/singleStatPanel.js index cb063138310..b04f1c57dcd 100644 --- a/public/app/panels/singlestat/singleStatPanel.js +++ b/public/app/panels/singlestat/singleStatPanel.js @@ -122,8 +122,8 @@ function (angular, app, _, $) { xaxis: { show: false, mode: "time", - min: scope.range.from.getTime(), - max: scope.range.to.getTime(), + min: scope.range.from.valueOf(), + max: scope.range.to.valueOf(), }, grid: { hoverable: false, show: false }, }; From 026fffa19f903837866aed994ffabafbdf9465ec Mon Sep 17 00:00:00 2001 From: ubhatnagar Date: Thu, 24 Sep 2015 23:13:05 +0530 Subject: [PATCH 3/6] Singlestat Panel Error in InspectCtrl. --- public/app/panels/singlestat/module.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/public/app/panels/singlestat/module.js b/public/app/panels/singlestat/module.js index 0e18804df11..f065d2cb653 100644 --- a/public/app/panels/singlestat/module.js +++ b/public/app/panels/singlestat/module.js @@ -171,12 +171,6 @@ function (angular, app, _, kbn, TimeSeries, PanelMeta) { $scope.render = function() { var data = {}; - if($scope.series.length > 1) { - $scope.appEvent('alert-warning', ['Multiple Series Error', 'Metric query returns ' + - $scope.series.length + ' series. Single Stat Panel expects a single series.']); - $scope.series = []; - } - $scope.setValues(data); data.thresholds = $scope.panel.thresholds.split(',').map(function(strVale) { @@ -191,6 +185,15 @@ function (angular, app, _, kbn, TimeSeries, PanelMeta) { $scope.setValues = function(data) { data.flotpairs = []; + + if($scope.series.length > 1) { + $scope.inspector.error = new Error(); + $scope.inspector.error.message = 'Multiple Series Error'; + $scope.inspector.error.data = 'Metric query returns ' + $scope.series.length + + ' series. Single Stat Panel expects a single series.\n\nResponse:\n'+JSON.stringify($scope.series); + throw $scope.inspector.error; + } + if ($scope.series && $scope.series.length > 0) { var lastPoint = _.last($scope.series[0].datapoints); var lastValue = _.isArray(lastPoint) ? lastPoint[0] : null; From 57dee76c8829ddd8ddd7ab33e5537f10342517a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sun, 27 Sep 2015 12:09:12 +0200 Subject: [PATCH 4/6] feat(elasticsearch): templating terms query should have size set to zero to return all terms, fixes #2827 --- public/app/plugins/datasource/elasticsearch/queryBuilder.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/app/plugins/datasource/elasticsearch/queryBuilder.js b/public/app/plugins/datasource/elasticsearch/queryBuilder.js index 6a639e2db8d..ac61fe13a1e 100644 --- a/public/app/plugins/datasource/elasticsearch/queryBuilder.js +++ b/public/app/plugins/datasource/elasticsearch/queryBuilder.js @@ -174,6 +174,7 @@ function (angular) { "1": { "terms": { "field": queryDef.field, + "size": 0, "order": { "_term": "asc" } From a567939f78e7eac8fd650f28913042818a652ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 28 Sep 2015 11:28:08 +0200 Subject: [PATCH 5/6] fix(elasticsearch): quote variable value in lucene variable mulit format, fixes #2828 --- public/app/features/templating/templateSrv.js | 5 ++++- public/app/features/templating/templateValuesSrv.js | 5 ++++- public/test/specs/templateSrv-specs.js | 2 +- public/test/specs/templateValuesSrv-specs.js | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/app/features/templating/templateSrv.js b/public/app/features/templating/templateSrv.js index 48aa4edde85..9a59510c6a4 100644 --- a/public/app/features/templating/templateSrv.js +++ b/public/app/features/templating/templateSrv.js @@ -44,7 +44,10 @@ function (angular, _) { return '(' + value.join('|') + ')'; } case "lucene": { - return '(' + value.join(' OR ') + ')'; + var quotedValues = _.map(value, function(val) { + return '\\\"' + val + '\\\"'; + }); + return '(' + quotedValues.join(' OR ') + ')'; } case "pipe": { return value.join('|'); diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index 5ec9ae85e4a..18216fabd0f 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -262,7 +262,10 @@ function (angular, _, kbn) { break; } case 'lucene': { - allValue = '(' + _.pluck(variable.options, 'text').join(' OR ') + ')'; + var quotedValues = _.map(variable.options, function(val) { + return '\\\"' + val.text + '\\\"'; + }); + allValue = '(' + quotedValues.join(' OR ') + ')'; break; } case 'regex values': { diff --git a/public/test/specs/templateSrv-specs.js b/public/test/specs/templateSrv-specs.js index 36f303e55c6..2b811244210 100644 --- a/public/test/specs/templateSrv-specs.js +++ b/public/test/specs/templateSrv-specs.js @@ -68,7 +68,7 @@ define([ value: ['test','test2'], } }); - expect(result).to.be('(test OR test2)'); + expect(result).to.be('(\\\"test\\\" OR \\\"test2\\\")'); }); it('multi value and regex format should render regex string', function() { diff --git a/public/test/specs/templateValuesSrv-specs.js b/public/test/specs/templateValuesSrv-specs.js index 4c5b7e19a69..e1e6fc347cb 100644 --- a/public/test/specs/templateValuesSrv-specs.js +++ b/public/test/specs/templateValuesSrv-specs.js @@ -321,7 +321,7 @@ define([ }); it('should add lucene glob', function() { - expect(scenario.variable.options[0].value).to.be('(backend1 OR backend2)'); + expect(scenario.variable.options[0].value).to.be('(\\\"backend1\\\" OR \\\"backend2\\\")'); }); }); From cb7424ce5e5c390e988a0d5065c43a2732857d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 28 Sep 2015 11:53:49 +0200 Subject: [PATCH 6/6] fix(playlist ui): minor polish / fix to playlist ui, fixes #2831, other minor css / markup fixes --- public/app/panels/graph/axisEditor.html | 67 +++++++------------------ public/app/partials/playlist.html | 16 +++--- public/less/variables.dark.less | 2 +- public/less/variables.light.less | 2 +- 4 files changed, 28 insertions(+), 59 deletions(-) diff --git a/public/app/panels/graph/axisEditor.html b/public/app/panels/graph/axisEditor.html index d161330f5c0..41ea8dd3696 100644 --- a/public/app/panels/graph/axisEditor.html +++ b/public/app/panels/graph/axisEditor.html @@ -4,7 +4,7 @@
  • - Left Y + Left Y
  • Unit @@ -46,10 +46,10 @@
-
+
  • - Right Y + Right Y
  • Unit @@ -97,7 +97,7 @@
    • - Show Axis + Show Axis
    • X-Axis  @@ -114,10 +114,10 @@
    -
    +
    • - Thresholds + Thresholds
    • Level 1 @@ -140,11 +140,7 @@
    • - Line mode  - - - +
    @@ -157,31 +153,19 @@
    • - Legend + Legend
    • - Show  - - +
    • - Table  - - +
    • - Right side  - - +
    • - Hide empty  - - +
    @@ -191,37 +175,22 @@
    • - Legend values + Legend values
    • - Min  - - +
    • - Max  - - +
    • - Avg  - - +
    • - Current  - - +
    • - Total  - - +
    diff --git a/public/app/partials/playlist.html b/public/app/partials/playlist.html index 664faf10837..3d12e5af2d6 100644 --- a/public/app/partials/playlist.html +++ b/public/app/partials/playlist.html @@ -12,10 +12,10 @@
    -
    -
    +
    +
    -
    +
    • Search @@ -28,13 +28,11 @@
    -
    -
    Playlist dashboards
    -
    -
    +
    +
    Search result
    @@ -55,6 +53,8 @@
    +
    Playlist dashboards
    +
    @@ -78,7 +78,7 @@

    -
    +
    • Timespan between dashboard change diff --git a/public/less/variables.dark.less b/public/less/variables.dark.less index 708b5ad299a..3324c3f4b86 100644 --- a/public/less/variables.dark.less +++ b/public/less/variables.dark.less @@ -68,7 +68,7 @@ @altFontFamily: @serifFontFamily; @headingsFontFamily: inherit; // empty to use BS default, @baseFontFamily -@headingsFontWeight: normal; // instead of browser default, bold +@headingsFontWeight: bold; // instead of browser default, bold @headingsColor: darken(@white,11%); // empty to use BS default, @textColor @inputText: @black; diff --git a/public/less/variables.light.less b/public/less/variables.light.less index 174a4529395..27dcf8575f4 100644 --- a/public/less/variables.light.less +++ b/public/less/variables.light.less @@ -80,7 +80,7 @@ @altFontFamily: @serifFontFamily; @headingsFontFamily: inherit; // empty to use BS default, @baseFontFamily -@headingsFontWeight: normal; // instead of browser default, bold +@headingsFontWeight: bold; // instead of browser default, bold @headingsColor: @textColor; // empty to use BS default, @textColor