浏览代码

fixed issue in metric segment and option lookup, #6912

Torkel Ödegaard 9 年之前
父节点
当前提交
faf6a5fd36
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 4 1
      public/app/core/services/segment_srv.js
  2. 1 1
      public/app/plugins/datasource/graphite/query_ctrl.ts

+ 4 - 1
public/app/core/services/segment_srv.js

@@ -23,6 +23,9 @@ function (angular, _, coreModule) {
         return;
       }
 
+      // temp hack to work around legacy inconsistency in segment model
+      this.text = options.value;
+
       this.cssClass = options.cssClass;
       this.custom = options.custom;
       this.type = options.type;
@@ -79,7 +82,7 @@ function (angular, _, coreModule) {
     this.transformToSegments = function(addTemplateVars, variableTypeFilter) {
       return function(results) {
         var segments = _.map(results, function(segment) {
-          return self.newSegment({ value: segment.text, expandable: segment.expandable });
+          return self.newSegment({value: segment.text, expandable: segment.expandable});
         });
 
         if (addTemplateVars) {

+ 1 - 1
public/app/plugins/datasource/graphite/query_ctrl.ts

@@ -161,7 +161,7 @@ export class GraphiteQueryCtrl extends QueryCtrl {
 
     return this.datasource.metricFindQuery(query).then(segments => {
       var altSegments = _.map(segments, segment => {
-        return this.uiSegmentSrv.newSegment({ value: segment.text, expandable: segment.expandable });
+        return this.uiSegmentSrv.newSegment({value: segment.text, expandable: segment.expandable});
       });
 
       if (altSegments.length === 0) { return altSegments; }