-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathtypes.ts
More file actions
62 lines (55 loc) · 1.33 KB
/
types.ts
File metadata and controls
62 lines (55 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { DataQuery, DataSourceJsonData, VariableModel } from '@grafana/data';
export interface MyQuery extends DataQuery {
queryText: string;
dataPath: string;
timePath: string;
endTimePath: string | null;
timeFormat: string | null;
groupBy: string;
aliasBy: string;
annotationTitle: string;
annotationText: string;
annotationTags: string;
constant: number;
}
export const defaultQuery: Partial<MyQuery> = {
queryText: `query {
data:submissions(user:"$user"){
Time:submitTime
idle running completed
}
}`,
dataPath: 'data',
timePath: 'Time',
endTimePath: 'endTime',
timeFormat: null,
groupBy: '', // `identifier`
aliasBy: '', // 'Server [[tag_identifier]]`
annotationTitle: '',
annotationText: '',
annotationTags: '',
constant: 6.5,
};
/**
* These are options configured for each DataSource instance
*/
export interface MyDataSourceOptions extends DataSourceJsonData {
apiKey?: string;
}
export interface MyVariableQuery extends DataQuery {
dataPath: string;
queryText: string;
}
export interface TextValuePair {
text: string;
value: any;
}
export interface MultiValueVariable extends VariableModel {
allValue: string | null;
id: string;
current: TextValuePair;
options: TextValuePair[];
}
export interface RequestFactory {
request(data: string): Promise<any>;
}