浏览代码

Made tags editable in opentsdb query

utkarshcmu 10 年之前
父节点
当前提交
8a184e9d30

+ 5 - 2
public/app/plugins/datasource/opentsdb/partials/query.editor.html

@@ -118,8 +118,11 @@
 			Tags
 		</li>
 		<li ng-repeat="(key, value) in target.tags track by $index" class="tight-form-item">
-			{{key}}&nbsp;=&nbsp;{{value}}
-			<a ng-click="removeTag(key)">
+			  {{key}}&nbsp;=&nbsp;{{value}}
+			<a ng-click="editTag(key, value)">
+        <i class="fa fa-pencil"></i>
+      </a>
+      <a ng-click="removeTag(key)">
 				<i class="fa fa-remove"></i>
 			</a>
 		</li>

+ 7 - 0
public/app/plugins/datasource/opentsdb/queryCtrl.js

@@ -86,6 +86,13 @@ function (angular, _, kbn) {
       $scope.targetBlur();
     };
 
+    $scope.editTag = function(key, value) {
+      $scope.removeTag(key);
+      $scope.target.currentTagKey = key;
+      $scope.target.currentTagValue = value;
+      $scope.addTag();
+    };
+
     function validateTarget(target) {
       var errs = {};