Commit 9c35d3f8 by 田子宽

Add kibana like readable label to elasticsearch query builder

parent 4182acda
...@@ -96,6 +96,8 @@ ...@@ -96,6 +96,8 @@
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label width-10">Query {{$index + 1}}</label> <label class="gf-form-label width-10">Query {{$index + 1}}</label>
<input type="text" class="gf-form-input max-width-12" ng-model="filter.query" spellcheck='false' placeholder="Lucene query" ng-blur="onChangeInternal()"> <input type="text" class="gf-form-input max-width-12" ng-model="filter.query" spellcheck='false' placeholder="Lucene query" ng-blur="onChangeInternal()">
<label class="gf-form-label width-10">Label {{$index + 1}}</label>
<input type="text" class="gf-form-input max-width-12" ng-model="filter.label" spellcheck='false' placeholder="Readable Label" ng-blur="onChangeInternal()">
</div> </div>
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label" ng-if="$first"> <label class="gf-form-label" ng-if="$first">
......
...@@ -96,8 +96,9 @@ function (queryDef) { ...@@ -96,8 +96,9 @@ function (queryDef) {
var filterObj = {}; var filterObj = {};
for (var i = 0; i < aggDef.settings.filters.length; i++) { for (var i = 0; i < aggDef.settings.filters.length; i++) {
var query = aggDef.settings.filters[i].query; var query = aggDef.settings.filters[i].query;
var label = aggDef.settings.filters[i].label;
filterObj[query] = { label = label==='' || label === undefined?query:label;
filterObj[label] = {
query_string: { query_string: {
query: query, query: query,
analyze_wildcard: true analyze_wildcard: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment