Browse Source

fixed promql and loggging syntax so all punctuation chars are treated the same, remove hover move

Torkel Ödegaard 7 years ago
parent
commit
1fddb6144d

+ 1 - 0
public/app/plugins/datasource/logging/syntax.ts

@@ -18,6 +18,7 @@ const tokenizer = {
         greedy: true,
         alias: 'attr-value',
       },
+      punctuation: /[{]/,
     },
   },
   // number: /\b-?\d+((\.\d*)?([eE][+-]?\d+)?)?\b/,

+ 3 - 1
public/app/plugins/datasource/prometheus/promql.ts

@@ -386,9 +386,10 @@ const tokenizer = {
     lookbehind: true,
     inside: {
       'label-key': {
-        pattern: /[^,\s][^,]*[^,\s]*/,
+        pattern: /[^(),\s][^,)]*[^),\s]*/,
         alias: 'attr-name',
       },
+      punctuation: /[()]/,
     },
   },
   'context-labels': {
@@ -403,6 +404,7 @@ const tokenizer = {
         greedy: true,
         alias: 'attr-value',
       },
+      punctuation: /[{]/,
     },
   },
   function: new RegExp(`\\b(?:${FUNCTIONS.map(f => f.label).join('|')})(?=\\s*\\()`, 'i'),

+ 0 - 4
public/sass/pages/_explore.scss

@@ -36,10 +36,6 @@
     transition: all 0.1s linear;
   }
 
-  .explore-panel__header:hover {
-    transform: translateY(-1px);
-  }
-
   .explore-panel__header-label {
     font-weight: 500;
     margin-right: $panel-margin;