Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support URL args for any dashboard.
  • Loading branch information
awheeler committed Mar 27, 2014
1 parent 2b54d61 commit 2b412a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/services/dashboard.js
Expand Up @@ -295,6 +295,10 @@ function (angular, $, kbn, _, config, moment, Modernizr) {

var renderTemplate = function(json,params) {
var _r;
json=json.replace(/"to":"([^"]+)"/, '"to": "{{ARGS.to || \'$1\'}}"');
json=json.replace(/"from":"([^"]+)"/, '"from": "{{ARGS.from || \'$1\'}}"');
json=json.replace(/"query":"([^"]+)"/, '"query": "{{ARGS.query || \'$1\'}}"');
json=json.replace(/"style":"([^"]+)"/, '"style": "{{ARGS.style || \'$1\'}}"');
_.templateSettings = {interpolate : /\{\{(.+?)\}\}/g};
var template = _.template(json);
var rendered = template({ARGS:params});
Expand Down

0 comments on commit 2b412a8

Please sign in to comment.