mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Datasource/Influx: Fixes issue where toggling editor mode would cause error (#25660)
Closes #25659
This commit is contained in:
parent
5b5b247cb1
commit
1479786fb8
@ -248,14 +248,13 @@ export class InfluxQueryCtrl extends QueryCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleEditorMode() {
|
toggleEditorMode() {
|
||||||
console.log('Toggle influx edit mode:', this.target);
|
|
||||||
try {
|
try {
|
||||||
this.target.query = this.queryModel.render(false);
|
this.target.query = this.queryModel.render(false);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('query render error');
|
console.log('query render error');
|
||||||
}
|
}
|
||||||
const { queryType } = this.target;
|
const { queryType } = this.target;
|
||||||
if (queryType === InfluxQueryType.Flux || queryType === queryType.InfluxQL) {
|
if (queryType === InfluxQueryType.Flux || queryType === InfluxQueryType.InfluxQL) {
|
||||||
this.target.queryType = InfluxQueryType.Classic;
|
this.target.queryType = InfluxQueryType.Classic;
|
||||||
this.target.rawQuery = false;
|
this.target.rawQuery = false;
|
||||||
} else if (this.datasource.enableFlux) {
|
} else if (this.datasource.enableFlux) {
|
||||||
|
Loading…
Reference in New Issue
Block a user