Explorar o código

Merge pull request #9561 from mtanda/prometheus_46_fix_range

(prometheus) fix to show vector range popup
Carl Bergquist %!s(int64=8) %!d(string=hai) anos
pai
achega
e8da084baf
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      public/app/plugins/datasource/prometheus/completer.ts

+ 2 - 2
public/app/plugins/datasource/prometheus/completer.ts

@@ -8,7 +8,7 @@ export class PromCompleter {
   labelNameCache: any;
   labelNameCache: any;
   labelValueCache: any;
   labelValueCache: any;
 
 
-  identifierRegexps = [/[\[\]a-zA-Z0-9_:=]/];
+  identifierRegexps = [/\[/, /[a-zA-Z0-9_:]/];
 
 
   constructor(private datasource: PrometheusDatasource) {
   constructor(private datasource: PrometheusDatasource) {
     this.labelQueryCache = {};
     this.labelQueryCache = {};
@@ -73,7 +73,7 @@ export class PromCompleter {
         });
         });
     }
     }
 
 
-    if (prefix === '[') {
+    if (token.type === 'paren.lparen' && token.value === '[') {
       var vectors = [];
       var vectors = [];
       for (let unit of ['s', 'm', 'h']) {
       for (let unit of ['s', 'm', 'h']) {
         for (let value of [1,5,10,30]) {
         for (let value of [1,5,10,30]) {