generated from grafana/grafana-starter-datasource-backend
-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathselectors.ts
169 lines (169 loc) · 5.31 KB
/
selectors.ts
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
import { E2ESelectors } from '@grafana/e2e-selectors';
export const Components = {
QueryEditor: {
CodeEditor: {
input: () => '.monaco-editor textarea',
container: 'data-testid-code-editor-container',
Expand: 'data-testid-code-editor-expand-button',
},
Format: {
label: 'Format',
tooltip: 'Query Type',
options: {
AUTO: 'Auto',
TABLE: 'Table',
TIME_SERIES: 'Time Series',
LOGS: 'Logs',
TRACE: 'Trace',
},
},
Types: {
label: 'Query Type',
tooltip: 'Query Type',
options: {
SQLEditor: 'SQL Editor',
QueryBuilder: 'Query Builder',
},
switcher: {
title: 'Are you sure?',
body: 'Queries that are too complex for the Query Builder will be altered.',
confirmText: 'Continue',
dismissText: 'Cancel',
},
cannotConvert: {
title: 'Cannot convert',
confirmText: 'Yes',
},
},
QueryBuilder: {
TYPES: {
label: 'Show as',
tooltip: 'Show as',
options: {
LIST: 'Table',
AGGREGATE: 'Aggregate',
TREND: 'Time Series',
},
},
DATABASE: {
label: 'Database',
tooltip: 'Clickhouse database to query from',
},
FROM: {
label: 'Table',
tooltip: 'Clickhouse table to query from',
},
SELECT: {
label: 'Fields',
tooltipTable: 'List of fields to show',
tooltipAggregate: `List of metrics to show. Use any of the given aggregation along with the field`,
ALIAS: {
label: 'as',
tooltip: 'alias',
},
AddLabel: 'Field',
RemoveLabel: '',
},
AGGREGATES: {
label: 'Aggregates',
tooltipTable: 'Aggregate functions to use',
tooltipAggregate: `Aggregate functions to use`,
ALIAS: {
label: 'as',
tooltip: 'alias',
},
AddLabel: 'Aggregate',
RemoveLabel: '',
},
WHERE: {
label: 'Filters',
tooltip: `List of filters`,
AddLabel: 'Filter',
RemoveLabel: '',
},
GROUP_BY: {
label: 'Group by',
tooltip: 'Group the results by specific field',
},
ORDER_BY: {
label: 'Order by',
tooltip: 'Order by field',
AddLabel: 'Order by',
RemoveLabel: '',
},
LIMIT: {
label: 'Limit',
tooltip: 'Number of records/results to show.',
},
TIME_FIELD: {
label: 'Time field',
tooltip: 'Select the time field for trending over time',
},
LOGS_VOLUME_TIME_FIELD: {
label: 'Time field',
tooltip: 'Select the time field for logs volume histogram. If not selected, the histogram will not be shown',
},
LOG_LEVEL_FIELD: {
label: 'Log level field',
tooltip: 'Select the field to extract log level information from',
},
PREVIEW: {
label: 'SQL Preview',
tooltip: 'SQL Preview. You can safely switch to SQL Editor to customize the generated query',
},
},
},
Config: {
HttpHeaderConfig: {
headerEditor: 'config__http-header-config__header-editor',
addHeaderButton: 'config__http-header-config__add-header-button',
removeHeaderButton: 'config__http-header-config__remove-header-button',
headerSecureSwitch: 'config__http-header-config__header-secure-switch',
headerNameInput: 'config__http-header-config__header-name-input',
headerValueInput: 'config__http-header-config__header-value-input',
forwardGrafanaHeadersSwitch: 'config__http-header-config__forward-grafana-headers-switch'
},
AliasTableConfig: {
aliasEditor: 'config__alias-table-config__alias-editor',
addEntryButton: 'config__alias-table-config__add-entry-button',
removeEntryButton: 'config__alias-table-config__remove-entry-button',
targetDatabaseInput: 'config__alias-table-config__target-database-input',
targetTableInput: 'config__alias-table-config__target-table-input',
aliasDatabaseInput: 'config__alias-table-config__alias-database-input',
aliasTableInput: 'config__alias-table-config__alias-table-input',
}
},
LogsContextPanel: {
alert: 'logs-context-panel__alert',
LogsContextKey: 'logs-context-panel__logs-context-key',
},
QueryBuilder: {
expandBuilderButton: 'query-builder__expand-builder-button',
LogsQueryBuilder: {
LogMessageLikeInput: {
input: 'query-builder__logs-query-builder__log-message-like-input__input',
}
},
AggregateEditor: {
sectionLabel: 'query-builder__aggregate-editor__section-label',
itemWrapper: 'query-builder__aggregate-editor__item-wrapper',
itemRemoveButton: 'query-builder__aggregate-editor-item-remove-button',
addButton: 'query-builder__aggregate-editor__add-button',
},
ColumnsEditor: {
multiSelectWrapper: 'query-builder__columns-editor__multi-select-wrapper'
},
GroupByEditor: {
multiSelectWrapper: 'query-builder__group-by__multi-select-wrapper'
},
LimitEditor: {
input: 'query-builder__limit-editor__input'
},
TraceIdInput: {
input: 'query-builder__trace-id-input__input'
}
}
};
export const selectors: { components: E2ESelectors<typeof Components> } = {
components: Components,
};