Просмотр исходного кода

Requested Backend changes, removed link in popover description for the offset field

Mattia Rossi 7 лет назад
Родитель
Сommit
ce74b1ddc2

+ 3 - 2
pkg/tsdb/elasticsearch/time_series_query.go

@@ -134,9 +134,10 @@ func addDateHistogramAgg(aggBuilder es.AggBuilder, bucketAgg *BucketAgg, timeFro
 			a.Interval = "$__interval"
 		}
 
-		if bucketAgg.Settings.Get("offset").MustString("") != "" {
-			a.Offset = bucketAgg.Settings.Get("offset").MustString("")
+		if offset, err := bucketAgg.Settings.Get("offset").String(); err == nil {
+			a.Offset = offset
 		}
+
 		if missing, err := bucketAgg.Settings.Get("missing").String(); err == nil {
 			a.Missing = &missing
 		}

+ 1 - 2
public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html

@@ -74,8 +74,7 @@
 			<label class="gf-form-label width-10">
 				Offset
 				<info-popover mode="right-normal">
-					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
+					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
 				</info-popover>
 			</label>
 			<input class="gf-form-input max-width-12" type="text" ng-model="agg.settings.offset" ng-change="onChangeInternal()">