Propagate token in UI

This commit is contained in:
Andy Lo-A-Foe 2015-11-18 08:29:01 +01:00
parent c0b9a6dd50
commit 3dd740577c
1 changed files with 3 additions and 1 deletions

View File

@ -90,10 +90,12 @@ App.DcRoute = App.BaseRoute.extend({
model: function(params) { model: function(params) {
// 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
var token = App.get('settings.token');
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