Closed huhongbo closed 12 years ago
Hi, You need to start your browser with cross-domain enabled. See here: https://github.com/jondot/graphene/blob/master/run_browser.sh Since the purpose is to run a dashboard, your browser would probably just run one tab and not be used for regular browsing so that's OK.
There is a pending pull request which was contributed, allowing cross-domain via JSONP that I plan to merge, which won't require this.
Alternatively you can deploy your dashboard as a chrome extension which allows you to define whitelisted URLs for cross domain requests. Works quite nicely for me.
Another option is to add the proper CORS headers to your requests served by Apache or Nginx or whatever web server you have in front of your graphite install.
I've merge the pending pull request , and it works
when i use curl to http://localhost/render?from=-10minutes&until=now&width=400&height=250&target=collectd.localhost.memory.memory-used&target=collectd.localhost.memory.memory-free&format=json, I can got the right json format output from graphite
I modify the dashboard-autodiscover.html to following, "test" is my dashboard name g.discover('http://localhost', 'test', function(i, url){ return "#dashboard"; }, function(description){ g.build(description); console.log(description);
but I got nothing