mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -06:00
Merge branch 'master' of github.com:grafana/grafana
This commit is contained in:
commit
9eb7b192b8
@ -75,7 +75,7 @@ function (angular, _, require, config) {
|
||||
|
||||
$scope.iframeHtml = '<iframe src="' + soloUrl + '" width="450" height="200" frameborder="0"></iframe>';
|
||||
|
||||
$scope.imageUrl = soloUrl.replace('/dashboard-solo/', '/render/dashboard-solo/');
|
||||
$scope.imageUrl = soloUrl.replace(config.appSubUrl + '/dashboard-solo/', config.appSubUrl + '/render/dashboard-solo/');
|
||||
$scope.imageUrl += '&width=1000';
|
||||
$scope.imageUrl += '&height=500';
|
||||
};
|
||||
|
@ -256,23 +256,14 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS
|
||||
return this.renderTemplate(options.legendFormat, labelData) || '{}';
|
||||
};
|
||||
|
||||
this.renderTemplate = function(format, data) {
|
||||
var originalSettings = _.templateSettings;
|
||||
_.templateSettings = {
|
||||
interpolate: /\{\{(.+?)\}\}/g
|
||||
};
|
||||
|
||||
var template = _.template(templateSrv.replace(format));
|
||||
var result;
|
||||
try {
|
||||
result = template(data);
|
||||
} catch (e) {
|
||||
result = null;
|
||||
this.renderTemplate = function(aliasPattern, aliasData) {
|
||||
var aliasRegex = /\{\{\s*(.+?)\s*\}\}/g;
|
||||
return aliasPattern.replace(aliasRegex, function(match, g1) {
|
||||
if (aliasData[g1]) {
|
||||
return aliasData[g1];
|
||||
}
|
||||
|
||||
_.templateSettings = originalSettings;
|
||||
|
||||
return result;
|
||||
return g1;
|
||||
});
|
||||
};
|
||||
|
||||
this.getOriginalMetricName = function(labelData) {
|
||||
|
Loading…
Reference in New Issue
Block a user