Skip to content

Commit 28e7f0f

Browse files
committed
Merge branch 'felixbarny-global_interval'
2 parents e498503 + 80d757b commit 28e7f0f

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

public/app/features/panel/panel_helper.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ function (angular, _, $, kbn, dateMath, rangeUtil) {
5959
scope.resolution = Math.ceil($(window).width() * (scope.panel.span / 12));
6060
}
6161

62-
scope.interval = kbn.calculateInterval(scope.range, scope.resolution, scope.panel.interval);
62+
var panelInterval = scope.panel.interval;
63+
var datasourceInterval = (scope.datasource || {}).interval;
64+
scope.interval = kbn.calculateInterval(scope.range, scope.resolution, panelInterval || datasourceInterval);
6365
};
6466

6567
this.applyPanelTimeOverrides = function(scope) {

public/app/plugins/datasource/elasticsearch/datasource.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
2626
this.timeField = datasource.jsonData.timeField;
2727
this.esVersion = datasource.jsonData.esVersion;
2828
this.indexPattern = new IndexPattern(datasource.index, datasource.jsonData.interval);
29+
this.interval = datasource.jsonData.timeInterval;
2930
this.queryBuilder = new ElasticQueryBuilder({
3031
timeField: this.timeField,
3132
esVersion: this.esVersion,

public/app/plugins/datasource/elasticsearch/partials/config.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,22 @@ <h5>Elasticsearch details</h5>
4242
</ul>
4343
<div class="clearfix"></div>
4444
</div>
45+
</div>
46+
47+
<h5>Default query settings</h5>
48+
49+
<div class="tight-form last">
50+
<ul class="tight-form-list">
51+
<li class="tight-form-item" style="width: 200px">
52+
Group by time interval
53+
</li>
54+
<li>
55+
<input type="text" class="input-medium tight-form-input input-xlarge" ng-model="current.jsonData.timeInterval"
56+
spellcheck='false' placeholder="example: >10s">
57+
</li>
58+
<li class="tight-form-item">
59+
<i class="fa fa-question-circle" bs-tooltip="'Set a low limit by having a greater sign: example: >10s'" data-placement="right"></i>
60+
</li>
61+
</ul>
62+
<div class="clearfix"></div>
63+
</div>

0 commit comments

Comments
 (0)