adHocVariableBuilder.ts 489 B

12345678910111213141516
  1. import { DataSourceRef } from '@grafana/data';
  2. import { AdHocVariableFilter, AdHocVariableModel } from 'app/features/variables/types';
  3. import { VariableBuilder } from './variableBuilder';
  4. export class AdHocVariableBuilder extends VariableBuilder<AdHocVariableModel> {
  5. withDatasource(datasource: DataSourceRef) {
  6. this.variable.datasource = datasource;
  7. return this;
  8. }
  9. withFilters(filters: AdHocVariableFilter[]) {
  10. this.variable.filters = filters;
  11. return this;
  12. }
  13. }