-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update variable support in Scenes dashboard (#79)
* Fix variable support in dashboard scene * Fix lint errors * Update version * Update minimum version --------- Co-authored-by: Mikhail Volkov <[email protected]>
- Loading branch information
1 parent
e1e0306
commit 8ee494f
Showing
9 changed files
with
41 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
import { DataSourceVariableSupport } from '@grafana/data'; | ||
import { CustomVariableSupport, DataQueryRequest, DataQueryResponse } from '@grafana/data'; | ||
import { from, Observable } from 'rxjs'; | ||
import { StaticQuery } from 'types'; | ||
|
||
import { QueryEditor } from '../components'; | ||
import { DataSource } from './datasource'; | ||
|
||
/** | ||
* Variable Support | ||
*/ | ||
export class VariableSupport extends DataSourceVariableSupport<DataSource, StaticQuery> { | ||
constructor() { | ||
export class VariableSupport extends CustomVariableSupport<DataSource, StaticQuery> { | ||
constructor(private readonly datasource: DataSource) { | ||
super(); | ||
} | ||
|
||
editor = QueryEditor; | ||
|
||
query(options: DataQueryRequest<StaticQuery>): Observable<DataQueryResponse> { | ||
return from(this.datasource.query(options)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters