Exemplars: always query exemplars (#31673)

* Exemplars: always query exemplars

* Update exemplar button to be an eye

* Add tooltip to eye button
This commit is contained in:
Zoltán Bedi
2021-03-16 13:58:51 +01:00
committed by GitHub
parent ec95049a95
commit bb8a703428
8 changed files with 113 additions and 18 deletions

View File

@@ -41,7 +41,7 @@ export class PromQueryEditor extends PureComponent<Props, State> {
constructor(props: Props) {
super(props);
// Use default query to prevent undefined input values
const defaultQuery: Partial<PromQuery> = { expr: '', legendFormat: '', interval: '' };
const defaultQuery: Partial<PromQuery> = { expr: '', legendFormat: '', interval: '', exemplar: true };
const query = Object.assign({}, defaultQuery, props.query);
this.query = query;
// Query target properties that are fully controlled inputs
@@ -186,7 +186,7 @@ export class PromQueryEditor extends PureComponent<Props, State> {
</InlineFormLabel>
</div>
<PromExemplarField query={query} onChange={onChange} />
<PromExemplarField query={this.query} onChange={onChange} datasource={this.props.datasource} />
</div>
</div>
);