From c2b8f21fd96639cfbf81afb168788773f277373f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 5 Jun 2014 20:50:14 -0700 Subject: [PATCH] small changes to PR #327, Partial support for url encoded metric names when using graphite datasource --- CHANGELOG.md | 1 + src/app/directives/grafanaGraph.js | 2 +- src/app/filters/all.js | 2 +- src/app/panels/graphite/legend.html | 2 +- src/app/partials/graphite/editor.html | 2 +- src/app/services/graphite/graphiteDatasource.js | 2 +- src/app/services/graphite/lexer.js | 1 + 7 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbe1d57cfae..4e12da99428 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ vNext - Added parameter to keepLastValue graphite function definition (default 100), Closes #459 - improved asset (css/js) build pipeline, added revision to css and js. Will remove issues related to the browser cache when upgrading grafana and improve load performance (Fixes #418) +- Partial support for url encoded metrics when using Graphite datasource (PR #327) - thx @axe-felix # Fixes - Filter option loading when having muliple nested filters now works better. diff --git a/src/app/directives/grafanaGraph.js b/src/app/directives/grafanaGraph.js index f600aebe433..b27ed32d352 100755 --- a/src/app/directives/grafanaGraph.js +++ b/src/app/directives/grafanaGraph.js @@ -314,7 +314,7 @@ function (angular, $, kbn, moment, _) { if (seriesInfo.alias) { group = '' + '' + ' ' + - (decodeURIComponent(seriesInfo.alias) || seriesInfo.query)+ + (decodeURIComponent(seriesInfo.alias)) + '
'; } else { group = kbn.query_color_dot(item.series.color, 15) + ' '; diff --git a/src/app/filters/all.js b/src/app/filters/all.js index 9a717cc53a8..0a6dd12b816 100755 --- a/src/app/filters/all.js +++ b/src/app/filters/all.js @@ -118,6 +118,6 @@ define(['angular', 'jquery', 'underscore', 'moment'], function (angular, $, _, m return function(input) { return decodeURIComponent(input); }; - }); + }); }); \ No newline at end of file diff --git a/src/app/panels/graphite/legend.html b/src/app/panels/graphite/legend.html index 013b50a5c95..45eca738848 100755 --- a/src/app/panels/graphite/legend.html +++ b/src/app/panels/graphite/legend.html @@ -9,7 +9,7 @@ - {{series.alias | urlDecode }} + {{series.alias | urlDecode}} diff --git a/src/app/partials/graphite/editor.html b/src/app/partials/graphite/editor.html index 3503680b424..48179eccacf 100755 --- a/src/app/partials/graphite/editor.html +++ b/src/app/partials/graphite/editor.html @@ -70,7 +70,7 @@ diff --git a/src/app/services/graphite/graphiteDatasource.js b/src/app/services/graphite/graphiteDatasource.js index 78984a55cf7..6d2c76f9af4 100644 --- a/src/app/services/graphite/graphiteDatasource.js +++ b/src/app/services/graphite/graphiteDatasource.js @@ -118,7 +118,7 @@ function (angular, _, $, config, kbn, moment) { GraphiteDatasource.prototype.metricFindQuery = function(filterSrv, query) { var interpolated; try { - interpolated = filterSrv.applyTemplateToTarget(query); + interpolated = encodeURIComponent(filterSrv.applyTemplateToTarget(query)); } catch(err) { return $q.reject(err); diff --git a/src/app/services/graphite/lexer.js b/src/app/services/graphite/lexer.js index 91cd2237bfe..3cc3a1a2774 100644 --- a/src/app/services/graphite/lexer.js +++ b/src/app/services/graphite/lexer.js @@ -124,6 +124,7 @@ define([ i === 45 || // - i === 42 || // * i === 58 || // : + i === 37 || // % i >= 97 && i <= 122; // a-z }