Commit 305f8d69 by Torkel Ödegaard

Merge pull request #3234 from utkarshcmu/opentsdb-ui

Made opentsdb query editor consistent and tags are editable now
parents 93851a9a 8a184e9d
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</ul> </ul>
<ul class="tight-form-list" role="menu"> <ul class="tight-form-list" role="menu">
<li class="tight-form-item" style="width: 86px"> <li class="tight-form-item query-keyword" style="width: 100px">
Metric Metric
</li> </li>
<li> <li>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<i class="fa fa-warning"></i> <i class="fa fa-warning"></i>
</a> </a>
</li> </li>
<li class="tight-form-item"> <li class="tight-form-item query-keyword">
Aggregator Aggregator
</li> </li>
<li> <li>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</a> </a>
</li> </li>
<li class="tight-form-item"> <li class="tight-form-item query-keyword">
Alias: Alias:
<tip>Use patterns like $tag_tagname to replace part of the alias for a tag value</tip> <tip>Use patterns like $tag_tagname to replace part of the alias for a tag value</tip>
</li> </li>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<div class="tight-form"> <div class="tight-form">
<ul class="tight-form-list" role="menu"> <ul class="tight-form-list" role="menu">
<li class="tight-form-item tight-form-align" style="width: 86px"> <li class="tight-form-item tight-form-align query-keyword" style="width: 100px">
Down sample Down sample
</li> </li>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
placeholder="interval (empty = auto)"></input> placeholder="interval (empty = auto)"></input>
</li> </li>
<li class="tight-form-item"> <li class="tight-form-item query-keyword">
Aggregator Aggregator
</li> </li>
...@@ -104,8 +104,8 @@ ...@@ -104,8 +104,8 @@
</select> </select>
</li> </li>
<li class="tight-form-item"> <li class="tight-form-item query-keyword">
<editor-checkbox text="Disable downsampling" model="target.disableDownsampling" change="targetBlur()"></editor-checkbox> Disable downsampling <editor-checkbox text="" model="target.disableDownsampling" change="targetBlur()"></editor-checkbox>
</li> </li>
</ul> </ul>
...@@ -114,17 +114,20 @@ ...@@ -114,17 +114,20 @@
<div class="tight-form"> <div class="tight-form">
<ul class="tight-form-list" role="menu"> <ul class="tight-form-list" role="menu">
<li class="tight-form-item tight-form-align" style="width: 86px"> <li class="tight-form-item tight-form-align query-keyword" style="width: 100px">
Tags Tags
</li> </li>
<li ng-repeat="(key, value) in target.tags track by $index" class="tight-form-item"> <li ng-repeat="(key, value) in target.tags track by $index" class="tight-form-item">
{{key}}&nbsp;=&nbsp;{{value}} {{key}}&nbsp;=&nbsp;{{value}}
<a ng-click="editTag(key, value)">
<i class="fa fa-pencil"></i>
</a>
<a ng-click="removeTag(key)"> <a ng-click="removeTag(key)">
<i class="fa fa-remove"></i> <i class="fa fa-remove"></i>
</a> </a>
</li> </li>
<li class="tight-form-item" ng-hide="addTagMode"> <li class="tight-form-item query-keyword" ng-hide="addTagMode">
<a ng-click="addTag()"> <a ng-click="addTag()">
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
</a> </a>
...@@ -154,15 +157,15 @@ ...@@ -154,15 +157,15 @@
<div class="tight-form"> <div class="tight-form">
<ul class="tight-form-list" role="menu"> <ul class="tight-form-list" role="menu">
<li class="tight-form-item tight-form-align" style="width: 86px"> <li class="tight-form-item tight-form-align query-keyword" style="width: 100px">
<editor-checkbox text="Rate" model="target.shouldComputeRate" change="targetBlur()"></editor-checkbox> Rate <editor-checkbox text="" model="target.shouldComputeRate" change="targetBlur()"></editor-checkbox>
</li> </li>
<li class="tight-form-item" ng-hide="!target.shouldComputeRate"> <li class="tight-form-item query-keyword" ng-hide="!target.shouldComputeRate">
<editor-checkbox text="Counter" model="target.isCounter" change="targetBlur()"></editor-checkbox> Counter <editor-checkbox text="" model="target.isCounter" change="targetBlur()"></editor-checkbox>
</li> </li>
<li class="tight-form-item" ng-hide="!target.isCounter || !target.shouldComputeRate"> <li class="tight-form-item query-keyword" ng-hide="!target.isCounter || !target.shouldComputeRate">
Counter Max: Counter Max:
</li> </li>
...@@ -172,7 +175,7 @@ ...@@ -172,7 +175,7 @@
placeholder="max value" ng-model-onblur placeholder="max value" ng-model-onblur
ng-blur="targetBlur()"></input> ng-blur="targetBlur()"></input>
</li> </li>
<li class="tight-form-item" ng-hide="!target.isCounter || !target.shouldComputeRate"> <li class="tight-form-item query-keyword" ng-hide="!target.isCounter || !target.shouldComputeRate">
Reset Value: Reset Value:
</li> </li>
<li ng-hide="!target.isCounter || !target.shouldComputeRate"> <li ng-hide="!target.isCounter || !target.shouldComputeRate">
......
...@@ -86,6 +86,13 @@ function (angular, _, kbn) { ...@@ -86,6 +86,13 @@ function (angular, _, kbn) {
$scope.targetBlur(); $scope.targetBlur();
}; };
$scope.editTag = function(key, value) {
$scope.removeTag(key);
$scope.target.currentTagKey = key;
$scope.target.currentTagValue = value;
$scope.addTag();
};
function validateTarget(target) { function validateTarget(target) {
var errs = {}; var errs = {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment