fix page reloading when using the replication navigation (#5162)

This commit is contained in:
Matthew Irish 2018-08-22 14:08:43 -05:00 committed by GitHub
parent 66a0029195
commit b74da8e272
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 17 deletions

View File

@ -11,8 +11,7 @@ export default Component.extend({
version: inject.service(),
router: inject.service(),
namespace: inject.service(),
classNames: ['level', 'box-label'],
classNameBindings: ['isMenu:is-mobile'],
classNameBindings: ['isMenu::box', 'isMenu::level'],
attributeBindings: ['href', 'target'],
display: 'banner',
isMenu: computed.equal('display', 'menu'),
@ -26,8 +25,7 @@ export default Component.extend({
return this.get('router').urlFor(
'vault.cluster.replication.mode.index',
this.get('cluster.name'),
mode,
{ queryParams: { namespace: this.get('namespace.path') } }
mode
);
}
return null;
@ -38,6 +36,7 @@ export default Component.extend({
}
return null;
}),
internalLink: false,
isPerformance: computed.equal('mode', 'performance'),
replicationEnabled: replicationAttr('replicationEnabled'),
replicationUnsupported: computed.equal('cluster.mode', 'unsupported'),

View File

@ -4,26 +4,43 @@
<p class="menu-label">Disaster Recovery</p>
<ul>
<li>
{{replication-mode-summary
mode="dr"
display='menu'
cluster=cluster
tagName=(or itemTag 'a')
click=(action d.actions.close)
{{#link-to
"vault.cluster.replication.mode.index"
"dr"
}}
{{replication-mode-summary
mode="dr"
display='menu'
cluster=cluster
class=''
}}
{{/link-to}}
</li>
</ul>
<hr />
<p class="menu-label">Performance</p>
<ul>
<li>
{{replication-mode-summary
mode="performance"
display='menu'
cluster=cluster
tagName=(or itemTag 'a')
click=(action d.actions.close)
}}
{{#if (has-feature "Performance Replication")}}
{{#link-to
"vault.cluster.replication.mode.index"
"performance"
}}
{{replication-mode-summary
mode="performance"
display='menu'
cluster=cluster
tagName='span'
}}
{{/link-to}}
{{else}}
{{replication-mode-summary
mode="performance"
display='menu'
cluster=cluster
tagName='a'
}}
{{/if}}
</li>
</ul>
</nav>