mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
Apply new breadcrumbs pattern to servers and clients
This commit is contained in:
@@ -8,6 +8,13 @@ export default Route.extend(WithForbiddenState, {
|
||||
store: service(),
|
||||
system: service(),
|
||||
|
||||
breadcrumbs: [
|
||||
{
|
||||
label: 'Clients',
|
||||
args: ['clients.index'],
|
||||
},
|
||||
],
|
||||
|
||||
beforeModel() {
|
||||
return this.get('system.leader');
|
||||
},
|
||||
|
||||
@@ -12,6 +12,16 @@ export default Route.extend(WithWatchers, {
|
||||
return this._super(...arguments).catch(notifyError(this));
|
||||
},
|
||||
|
||||
breadcrumbs(model) {
|
||||
if (!model) return [];
|
||||
return [
|
||||
{
|
||||
label: model.get('shortId'),
|
||||
args: ['clients.client', model.get('id')],
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
afterModel(model) {
|
||||
if (model && model.get('isPartial')) {
|
||||
return model.reload().then(node => node.get('allocations'));
|
||||
|
||||
@@ -8,6 +8,13 @@ export default Route.extend(WithForbiddenState, {
|
||||
store: service(),
|
||||
system: service(),
|
||||
|
||||
breadcrumbs: [
|
||||
{
|
||||
label: 'Servers',
|
||||
args: ['servers.index'],
|
||||
},
|
||||
],
|
||||
|
||||
beforeModel() {
|
||||
return this.get('system.leader');
|
||||
},
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
{{#global-header class="page-header"}}
|
||||
<li>
|
||||
{{#link-to "clients.index" data-test-breadcrumb="clients"}}Clients{{/link-to}}
|
||||
</li>
|
||||
<li class="is-active">
|
||||
{{#link-to "clients.client" model.id data-test-breadcrumb="client"}}{{model.shortId}}{{/link-to}}
|
||||
</li>
|
||||
{{app-breadcrumbs}}
|
||||
{{/global-header}}
|
||||
{{#gutter-menu class="page-body"}}
|
||||
<section class="section">
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{{#global-header class="page-header"}}
|
||||
<li class="is-active">
|
||||
{{#link-to "clients.index"}}Clients{{/link-to}}
|
||||
</li>
|
||||
{{app-breadcrumbs}}
|
||||
{{/global-header}}
|
||||
{{#gutter-menu class="page-body"}}
|
||||
<section class="section">
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<div class="page-layout">
|
||||
{{#global-header class="page-header"}}
|
||||
<li class="is-active">
|
||||
{{#link-to "servers.index"}}Servers{{/link-to}}
|
||||
</li>
|
||||
{{app-breadcrumbs}}
|
||||
{{/global-header}}
|
||||
{{#gutter-menu class="page-body"}}
|
||||
<section class="section">
|
||||
|
||||
Reference in New Issue
Block a user