diff --git a/ui/app/controllers/jobs/job.js b/ui/app/controllers/jobs/job.js index f1dcf8c6d..fab3c3204 100644 --- a/ui/app/controllers/jobs/job.js +++ b/ui/app/controllers/jobs/job.js @@ -6,7 +6,10 @@ export default Controller.extend({ breadcrumbs: computed('model.{name,id}', function() { return [ { label: 'Jobs', args: ['jobs'] }, - { label: this.get('model.name'), args: ['jobs.job', this.get('model.id')] }, + { + label: this.get('model.name'), + args: ['jobs.job', this.get('model')], + }, ]; }), }); diff --git a/ui/app/router.js b/ui/app/router.js index a63b46fc4..c710a7285 100644 --- a/ui/app/router.js +++ b/ui/app/router.js @@ -8,7 +8,7 @@ const Router = Ember.Router.extend({ Router.map(function() { this.route('jobs', function() { - this.route('job', { path: '/:job_id' }, function() { + this.route('job', { path: '/:job_name' }, function() { this.route('task-group', { path: '/:name' }); this.route('definition'); this.route('versions'); diff --git a/ui/app/routes/jobs/job.js b/ui/app/routes/jobs/job.js index b6387a2ec..ae4c66ca1 100644 --- a/ui/app/routes/jobs/job.js +++ b/ui/app/routes/jobs/job.js @@ -6,9 +6,19 @@ const { Route, inject } = Ember; export default Route.extend({ store: inject.service(), - model({ job_id }) { + serialize(model) { + return { job_name: model.get('plainId') }; + }, + + model(params, transition) { + const namespace = transition.queryParams.namespace || this.get('system.activeNamespace.id'); + const name = params.job_name; + const fullId = JSON.stringify([name, namespace]); return this.get('store') - .findRecord('job', job_id, { reload: true }) + .findRecord('job', fullId, { reload: true }) + .then(job => { + return job.get('allocations').then(() => job); + }) .catch(notifyError(this)); }, }); diff --git a/ui/app/templates/allocations/allocation.hbs b/ui/app/templates/allocations/allocation.hbs index 6c5fbbff8..b95608750 100644 --- a/ui/app/templates/allocations/allocation.hbs +++ b/ui/app/templates/allocations/allocation.hbs @@ -1,7 +1,7 @@

Allocation {{model.name}}

- For job {{#link-to "jobs.job" model.job}}{{model.job.name}}{{/link-to}} + For job {{#link-to "jobs.job" model.job (query-params jobNamespace=model.job.namespace.id)}}{{model.job.name}}{{/link-to}} on node {{#link-to "nodes.node" model.node}}{{model.node.shortId}}{{/link-to}}

diff --git a/ui/app/templates/components/allocation-row.hbs b/ui/app/templates/components/allocation-row.hbs index 09b71a53b..5d3000e2a 100644 --- a/ui/app/templates/components/allocation-row.hbs +++ b/ui/app/templates/components/allocation-row.hbs @@ -16,7 +16,7 @@ {{#if (or allocation.job.isPending allocation.job.isReloading)}} ... {{else}} - {{#link-to "jobs.job" allocation.job}}{{allocation.job.name}}{{/link-to}} + {{#link-to "jobs.job" allocation.job (query-params jobNamespace=allocation.job.namespace.id)}}{{allocation.job.name}}{{/link-to}} / {{allocation.taskGroup.name}} {{/if}} diff --git a/ui/app/templates/components/job-row.hbs b/ui/app/templates/components/job-row.hbs index 39b04e86f..f18fcd3be 100644 --- a/ui/app/templates/components/job-row.hbs +++ b/ui/app/templates/components/job-row.hbs @@ -1,4 +1,4 @@ -{{#link-to "jobs.job" job.id class="is-primary"}}{{job.name}}{{/link-to}} +{{#link-to "jobs.job" job class="is-primary"}}{{job.name}}{{/link-to}} {{job.status}} diff --git a/ui/app/templates/jobs/job/task-group.hbs b/ui/app/templates/jobs/job/task-group.hbs index ea67b29d1..6ba9baae4 100644 --- a/ui/app/templates/jobs/job/task-group.hbs +++ b/ui/app/templates/jobs/job/task-group.hbs @@ -1,6 +1,13 @@ {{#global-header class="page-header"}} {{#each breadcrumbs as |breadcrumb|}} - {{#link-to params=breadcrumb.args class="breadcrumb"}}{{breadcrumb.label}}{{/link-to}} + {{#link-to + params=(append + breadcrumb.args + (query-params jobNamespace=(or model.namespace.id "default")) + ) + class="breadcrumb"}} + {{breadcrumb.label}} + {{/link-to}} {{/each}} {{/global-header}} {{#gutter-menu class="page-body"}}