|
|
@@ -37,7 +37,7 @@
|
|
|
{{variable.query}}
|
|
|
</td>
|
|
|
<td style="width: 1%">
|
|
|
- <a ng-click="edit(variable)" class="btn btn-success btn-small">
|
|
|
+ <a ng-click="edit(variable)" class="btn btn-inverse btn-small">
|
|
|
<i class="fa fa-edit"></i>
|
|
|
Edit
|
|
|
</a>
|
|
|
@@ -56,97 +56,119 @@
|
|
|
</div>
|
|
|
|
|
|
<div ng-if="editor.index == 1 || (editor.index == 2 && !currentIsNew)">
|
|
|
- <div class="editor-option">
|
|
|
- <div class="editor-row">
|
|
|
- <div class="editor-option">
|
|
|
- <label class="small">Variable name</label>
|
|
|
- <input type="text" class="input-medium" ng-model='current.name' placeholder="name" required></input>
|
|
|
- </div>
|
|
|
- <div class="editor-option">
|
|
|
- <label class="small">Type</label>
|
|
|
- <select class="input-medium" ng-model="current.type" ng-options="f for f in ['query', 'interval', 'custom']" ng-change="typeChanged()"></select>
|
|
|
- </div>
|
|
|
- <div class="editor-option" ng-show="current.type === 'query'">
|
|
|
- <label class="small">Datasource</label>
|
|
|
- <select class="input input-medium" ng-model="current.datasource" ng-options="f.value as f.name for f in datasources"></select>
|
|
|
- </div>
|
|
|
-
|
|
|
- <editor-opt-bool text="Refresh on load" show-if="current.type === 'query'"
|
|
|
- tip="Check if you want values to be updated on dashboard load, will slow down dashboard load time"
|
|
|
- model="current.refresh"></editor-opt-bool>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div ng-show="current.type === 'interval'">
|
|
|
+ <div class="editor-row">
|
|
|
+ <div class="section">
|
|
|
+ <h5>General</h5>
|
|
|
<div class="editor-row">
|
|
|
<div class="editor-option">
|
|
|
- <label class="small">Values</label>
|
|
|
- <input type="text" class="input-xxlarge" ng-model='current.query' ng-blur="runQuery()" placeholder="name"></input>
|
|
|
+ <label class="small">Variable name</label>
|
|
|
+ <input type="text" class="input-medium" ng-model='current.name' placeholder="name" required></input>
|
|
|
+ </div>
|
|
|
+ <div class="editor-option">
|
|
|
+ <label class="small">Type</label>
|
|
|
+ <select class="input-small" ng-model="current.type" ng-options="f for f in ['query', 'interval', 'custom']" ng-change="typeChanged()"></select>
|
|
|
+ </div>
|
|
|
+ <div class="editor-option" ng-show="current.type === 'query'">
|
|
|
+ <label class="small">Datasource</label>
|
|
|
+ <select class="input input-medium" ng-model="current.datasource" ng-options="f.value as f.name for f in datasources"></select>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="editor-row">
|
|
|
- <editor-opt-bool text="Include auto interval" model="current.auto" change="runQuery()"></editor-opt-bool>
|
|
|
- <div class="editor-option" ng-show="current.auto">
|
|
|
- <label class="small">Auto interval steps <tip>How many steps, roughly, the interval is rounded and will not always match this count<tip></label>
|
|
|
- <select class="input-mini" ng-model="current.auto_count" ng-options="f for f in [3,5,10,30,50,100,200]" ng-change="runQuery()"></select>
|
|
|
+
|
|
|
+ <div ng-show="current.type === 'interval'">
|
|
|
+ <div class="editor-row">
|
|
|
+ <div class="editor-option">
|
|
|
+ <label class="small">Values</label>
|
|
|
+ <input type="text" class="input-large" ng-model='current.query' ng-blur="runQuery()" placeholder="name"></input>
|
|
|
+ </div>
|
|
|
+ <editor-opt-bool text="Include auto interval" model="current.auto" change="runQuery()"></editor-opt-bool>
|
|
|
+ <div class="editor-option" ng-show="current.auto">
|
|
|
+ <label class="small">Auto interval steps <tip>How many steps, roughly, the interval is rounded and will not always match this count<tip></label>
|
|
|
+ <select class="input-mini" ng-model="current.auto_count" ng-options="f for f in [3,5,10,30,50,100,200]" ng-change="runQuery()"></select>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
- <div ng-show="current.type === 'custom'">
|
|
|
- <div class="editor-row">
|
|
|
- <div class="editor-option">
|
|
|
- <label class="small">Values seperated by comma</label>
|
|
|
- <input type="text" class="input-xxlarge" ng-model='current.query' ng-blur="runQuery()" placeholder="1, 10, 20, myvalue"></input>
|
|
|
+ <div ng-show="current.type === 'custom'">
|
|
|
+ <div class="editor-row">
|
|
|
+ <div class="editor-option">
|
|
|
+ <label class="small">Values seperated by comma</label>
|
|
|
+ <input type="text" class="input-xxlarge" ng-model='current.query' ng-blur="runQuery()" placeholder="1, 10, 20, myvalue"></input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div ng-show="current.type === 'query'">
|
|
|
+ <h5>Values Query</h5>
|
|
|
+ <div class="editor-row">
|
|
|
+ <div class="editor-option form-inline">
|
|
|
+ <label class="small">Variable values query</label>
|
|
|
+ <input type="text" class="input-xxlarge" ng-model='current.query' placeholder="apps.servers.*"></input>
|
|
|
+ <button class="btn btn-small btn-success" ng-click="runQuery()" bs-tooltip="'Execute query'" data-placement="right"><i class="fa fa-play"></i></button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="editor-row" style="margin: 15px 0">
|
|
|
+ <div class="editor-option form-inline">
|
|
|
+ <label class="small">regex (optional, if you want to extract part of a series name or metric node segment)</label>
|
|
|
+ <input type="text" class="input-xxlarge" ng-model='current.regex' placeholder="/.*-(.*)-.*/"></input>
|
|
|
+ <button class="btn btn-small btn-success" ng-click="runQuery()" bs-tooltip="'execute query'" data-placement="right"><i class="fa fa-play"></i></button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="editor-row" style="margin: 15px 0">
|
|
|
+ <editor-opt-bool text="Refresh on load" show-if="current.type === 'query'"
|
|
|
+ tip="Check if you want values to be updated on dashboard load, will slow down dashboard load time"
|
|
|
+ model="current.refresh"></editor-opt-bool>
|
|
|
+
|
|
|
+ <editor-opt-bool text="All option" model="current.includeAll" change="runQuery()"></editor-opt-bool>
|
|
|
+ <div class="editor-option" ng-show="current.includeAll">
|
|
|
+ <label class="small">All format</label>
|
|
|
+ <select class="input-medium" ng-model="current.allFormat" ng-change="runQuery()" ng-options="f for f in ['glob', 'wildcard', 'regex wildcard', 'regex values']"></select>
|
|
|
+ </div>
|
|
|
+ <div class="editor-option" ng-show="current.includeAll">
|
|
|
+ <label class="small">All value</label>
|
|
|
+ <input type="text" class="input-xlarge" ng-model='current.options[0].value'></input>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div ng-show="current.type === 'query'">
|
|
|
- <div class="editor-row">
|
|
|
- <div class="editor-option form-inline">
|
|
|
- <label class="small">Variable values query</label>
|
|
|
- <input type="text" class="input-xxlarge" ng-model='current.query' placeholder="apps.servers.*"></input>
|
|
|
- <button class="btn btn-small btn-success" ng-click="runQuery()" bs-tooltip="'Execute query'" data-placement="right"><i class="fa fa-play"></i></button>
|
|
|
+ <div class="section">
|
|
|
+ <div class="section">
|
|
|
+ <h5>Display options</h5>
|
|
|
+ <div class="editor-option">
|
|
|
+ <label class="small">Variable label</label>
|
|
|
+ <input type="text" class="input-medium" ng-model='current.label' placeholder=""></input>
|
|
|
</div>
|
|
|
+ <editor-opt-bool text="Hide Label" model="current.hideLabel"></editor-opt-bool>
|
|
|
</div>
|
|
|
|
|
|
- <div class="editor-row" style="margin: 15px 0">
|
|
|
- <div class="editor-option form-inline">
|
|
|
- <label class="small">regex (optional, if you want to extract part of a series name or metric node segment)</label>
|
|
|
- <input type="text" class="input-xxlarge" ng-model='current.regex' placeholder="/.*-(.*)-.*/"></input>
|
|
|
- <button class="btn btn-small btn-success" ng-click="runQuery()" bs-tooltip="'execute query'" data-placement="right"><i class="fa fa-play"></i></button>
|
|
|
+ <div class="section">
|
|
|
+ <h5>Multi-value selection <tip>Enables multiple values to be selected at the same time</tip></h5>
|
|
|
+ <editor-opt-bool text="Enable" model="current.multi"></editor-opt-bool>
|
|
|
+ <div class="editor-option" ng-show="current.multi">
|
|
|
+ <label class="small">Multi value format</label>
|
|
|
+ <select class="input-medium" ng-model="current.multiFormat" ng-options="f for f in ['glob', 'regex values']"></select>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="editor-row" style="margin: 15px 0">
|
|
|
- <editor-opt-bool text="All option" model="current.includeAll" change="runQuery()"></editor-opt-bool>
|
|
|
- <div class="editor-option" ng-show="current.includeAll">
|
|
|
- <label class="small">All format</label>
|
|
|
- <select class="input-medium" ng-model="current.allFormat" ng-change="runQuery()" ng-options="f for f in ['glob', 'wildcard', 'regex wildcard', 'regex values']"></select>
|
|
|
+ <div class="editor-option" >
|
|
|
+ <label class="small">Variable values (shows max 20)</label>
|
|
|
+ <ul class="grafana-options-list">
|
|
|
+ <li ng-repeat="option in current.options | limitTo: 20">
|
|
|
+ {{option.text}}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
- <div class="editor-option" ng-show="current.includeAll">
|
|
|
- <label class="small">All value</label>
|
|
|
- <input type="text" class="input-xlarge" ng-model='current.options[0].value'></input>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="editor-option">
|
|
|
- <div class="editor-row">
|
|
|
- <div class="editor-option" >
|
|
|
- <label class="small">Variable values (showing 20/{{current.options.length}})</label>
|
|
|
- <ul class="grafana-options-list">
|
|
|
- <li ng-repeat="option in current.options | limitTo: 20">
|
|
|
- {{option.text}}
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
- <button type="button" class="btn btn-success" ng-show="editor.index === 2" ng-click="update();">Update</button>
|
|
|
- <button type="button" class="btn btn-success" ng-show="editor.index === 1" ng-click="add();">Add</button>
|
|
|
+ <button type="button" class="btn btn-success pull-right" ng-show="editor.index === 2" ng-click="update();">Update</button>
|
|
|
+ <button type="button" class="btn btn-success pull-right" ng-show="editor.index === 1" ng-click="add();">Add</button>
|
|
|
+
|
|
|
+ <div class="clearfix"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
-</div>
|
|
|
|