@@ -82,21 +82,11 @@ <h5 class="section-heading">Variable</h5>
82
82
< span class ="gf-form-label width-6 ">
83
83
Type
84
84
< info-popover mode ="right-normal ">
85
- < dl >
86
- < dt > Query</ dt >
87
- < dd > Variable values are fetched from a metric names query to a data source</ dd >
88
- < dt > Interval</ dt >
89
- < dd > Timespan variable type</ dd >
90
- < dt > Datasource</ dt >
91
- < dd > Dynamically switch data sources using this type of variable</ dd >
92
- < dt > Custom</ dt >
93
- < dd > Define variable values manually</ dd >
94
- </ dl >
95
- < a href ="http://docs.grafana.org/reference/templating " target ="_blank "> Templating docs</ a >
85
+ {{variableTypes[current.type].description}}
96
86
</ info-popover >
97
87
</ span >
98
88
< div class ="gf-form-select-wrapper max-width-17 ">
99
- < select class ="gf-form-input " ng-model ="current.type " ng-options ="f.value as f.text for f in variableTypes " ng-change ="typeChanged() "> </ select >
89
+ < select class ="gf-form-input " ng-model ="current.type " ng-options ="k as v.name for (k, v) in variableTypes " ng-change ="typeChanged() "> </ select >
100
90
</ div >
101
91
</ div >
102
92
</ div >
@@ -215,85 +205,85 @@ <h5 class="section-heading">Data source options</h5>
215
205
< label class ="gf-form-label width-12 "> Type</ label >
216
206
< div class ="gf-form-select-wrapper max-width-18 ">
217
207
< select class ="gf-form-input " ng-model ="current.query " ng-options ="f.value as f.text for f in datasourceTypes " ng-change ="runQuery() "> </ select >
218
- </ div >
219
- </ div >
208
+ </ div >
209
+ </ div >
220
210
221
- < div class ="gf-form ">
222
- < label class ="gf-form-label width-12 ">
223
- Instance name filter
224
- < info-popover mode ="right-normal ">
225
- Regex filter for which data source instances to choose from in
226
- the variable value dropdown. Leave empty for all.
227
- < br > < br >
228
- Example: < code > /^prod/</ code >
211
+ < div class ="gf-form ">
212
+ < label class ="gf-form-label width-12 ">
213
+ Instance name filter
214
+ < info-popover mode ="right-normal ">
215
+ Regex filter for which data source instances to choose from in
216
+ the variable value dropdown. Leave empty for all.
217
+ < br > < br >
218
+ Example: < code > /^prod/</ code >
229
219
230
- </ info-popover >
231
- </ label >
232
- < input type ="text " class ="gf-form-input max-width-18 " ng-model ='current.regex ' placeholder ="/.*-(.*)-.*/ " ng-model-onblur ng-change ="runQuery() "> </ input >
233
- </ div >
234
- </ div >
220
+ </ info-popover >
221
+ </ label >
222
+ < input type ="text " class ="gf-form-input max-width-18 " ng-model ='current.regex ' placeholder ="/.*-(.*)-.*/ " ng-model-onblur ng-change ="runQuery() "> </ input >
223
+ </ div >
224
+ </ div >
235
225
236
226
< div ng-show ="current.type === 'adhoc' " class ="gf-form-group ">
237
- < h5 class ="section-heading "> Options</ h5 >
227
+ < h5 class ="section-heading "> Options</ h5 >
238
228
239
229
< div class ="gf-form max-width-21 ">
240
230
< span class ="gf-form-label width-8 "> Data source</ span >
241
231
< div class ="gf-form-select-wrapper max-width-14 ">
242
232
< select class ="gf-form-input " ng-model ="current.datasource " ng-options ="f.value as f.name for f in datasources "> </ select >
243
233
</ div >
244
234
</ div >
245
- </ div >
235
+ </ div >
246
236
247
- < div class ="section gf-form-group " ng-show ="current.supportsMulti ">
248
- < h5 class ="section-heading "> Selection Options</ h5 >
249
- < div class ="section ">
250
- < gf-form-switch class ="gf-form "
251
- label ="Multi-value "
252
- label-class ="width-10 "
253
- tooltip ="Enables multiple values to be selected at the same time "
254
- checked ="current.multi "
255
- on-change ="runQuery() ">
256
- </ gf-form-switch >
257
- < gf-form-switch class ="gf-form "
258
- label ="Include All option "
259
- label-class ="width-10 "
260
- checked ="current.includeAll "
261
- on-change ="runQuery() ">
262
- </ gf-form-switch >
263
- </ div >
264
- < div class ="gf-form " ng-if ="current.includeAll ">
265
- < span class ="gf-form-label width-10 "> Custom all value</ span >
266
- < input type ="text " class ="gf-form-input max-width-15 " ng-model ='current.allValue ' placeholder ="blank = auto "> </ input >
267
- </ div >
268
- </ div >
237
+ < div class ="section gf-form-group " ng-show ="variableTypes[ current.type] .supportsMulti ">
238
+ < h5 class ="section-heading "> Selection Options</ h5 >
239
+ < div class ="section ">
240
+ < gf-form-switch class ="gf-form "
241
+ label ="Multi-value "
242
+ label-class ="width-10 "
243
+ tooltip ="Enables multiple values to be selected at the same time "
244
+ checked ="current.multi "
245
+ on-change ="runQuery() ">
246
+ </ gf-form-switch >
247
+ < gf-form-switch class ="gf-form "
248
+ label ="Include All option "
249
+ label-class ="width-10 "
250
+ checked ="current.includeAll "
251
+ on-change ="runQuery() ">
252
+ </ gf-form-switch >
253
+ </ div >
254
+ < div class ="gf-form " ng-if ="current.includeAll ">
255
+ < span class ="gf-form-label width-10 "> Custom all value</ span >
256
+ < input type ="text " class ="gf-form-input max-width-15 " ng-model ='current.allValue ' placeholder ="blank = auto "> </ input >
257
+ </ div >
258
+ </ div >
269
259
270
- < div class ="gf-form-group " ng-if ="current.type === 'query' ">
271
- < h5 > Value groups/tags (Experimental feature)</ h5 >
272
- < div class ="gf-form ">
273
- < editor-checkbox text ="Enable " model ="current.useTags " change ="runQuery() "> </ editor-checkbox >
274
- </ div >
275
- < div class ="gf-form last " ng-if ="current.useTags ">
276
- < span class ="gf-form-label width-10 "> Tags query</ span >
277
- < input type ="text " class ="gf-form-input " ng-model ='current.tagsQuery ' placeholder ="metric name or tags query " ng-model-onblur > </ input >
278
- </ div >
279
- < div class ="gf-form " ng-if ="current.useTags ">
280
- < li class ="gf-form-label width-10 "> Tag values query</ li >
281
- < input type ="text " class ="gf-form-input " ng-model ='current.tagValuesQuery ' placeholder ="apps.$tag.* " ng-model-onblur > </ input >
282
- </ div >
283
- </ div >
260
+ < div class ="gf-form-group " ng-if ="current.type === 'query' ">
261
+ < h5 > Value groups/tags (Experimental feature)</ h5 >
262
+ < div class ="gf-form ">
263
+ < editor-checkbox text ="Enable " model ="current.useTags " change ="runQuery() "> </ editor-checkbox >
264
+ </ div >
265
+ < div class ="gf-form last " ng-if ="current.useTags ">
266
+ < span class ="gf-form-label width-10 "> Tags query</ span >
267
+ < input type ="text " class ="gf-form-input " ng-model ='current.tagsQuery ' placeholder ="metric name or tags query " ng-model-onblur > </ input >
268
+ </ div >
269
+ < div class ="gf-form " ng-if ="current.useTags ">
270
+ < li class ="gf-form-label width-10 "> Tag values query</ li >
271
+ < input type ="text " class ="gf-form-input " ng-model ='current.tagValuesQuery ' placeholder ="apps.$tag.* " ng-model-onblur > </ input >
272
+ </ div >
273
+ </ div >
284
274
285
- < div class ="gf-form-group ">
286
- < h5 > Preview of values (shows max 20)</ h5 >
287
- < div class ="gf-form-inline ">
288
- < div class ="gf-form " ng-repeat ="option in current.options | limitTo: 20 ">
289
- < span class ="gf-form-label "> {{option.text}}</ span >
290
- </ div >
291
- </ div >
292
- </ div >
293
- </ div >
275
+ < div class ="gf-form-group ">
276
+ < h5 > Preview of values (shows max 20)</ h5 >
277
+ < div class ="gf-form-inline ">
278
+ < div class ="gf-form " ng-repeat ="option in current.options | limitTo: 20 ">
279
+ < span class ="gf-form-label "> {{option.text}}</ span >
280
+ </ div >
281
+ </ div >
282
+ </ div >
283
+ </ div >
294
284
295
- < div class ="gf-form-button-row p-y-0 ">
296
- < button type ="button " class ="btn btn-success " ng-show ="mode === 'edit' " ng-click ="update(); "> Update</ button >
285
+ < div class ="gf-form-button-row p-y-0 ">
286
+ < button type ="button " class ="btn btn-success " ng-show ="mode === 'edit' " ng-click ="update(); "> Update</ button >
297
287
< button type ="button " class ="btn btn-success " ng-show ="mode === 'new' " ng-click ="add(); "> Add</ button >
298
288
</ div >
299
289
</ div >
0 commit comments