|
|
@@ -75,39 +75,49 @@
|
|
|
<div class="gf-form-group">
|
|
|
<div class="gf-form-inline">
|
|
|
<div class="gf-form max-width-19">
|
|
|
- <span class="gf-form-label width-7">Name</span>
|
|
|
- <input type="text" class="gf-form-input max-width-12" placeholder="name" ng-model='current.name'></input>
|
|
|
- </div>
|
|
|
- <div class="gf-form">
|
|
|
- <span class="gf-form-label width-4">Type</span>
|
|
|
- <div class="gf-form-select-wrapper">
|
|
|
- <select class="gf-form-input width-7" ng-model="current.type" ng-options="f for f in ['query', 'interval', 'custom']" ng-change="typeChanged()"></select>
|
|
|
- </div>
|
|
|
+ <span class="gf-form-label width-6">Name</span>
|
|
|
+ <input type="text" class="gf-form-input" placeholder="name" ng-model='current.name'></input>
|
|
|
</div>
|
|
|
<div class="gf-form max-width-19">
|
|
|
- <span class="gf-form-label width-7" ng-show="current.type === 'query'">Data source</span>
|
|
|
- <div class="gf-form-select-wrapper max-width-12" ng-show="current.type === 'query'">
|
|
|
- <select class="gf-form-input" ng-model="current.datasource" ng-options="f.value as f.name for f in datasources"></select>
|
|
|
+ <span class="gf-form-label width-6">
|
|
|
+ Type
|
|
|
+ <info-popover mode="right-normal">
|
|
|
+ <dl>
|
|
|
+ <dt>Query</dt>
|
|
|
+ <dd>Variable values are fetched from a metric names query to a data source</dd>
|
|
|
+ <dt>Interval</dt>
|
|
|
+ <dd>Timespan variable type</dd>
|
|
|
+ <dt>Datasource</dt>
|
|
|
+ <dd>Dynamically switch data sources using this type of variable</dd>
|
|
|
+ <dt>Custom</dt>
|
|
|
+ <dd>Define variable values manually</dd>
|
|
|
+ </dl>
|
|
|
+ <a href="http://docs.grafana.org/reference/templating" target="_blank">Templating docs</a>
|
|
|
+ </info-popover>
|
|
|
+ </span>
|
|
|
+ <div class="gf-form-select-wrapper max-width-17">
|
|
|
+ <select class="gf-form-input" ng-model="current.type" ng-options="f.value as f.text for f in variableTypes" ng-change="typeChanged()"></select>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
<div class="gf-form-inline">
|
|
|
<div class="gf-form max-width-19">
|
|
|
- <span class="gf-form-label width-7">Label</span>
|
|
|
- <input type="text" class="gf-form-input max-width-12" ng-model='current.label' placeholder="optional display name"></input>
|
|
|
+ <span class="gf-form-label width-6">Label</span>
|
|
|
+ <input type="text" class="gf-form-input" ng-model='current.label' placeholder="optional display name"></input>
|
|
|
</div>
|
|
|
- <div class="gf-form">
|
|
|
- <span class="gf-form-label width-4">Hide</span>
|
|
|
- <div class="gf-form-select-wrapper">
|
|
|
- <select class="gf-form-input width-7" ng-model="current.hide" ng-options="f.value as f.text for f in hideOptions"></select>
|
|
|
+ <div class="gf-form max-width-19">
|
|
|
+ <span class="gf-form-label width-6">Hide</span>
|
|
|
+ <div class="gf-form-select-wrapper max-width-15">
|
|
|
+ <select class="gf-form-input" ng-model="current.hide" ng-options="f.value as f.text for f in hideOptions"></select>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
- <h5 class="section-heading">Value Options</h5>
|
|
|
<div ng-show="current.type === 'interval'" class="gf-form-group">
|
|
|
+ <h5 class="section-heading">Interval Options</h5>
|
|
|
+
|
|
|
<div class="gf-form">
|
|
|
<span class="gf-form-label width-9">Values</span>
|
|
|
<input type="text" class="gf-form-input" placeholder="name" ng-model='current.query' placeholder="1m,10m,1h,6h,1d,7d" ng-model-onblur ng-change="runQuery()"></input>
|
|
|
@@ -135,6 +145,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div ng-show="current.type === 'custom'" class="gf-form-group">
|
|
|
+ <h5 class="section-heading">Custom Options</h5>
|
|
|
<div class="gf-form">
|
|
|
<span class="gf-form-label width-13">Values seperated by comma</span>
|
|
|
<input type="text" class="gf-form-input" ng-model='current.query' ng-blur="runQuery()" placeholder="1, 10, 20, myvalue"></input>
|
|
|
@@ -142,43 +153,69 @@
|
|
|
</div>
|
|
|
|
|
|
<div ng-show="current.type === 'query'" class="gf-form-group">
|
|
|
- <div class="gf-form">
|
|
|
- <span class="gf-form-label width-7">Query</span>
|
|
|
- <input type="text" class="gf-form-input" ng-model='current.query' placeholder="metric name or tags query" ng-model-onblur ng-change="runQuery()"></input>
|
|
|
- <!-- <info-popover position="bottom center" wide="true"> -->
|
|
|
- <!-- Example queries: -->
|
|
|
- <!-- <ul> -->
|
|
|
- <!-- <li> -->
|
|
|
- <!-- <code>SHOW TAG VALUES WITH KEY = "hostname"</code> -->
|
|
|
- <!-- </li> -->
|
|
|
- <!-- <li> -->
|
|
|
- <!-- <code>SHOW TAG VALUES WITH KEY = "hostname"</code> -->
|
|
|
- <!-- </li> -->
|
|
|
- <!-- <li> -->
|
|
|
- <!-- <code>SHOW TAG VALUES WITH KEY = "hostname"</code> -->
|
|
|
- <!-- </li> -->
|
|
|
- <!-- <li> -->
|
|
|
- <!-- <a href="http://docs.grafana.org" target="_blank">Templating docs</a> -->
|
|
|
- <!-- </li> -->
|
|
|
- <!-- </ul> -->
|
|
|
- <!-- </info-popover> -->
|
|
|
- </div>
|
|
|
- <div class="gf-form">
|
|
|
- <span class="gf-form-label width-7">
|
|
|
- Regex
|
|
|
- <tip>Optional, if you want to extract part of a series name or metric node segment</tip>
|
|
|
- </span>
|
|
|
- <input type="text" class="gf-form-input" ng-model='current.regex' placeholder="/.*-(.*)-.*/" ng-model-onblur ng-change="runQuery()"></input>
|
|
|
- </div>
|
|
|
- <div class="gf-form">
|
|
|
- <span class="gf-form-label width-7">Refresh</span>
|
|
|
- <select class="gf-form-input max-width-14" ng-model="current.refresh" ng-options="f.value as f.text for f in refreshOptions"></select>
|
|
|
- <tip>When to update the values of this variable, will slow down dashboard load / time change</tip>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <h5 class="section-heading">Query Options</h5>
|
|
|
+
|
|
|
+ <div class="gf-form-inline">
|
|
|
+ <div class="gf-form max-width-21">
|
|
|
+ <span class="gf-form-label width-7" ng-show="current.type === 'query'">Data source</span>
|
|
|
+ <div class="gf-form-select-wrapper max-width-14">
|
|
|
+ <select class="gf-form-input" ng-model="current.datasource" ng-options="f.value as f.name for f in datasources"></select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="gf-form max-width-21">
|
|
|
+ <span class="gf-form-label width-7">
|
|
|
+ Refresh
|
|
|
+ <info-popover mode="right-normal">
|
|
|
+ When to update the values of this variable.
|
|
|
+ </info-popover>
|
|
|
+ </span>
|
|
|
+ <div class="gf-form-select-wrapper max-width-14">
|
|
|
+ <select class="gf-form-input" ng-model="current.refresh" ng-options="f.value as f.text for f in refreshOptions"></select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="gf-form">
|
|
|
+ <span class="gf-form-label width-7">Query</span>
|
|
|
+ <input type="text" class="gf-form-input" ng-model='current.query' placeholder="metric name or tags query" ng-model-onblur ng-change="runQuery()"></input>
|
|
|
+ </div>
|
|
|
+ <div class="gf-form">
|
|
|
+ <span class="gf-form-label width-7">
|
|
|
+ Regex
|
|
|
+ <info-popover mode="right-normal">
|
|
|
+ Optional, if you want to extract part of a series name or metric node segment.
|
|
|
+ </info-popover>
|
|
|
+ </span>
|
|
|
+ <input type="text" class="gf-form-input" ng-model='current.regex' placeholder="/.*-(.*)-.*/" ng-model-onblur ng-change="runQuery()"></input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div ng-show="current.type === 'datasource'" class="gf-form-group">
|
|
|
+ <h5 class="section-heading">Datasource Options</h5>
|
|
|
+
|
|
|
+ <div class="gf-form">
|
|
|
+ <label class="gf-form-label width-12">Type</label>
|
|
|
+ <div class="gf-form-select-wrapper max-width-18">
|
|
|
+ <select class="gf-form-input" ng-model="current.query" ng-options="f.value as f.text for f in datasourceTypes" ng-change="runQuery()"></select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="gf-form">
|
|
|
+ <label class="gf-form-label width-12">
|
|
|
+ Instance name filter
|
|
|
+ <info-popover mode="right-normal">
|
|
|
+ Regex filter for which data source instances to choose from in
|
|
|
+ the variable value dropdown. Leave empty for all.
|
|
|
+ <br><br>
|
|
|
+ Example: <code>/^prod/</code>
|
|
|
+
|
|
|
+ </info-popover>
|
|
|
+ </label>
|
|
|
+ <input type="text" class="gf-form-input max-width-18" ng-model='current.regex' placeholder="/.*-(.*)-.*/" ng-model-onblur ng-change="runQuery()"></input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="section gf-form-group" >
|
|
|
- <h5 class="section-heading">Selection Options</h5>
|
|
|
+ <div class="section gf-form-group" ng-hide="current.type === 'datasource'">
|
|
|
+ <h5 class="section-heading">Selection Options</h5>
|
|
|
<div class="section">
|
|
|
<gf-form-switch class="gf-form"
|
|
|
label="Multi-value"
|