utils.ts 385 B

12345678910
  1. import { SelectableValue } from '@grafana/data';
  2. import { CloudWatchDatasource } from './../datasource';
  3. export const toOption = (value: string) => ({ label: value, value });
  4. export const appendTemplateVariables = (datasource: CloudWatchDatasource, values: SelectableValue[]) => [
  5. ...values,
  6. { label: 'Template Variables', options: datasource.getVariables().map(toOption) },
  7. ];