Commit c2b8f21f by Torkel Ödegaard

small changes to PR #327, Partial support for url encoded metric names when…

small changes to PR #327, Partial support for url encoded metric names when using graphite datasource
parent 442ed87c
...@@ -8,6 +8,7 @@ vNext ...@@ -8,6 +8,7 @@ vNext
- Added parameter to keepLastValue graphite function definition (default 100), Closes #459 - 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 - 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) 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 # Fixes
- Filter option loading when having muliple nested filters now works better. - Filter option loading when having muliple nested filters now works better.
......
...@@ -314,7 +314,7 @@ function (angular, $, kbn, moment, _) { ...@@ -314,7 +314,7 @@ function (angular, $, kbn, moment, _) {
if (seriesInfo.alias) { if (seriesInfo.alias) {
group = '<small style="font-size:0.9em;">' + group = '<small style="font-size:0.9em;">' +
'<i class="icon-circle" style="color:'+item.series.color+';"></i>' + ' ' + '<i class="icon-circle" style="color:'+item.series.color+';"></i>' + ' ' +
(decodeURIComponent(seriesInfo.alias) || seriesInfo.query)+ (decodeURIComponent(seriesInfo.alias)) +
'</small><br>'; '</small><br>';
} else { } else {
group = kbn.query_color_dot(item.series.color, 15) + ' '; group = kbn.query_color_dot(item.series.color, 15) + ' ';
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</i> </i>
<span class='small histogram-legend-item'> <span class='small histogram-legend-item'>
<a ng-click="toggleSeries(series, $event)" data-unique="1" data-placement="{{series.yaxis === 2 ? 'bottomRight' : 'bottomLeft'}}"> <a ng-click="toggleSeries(series, $event)" data-unique="1" data-placement="{{series.yaxis === 2 ? 'bottomRight' : 'bottomLeft'}}">
{{series.alias | urlDecode }} {{series.alias | urlDecode}}
</a> </a>
<span ng-if="panel.legend.values"> <span ng-if="panel.legend.values">
<span ng-show="panel.legend.current"> <span ng-show="panel.legend.current">
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</a> </a>
<ul class="dropdown-menu scrollable grafana-segment-dropdown-menu" role="menu"> <ul class="dropdown-menu scrollable grafana-segment-dropdown-menu" role="menu">
<li ng-repeat="altSegment in altSegments" role="menuitem"> <li ng-repeat="altSegment in altSegments" role="menuitem">
<a href="javascript:void(0)" tabindex="1" ng-click="setSegment($index, $parent.$index)" ng-bind-html-unsafe="altSegment.html | urlDecode"></a> <a href="javascript:void(0)" tabindex="1" ng-click="setSegment($index, $parent.$index)" ng-bind-html-unsafe="altSegment.html"></a>
</li> </li>
</ul> </ul>
</li> </li>
......
...@@ -118,7 +118,7 @@ function (angular, _, $, config, kbn, moment) { ...@@ -118,7 +118,7 @@ function (angular, _, $, config, kbn, moment) {
GraphiteDatasource.prototype.metricFindQuery = function(filterSrv, query) { GraphiteDatasource.prototype.metricFindQuery = function(filterSrv, query) {
var interpolated; var interpolated;
try { try {
interpolated = filterSrv.applyTemplateToTarget(query); interpolated = encodeURIComponent(filterSrv.applyTemplateToTarget(query));
} }
catch(err) { catch(err) {
return $q.reject(err); return $q.reject(err);
......
...@@ -124,6 +124,7 @@ define([ ...@@ -124,6 +124,7 @@ define([
i === 45 || // - i === 45 || // -
i === 42 || // * i === 42 || // *
i === 58 || // : i === 58 || // :
i === 37 || // %
i >= 97 && i <= 122; // a-z i >= 97 && i <= 122; // a-z
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment