mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
Co-authored-by: Torkel Ödegaard <torkel@grafana.com> Co-authored-by: Elfo404 <me@giordanoricci.com>
16 lines
488 B
TypeScript
16 lines
488 B
TypeScript
import { DataSourceRef } from '@grafana/data';
|
|
import { AdHocVariableFilter, AdHocVariableModel } from 'app/features/variables/types';
|
|
import { VariableBuilder } from './variableBuilder';
|
|
|
|
export class AdHocVariableBuilder extends VariableBuilder<AdHocVariableModel> {
|
|
withDatasource(datasource: DataSourceRef) {
|
|
this.variable.datasource = datasource;
|
|
return this;
|
|
}
|
|
|
|
withFilters(filters: AdHocVariableFilter[]) {
|
|
this.variable.filters = filters;
|
|
return this;
|
|
}
|
|
}
|