diff --git a/public/app/core/directives/value_select_dropdown.js b/public/app/core/directives/value_select_dropdown.js index 656804a72d3..e6e2a709a1a 100644 --- a/public/app/core/directives/value_select_dropdown.js +++ b/public/app/core/directives/value_select_dropdown.js @@ -179,11 +179,6 @@ function (angular, _, coreModule) { vm.variable.current.text = _.pluck(vm.selectedValues, 'text').join(' + '); vm.variable.current.tags = vm.selectedTags; - // only single value - if (vm.selectedValues.length === 1) { - vm.variable.current.value = vm.selectedValues[0].value; - } - if (commitChange) { vm.commitChanges(); } diff --git a/public/app/features/templating/partials/editor.html b/public/app/features/templating/partials/editor.html index aab5f048465..78132a1d04a 100644 --- a/public/app/features/templating/partials/editor.html +++ b/public/app/features/templating/partials/editor.html @@ -79,7 +79,7 @@
- Type + Type
@@ -97,8 +97,9 @@
- - + Hide + +
@@ -133,14 +134,9 @@
+ Include All option + - -
-
- All format -
- -
@@ -158,20 +154,9 @@
All value +
-
-
- All format -
- -
-
-
- All value - -
-
Update diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index 2760bb42ca0..517a69f4a6a 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -108,7 +108,6 @@ function (angular, _, kbn) { if (variable.type === 'custom' && variable.includeAll) { self.addAllOption(variable); } - }; this.updateOptions = function(variable) { @@ -245,41 +244,42 @@ function (angular, _, kbn) { }; this.addAllOption = function(variable) { - var allValue = ''; - switch(variable.allFormat) { - case 'wildcard': { - allValue = '*'; - break; - } - case 'regex wildcard': { - allValue = '.*'; - break; - } - case 'lucene': { - var quotedValues = _.map(variable.options, function(val) { - return '\\\"' + val.text + '\\\"'; - }); - allValue = '(' + quotedValues.join(' OR ') + ')'; - break; - } - case 'regex values': { - allValue = '(' + _.map(variable.options, function(option) { - return self.regexEscape(option.text); - }).join('|') + ')'; - break; - } - case 'pipe': { - allValue = _.pluck(variable.options, 'text').join('|'); - break; - } - default: { - allValue = '{'; - allValue += _.pluck(variable.options, 'text').join(','); - allValue += '}'; - } - } - - variable.options.unshift({text: 'All', value: allValue}); + // var allValue = ''; + // switch(variable.allFormat) { + // case 'wildcard': { + // allValue = '*'; + // break; + // } + // case 'regex wildcard': { + // allValue = '.*'; + // break; + // } + // case 'lucene': { + // var quotedValues = _.map(variable.options, function(val) { + // return '\\\"' + val.text + '\\\"'; + // }); + // allValue = '(' + quotedValues.join(' OR ') + ')'; + // break; + // } + // case 'regex values': { + // allValue = '(' + _.map(variable.options, function(option) { + // return self.regexEscape(option.text); + // }).join('|') + ')'; + // break; + // } + // case 'pipe': { + // allValue = _.pluck(variable.options, 'text').join('|'); + // break; + // } + // default: { + // allValue = '{'; + // allValue += _.pluck(variable.options, 'text').join(','); + // allValue += '}'; + // } + // } + // + var value =_.pluck(variable.options, 'text'); + variable.options.unshift({text: 'All', value: value}); }; }); diff --git a/public/app/plugins/datasource/elasticsearch/datasource.js b/public/app/plugins/datasource/elasticsearch/datasource.js index 294f666abc7..cc721de32ff 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.js +++ b/public/app/plugins/datasource/elasticsearch/datasource.js @@ -190,7 +190,7 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes payload = payload.replace(/\$interval/g, options.interval); payload = payload.replace(/\$timeFrom/g, options.range.from.valueOf()); payload = payload.replace(/\$timeTo/g, options.range.to.valueOf()); - payload = templateSrv.replace(payload, options.scopedVars); + payload = templateSrv.replace(payload, options.scopedVars, 'lucene'); return this._post('_msearch', payload).then(function(res) { return new ElasticResponse(sentTargets, res).getTimeSeries();