Requested Backend changes, added details to popover description for the offset field

This commit is contained in:
Mattia Rossi
2018-11-26 08:58:25 -05:00
parent 9825484176
commit f6fc7f7b64
4 changed files with 10 additions and 2 deletions

View File

@@ -74,7 +74,8 @@
<label class="gf-form-label width-10">
Offset
<info-popover mode="right-normal">
Interval Offset
Change the start value of each bucket by the specified positive (+) or negative offset (-) duration, such as 1h for an hour, or 1d for a day,
see https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#time-units for further details
</info-popover>
</label>
<input class="gf-form-input max-width-12" type="text" ng-model="agg.settings.offset" ng-change="onChangeInternal()">

View File

@@ -71,7 +71,10 @@ export class ElasticQueryBuilder {
esAgg.min_doc_count = settings.min_doc_count || 0;
esAgg.extended_bounds = { min: '$timeFrom', max: '$timeTo' };
esAgg.format = 'epoch_millis';
esAgg.offset = settings.offset || '0';
if (settings.offset !== '') {
esAgg.offset = settings.offset;
}
if (esAgg.interval === 'auto') {
esAgg.interval = '$__interval';