From c455b010780c157a7fd8d6d9f1b6af98fd1c028b Mon Sep 17 00:00:00 2001 From: Songhn Date: Thu, 22 Jun 2023 15:44:55 +0800 Subject: [PATCH] Dashboard: Update query group options (#63138) * Dashboard: update query group options * chore: remove unused `console` Co-authored-by: Dominik Prokop * fix: update placeholder Co-authored-by: Dominik Prokop * feat(QueryGroupOptions): add tooltip example values * feat(QueryGroupOptions): update interval tooltip * Update public/app/features/query/components/QueryGroupOptions.tsx Co-authored-by: Dominik Prokop * Update QueryGroupOptions.tsx --------- Co-authored-by: Dominik Prokop --- .../query/components/QueryGroupOptions.tsx | 39 +++++++++++++++---- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/public/app/features/query/components/QueryGroupOptions.tsx b/public/app/features/query/components/QueryGroupOptions.tsx index e73fdf31677..c450821d32b 100644 --- a/public/app/features/query/components/QueryGroupOptions.tsx +++ b/public/app/features/query/components/QueryGroupOptions.tsx @@ -2,7 +2,7 @@ import { css } from '@emotion/css'; import React, { PureComponent, ChangeEvent, FocusEvent } from 'react'; import { rangeUtil, PanelData, DataSourceApi } from '@grafana/data'; -import { Switch, Input, InlineField, InlineFormLabel, stylesFactory } from '@grafana/ui'; +import { Switch, Input, InlineFormLabel, stylesFactory } from '@grafana/ui'; import { QueryOperationRow } from 'app/core/components/QueryOperationRow/QueryOperationRow'; import { config } from 'app/core/config'; import { QueryGroupOptions } from 'app/types'; @@ -288,7 +288,8 @@ export class QueryGroupOptionsEditor extends PureComponent { tooltip={ <> The evaluated interval that is sent to data source and is used in $__interval and{' '} - $__interval_ms + $__interval_ms. This value is not exactly equal to{' '} + Time range / max data points, it will approximate a series of magic number. } > @@ -358,7 +359,19 @@ export class QueryGroupOptionsEditor extends PureComponent { {this.renderQueryCachingTTLOption()}
- Relative time + + Overrides the relative time range for individual panels, which causes them to be different than what is + selected in the dashboard time picker in the top-right corner of the dashboard. For example to configure + the Last 5 minutes the Relative time should be now-5m and 5m, or variables + like $_relativeTime. + + } + > + Relative time + {
- Time shift + + Overrides the time range for individual panels by shifting its start and end relative to the time + picker. For example to configure the Last 1h the Time shift should be now-1h and{' '} + 1h, or variables like $_timeShift. + + } + > + Time shift + { />
{(timeShift || relativeTime) && ( -
- - - +
+ Hide time info +
)}