breadcrumbs: computed('model.job', function() { return [ { label: 'Jobs', args: ['jobs'] }, { label: this.get('model.job.name'), args: [ 'jobs.job', this.get('model.job.plainId'), qpBuilder({ jobNamespace: this.get('model.job.namespace.name') || 'default', }), ], }, { label: this.get('model.taskGroupName'), args: [ 'jobs.job.task-group', this.get('model.job'), this.get('model.taskGroupName'), qpBuilder({ jobNamespace: this.get('model.namespace.name') || 'default', }), ], }, { label: this.get('model.shortId'), args: ['allocations.allocation', this.get('model')], }, ]; }),
export const jobCrumb = job => ({ label: job.get('trimmedName'), args: [ 'jobs.job.index', job.get('plainId'), qpBuilder({ jobNamespace: job.get('namespace.name') || 'default', }), ], });
breadcrumbs: computed('jobController.breadcrumbs.[]', 'model.{name}', function() { return this.get('jobController.breadcrumbs').concat([ { label: this.get('model.name'), args: [ 'jobs.job.task-group', this.get('model.name'), qpBuilder({ jobNamespace: this.get('model.job.namespace.name') || 'default' }), ], }, ]); }),
import Route from '@ember/routing/route'; import { collect } from '@ember/object/computed'; import { watchRecord, watchRelationship } from 'nomad-ui/utils/properties/watch'; import WithWatchers from 'nomad-ui/mixins/with-watchers'; import { qpBuilder } from 'nomad-ui/utils/classes/query-params'; export default Route.extend(WithWatchers, { breadcrumbs(model) { if (!model) return []; return [ { label: model.get('name'), args: [ 'jobs.job.task-group', model.get('name'), qpBuilder({ jobNamespace: model.get('job.namespace.name') || 'default' }), ], }, ]; }, 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(() => {