open-nomad/ui/app/routes/jobs/job/task-group.js

21 lines
510 B
JavaScript
Raw Normal View History

2017-09-19 14:47:10 +00:00
import Ember from 'ember';
const { Route } = Ember;
export default Route.extend({
model({ name }) {
// If the job is a partial (from the list request) it won't have task
// groups. Reload the job to ensure task groups are present.
return this.modelFor('jobs.job')
.reload()
.then(job => {
return job
.hasMany('allocations')
.reload()
.then(() => {
return job.get('taskGroups').findBy('name', name);
});
});
},
});