Merge pull request #1514 from oswell/master

Add the token to /v1/internal/ui/nodes. (issue #1071)
This commit is contained in:
James Phillips 2015-12-16 13:36:02 -08:00
commit b602aa623b
1 changed files with 3 additions and 1 deletions

View File

@ -88,12 +88,14 @@ App.IndexRoute = App.BaseRoute.extend({
// functioning, as well as the per-dc requests. // functioning, as well as the per-dc requests.
App.DcRoute = App.BaseRoute.extend({ App.DcRoute = App.BaseRoute.extend({
model: function(params) { model: function(params) {
var token = App.get('settings.token');
// Return a promise hash to retreieve the // Return a promise hash to retreieve the
// dcs and nodes used in the header // dcs and nodes used in the header
return Ember.RSVP.hash({ return Ember.RSVP.hash({
dc: params.dc, dc: params.dc,
dcs: Ember.$.getJSON('/v1/catalog/datacenters'), dcs: Ember.$.getJSON('/v1/catalog/datacenters'),
nodes: Ember.$.getJSON(formatUrl('/v1/internal/ui/nodes', params.dc)).then(function(data) { nodes: Ember.$.getJSON(formatUrl('/v1/internal/ui/nodes', params.dc, token)).then(function(data) {
var objs = []; var objs = [];
// Merge the nodes into a list and create objects out of them // Merge the nodes into a list and create objects out of them