2021-11-30 20:10:01 +00:00
|
|
|
import Controller from '@ember/controller';
|
|
|
|
import { qpBuilder } from 'nomad-ui/utils/classes/query-params';
|
|
|
|
|
|
|
|
export default class AllocationsAllocationController extends Controller {
|
|
|
|
// Allocation breadcrumbs extend from job / task group breadcrumbs
|
|
|
|
// even though the route structure does not.
|
|
|
|
get breadcrumbs() {
|
|
|
|
const model = this.model;
|
|
|
|
const jobQueryParams = qpBuilder({
|
|
|
|
jobNamespace: model.get('job.namespace.name') || 'default',
|
|
|
|
});
|
|
|
|
|
|
|
|
return [
|
|
|
|
{ label: 'Jobs', args: ['jobs.index', jobQueryParams] },
|
2021-12-08 19:26:25 +00:00
|
|
|
{ type: 'job', job: model.get('job') },
|
2021-11-30 20:10:01 +00:00
|
|
|
{
|
|
|
|
label: model.get('taskGroupName'),
|
|
|
|
args: [
|
|
|
|
'jobs.job.task-group',
|
|
|
|
model.get('job.plainId'),
|
|
|
|
model.get('taskGroupName'),
|
|
|
|
jobQueryParams,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: model.get('shortId'),
|
|
|
|
args: ['allocations.allocation', model],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|