123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- import { LoadingState, VariableType } from '@grafana/data';
- export const multiOptionVar = {
- allValue: null,
- current: {
- value: ['A'],
- text: ['A'],
- selected: true,
- },
- rootStateKey: 'key',
- datasource: 'gdev-testdata',
- definition: '*',
- hide: 0,
- includeAll: true,
- multi: true,
- name: 'datacenter',
- options: [
- {
- text: 'All',
- value: '$__all',
- selected: false,
- },
- {
- text: 'A',
- value: 'A',
- selected: true,
- },
- {
- text: 'B',
- value: 'B',
- selected: true,
- },
- {
- text: 'C',
- value: 'C',
- selected: false,
- },
- ],
- query: {
- refId: 'gdev-testdata-datacenter-Variable-Query',
- query: '*',
- },
- refresh: 1,
- regex: '',
- skipUrlSync: false,
- sort: 0,
- tagValuesQuery: '',
- tags: [],
- tagsQuery: '',
- type: 'query' as VariableType,
- useTags: false,
- id: 'datacenter',
- global: false,
- index: 0,
- state: LoadingState.Done,
- error: null,
- description: null,
- };
- export const multiOptionAllSelectedVar = {
- allValue: null,
- current: {
- value: ['$__all'],
- text: ['All'],
- selected: true,
- },
- rootStateKey: 'key',
- datasource: 'gdev-testdata',
- definition: '$datacenter.$server.*',
- hide: 0,
- includeAll: true,
- multi: true,
- name: 'pod',
- options: [
- {
- text: 'All',
- value: '$__all',
- selected: true,
- },
- {
- text: 'AAA',
- value: 'AAA',
- selected: false,
- },
- {
- text: 'AAB',
- value: 'AAB',
- selected: false,
- },
- {
- text: 'AAC',
- value: 'AAC',
- selected: false,
- },
- ],
- query: {
- refId: 'gdev-testdata-pod-Variable-Query',
- query: '$datacenter.$server.*',
- },
- refresh: 1,
- regex: '',
- skipUrlSync: false,
- sort: 0,
- tagValuesQuery: '',
- tags: [],
- tagsQuery: '',
- type: 'query' as VariableType,
- useTags: false,
- id: 'pod',
- global: false,
- index: 2,
- state: LoadingState.Done,
- error: null,
- description: null,
- };
- export const optionVar = {
- current: {
- text: 'gdev-postgres',
- value: 'gdev-postgres',
- selected: false,
- },
- description: null,
- error: null,
- hide: 0,
- includeAll: true,
- label: 'Datasource',
- multi: false,
- name: 'datasource',
- options: [
- {
- text: 'All',
- value: '$__all',
- selected: false,
- },
- {
- text: 'gdev-postgres',
- value: 'gdev-postgres',
- selected: true,
- },
- {
- text: 'gdev-postgres-ds-tests',
- value: 'gdev-postgres-ds-tests',
- selected: false,
- },
- {
- text: 'PostgreSQL',
- value: 'PostgreSQL',
- selected: false,
- },
- ],
- query: 'postgres',
- refresh: 1,
- regex: '',
- skipUrlSync: false,
- type: 'datasource' as VariableType,
- id: 'datasource',
- global: false,
- index: 3,
- state: LoadingState.Done,
- };
- export const textBoxVariable = {
- current: {
- selected: true,
- text: 'test',
- value: 'test',
- },
- rootStateKey: 'key',
- description: null,
- error: null,
- hide: 0,
- name: 'text',
- options: [
- {
- selected: true,
- text: 'test',
- value: 'test',
- },
- ],
- query: 'test',
- skipUrlSync: false,
- type: 'textbox' as VariableType,
- originalQuery: 'test',
- id: 'test',
- global: false,
- index: 1,
- state: LoadingState.Done,
- };
- export const adHocVariable = {
- datasource: 'PostgreSQL',
- description: null,
- error: null,
- filters: [],
- hide: 0,
- label: 'Ad hoc',
- name: 'adhoc',
- skipUrlSync: false,
- type: 'adhoc' as VariableType,
- id: 'adhoc',
- global: false,
- index: 5,
- state: LoadingState.Done,
- };
- export const customVariable = {
- allValue: null,
- current: {
- selected: true,
- tags: [],
- text: ['1', '2'],
- value: ['1', '2'],
- },
- rootStateKey: 'key',
- description: null,
- error: null,
- hide: 0,
- includeAll: true,
- multi: true,
- name: 'custom',
- options: [
- {
- selected: false,
- text: 'All',
- value: '$__all',
- },
- {
- selected: true,
- text: '1',
- value: '1',
- },
- {
- selected: true,
- text: '2',
- value: '2',
- },
- {
- selected: false,
- text: '3',
- value: 'three',
- },
- {
- selected: false,
- text: '4',
- value: 'four',
- },
- ],
- query: '1,2,3 : three, 4 : four',
- queryValue: '',
- skipUrlSync: false,
- type: 'custom' as VariableType,
- id: 'custom',
- global: false,
- index: 4,
- state: LoadingState.Done,
- };
- export const variables = [multiOptionAllSelectedVar, multiOptionVar, optionVar, textBoxVariable, customVariable];
|