open-nomad/ui/app/controllers/allocations/allocation.js
Jai Bhagat e957e5b7d7 feat: create trigger component
Create Trigger Component and deprecate Breadcrumb-Utils pattern.
2021-12-21 07:46:25 -05:00

32 lines
924 B
JavaScript

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] },
{ type: 'job', job: model.get('job') },
{
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],
},
];
}
}