open-nomad/ui/app/routes/clients/client.js

19 lines
475 B
JavaScript
Raw Normal View History

import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
2017-09-28 17:06:24 +00:00
import notifyError from 'nomad-ui/utils/notify-error';
2017-09-19 14:47:10 +00:00
export default Route.extend({
store: service(),
2017-09-19 14:47:10 +00:00
2017-09-28 17:06:24 +00:00
model() {
return this._super(...arguments).catch(notifyError(this));
},
2017-09-19 14:47:10 +00:00
afterModel(model) {
2017-09-28 17:06:24 +00:00
if (model && model.get('isPartial')) {
2017-09-19 14:47:10 +00:00
return model.reload().then(node => node.get('allocations'));
}
2017-09-28 17:06:24 +00:00
return model && model.get('allocations');
2017-09-19 14:47:10 +00:00
},
});