mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Make task page breadcrumbs extend the allocation breadcrumbs
This commit is contained in:
15
ui/app/controllers/allocations/allocation/task.js
Normal file
15
ui/app/controllers/allocations/allocation/task.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import Controller, { inject as controller } from '@ember/controller';
|
||||
import { computed } from '@ember/object';
|
||||
|
||||
export default Controller.extend({
|
||||
allocationController: controller('allocations.allocation'),
|
||||
|
||||
breadcrumbs: computed('allocationController.breadcrumbs.[]', 'model.name', function() {
|
||||
return this.get('allocationController.breadcrumbs').concat([
|
||||
{
|
||||
label: this.get('model.name'),
|
||||
args: ['allocations.allocation.task', this.get('model.allocation'), this.get('model')],
|
||||
},
|
||||
]);
|
||||
}),
|
||||
});
|
||||
@@ -1,8 +1,12 @@
|
||||
import { alias } from '@ember/object/computed';
|
||||
import Controller from '@ember/controller';
|
||||
import Controller, { inject as controller } from '@ember/controller';
|
||||
import { computed } from '@ember/object';
|
||||
import { alias } from '@ember/object/computed';
|
||||
|
||||
export default Controller.extend({
|
||||
taskController: controller('allocations.allocation.task'),
|
||||
|
||||
breadcrumbs: alias('taskController.breadcrumbs'),
|
||||
|
||||
network: alias('model.resources.networks.firstObject'),
|
||||
ports: computed('network.reservedPorts.[]', 'network.dynamicPorts.[]', function() {
|
||||
return (this.get('network.reservedPorts') || [])
|
||||
|
||||
7
ui/app/controllers/allocations/allocation/task/logs.js
Normal file
7
ui/app/controllers/allocations/allocation/task/logs.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import Controller, { inject as controller } from '@ember/controller';
|
||||
import { alias } from '@ember/object/computed';
|
||||
|
||||
export default Controller.extend({
|
||||
taskController: controller('allocations.allocation.task'),
|
||||
breadcrumbs: alias('taskController.breadcrumbs'),
|
||||
});
|
||||
@@ -1,15 +1,13 @@
|
||||
{{#global-header class="page-header"}}
|
||||
<li><a href="#" data-test-breadcrumb="allocations">Allocations</a></li>
|
||||
<li>
|
||||
{{#link-to "allocations.allocation" model.allocation data-test-breadcrumb="allocation"}}
|
||||
{{model.allocation.shortId}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
<li class="is-active">
|
||||
{{#link-to "allocations.allocation.task" model.allocation model data-test-breadcrumb="task"}}
|
||||
{{model.name}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{#each breadcrumbs as |breadcrumb index|}}
|
||||
<li class="{{if (eq (inc index) breadcrumbs.length) "is-active"}}">
|
||||
{{#link-to
|
||||
data-test-breadcrumb=breadcrumb.label
|
||||
params=breadcrumb.args}}
|
||||
{{breadcrumb.label}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/each}}
|
||||
{{/global-header}}
|
||||
{{#gutter-menu class="page-body"}}
|
||||
{{partial "allocations/allocation/task/subnav"}}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
{{#global-header class="page-header"}}
|
||||
<li><a href="#">Allocations</a></li>
|
||||
<li>
|
||||
{{#link-to "allocations.allocation" model.allocation}}
|
||||
{{model.allocation.shortId}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
<li class="is-active">
|
||||
{{#link-to "allocations.allocation.task" model.allocation model}}
|
||||
{{model.name}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{#each breadcrumbs as |breadcrumb index|}}
|
||||
<li class="{{if (eq (inc index) breadcrumbs.length) "is-active"}}">
|
||||
{{#link-to
|
||||
data-test-breadcrumb=breadcrumb.label
|
||||
params=breadcrumb.args}}
|
||||
{{breadcrumb.label}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/each}}
|
||||
{{/global-header}}
|
||||
{{#gutter-menu class="page-body"}}
|
||||
{{partial "allocations/allocation/task/subnav"}}
|
||||
|
||||
Reference in New Issue
Block a user