open-vault/ui/app/templates/components/secret-list-header.hbs
Matthew Irish 23778935b0
UI - make engine list more consistent with the auth method list (#4598)
* remove expanding behavior from engines list and add a configuration route

* use page header component, secret tab component for the template on the secret engine configuration route

* move abstraction to secret-list-header and remove secret-tabs

* add attrs to secret engine model and adjust mount controller code to support that

* fix top level nav so that we can use the back button properly

* fix tests
2018-05-23 11:25:52 -05:00

109 lines
4.1 KiB
Handlebars

{{#with (options-for-backend model.type) as |options|}}
{{#page-header as |p|}}
{{#p.top}}
{{#key-value-header
baseKey=baseKey
path="vault.cluster.secrets.backend.list"
root=backendCrumb
}}
<li>
<span class="sep">&#x0002f;</span>
<a href={{href-to "vault.cluster.secrets"}}>
secrets
</a>
</li>
{{/key-value-header}}
{{/p.top}}
{{#p.levelLeft}}
<h1 class="title is-3">
{{model.id}}
<span class="tag is-outlined is-inverted has-text-grey-dark is-font-mono">
{{or options.displayName (capitalize model.type)}}
</span>
{{#if (eq model.options.version 2)}}
<span class="has-text-grey-dark has-text-weight-normal is-size-6">
Version 2
</span>
{{/if}}
</h1>
{{/p.levelLeft}}
{{#p.levelRight}}
{{#unless (or isCertTab isConfigure)}}
<div class="control">
{{#secret-link
mode="create"
secret=(or baseKey.id '')
queryParams=(query-params initialKey='')
class="button has-icon-right is-ghost is-compact"
data-test-secret-create=true
}}
{{options.create}}
{{i-con glyph="chevron-right" size=11}}
{{/secret-link}}
</div>
{{/unless}}
{{#if (or (eq model.type "aws") (eq model.type "ssh") (eq model.type "pki"))}}
<div class="control">
<a href={{href-to
"vault.cluster.settings.configure-secret-backend"
model.id
}}
class="button has-icon-right is-ghost is-compact"
data-test-secret-backend-configure=true
>
Configure {{i-con glyph="chevron-right" size=11}}
</a>
</div>
{{/if}}
{{/p.levelRight}}
{{/page-header}}
{{#if options.tabs}}
<div class="box is-bottomless is-marginless is-fullwidth is-paddingless">
<nav class="tabs sub-nav">
<ul>
{{#each options.tabs as |oTab|}}
{{#if oTab.tab}}
{{#link-to 'vault.cluster.secrets.backend.list-root' (query-params tab=oTab.tab) tagName="li" activeClass="is-active" data-test-tab=oTab.label}}
{{#link-to 'vault.cluster.secrets.backend.list-root' (query-params tab=oTab.tab)}}
{{oTab.label}}
{{/link-to}}
{{/link-to}}
{{else}}
{{#link-to 'vault.cluster.secrets.backend.list-root' (query-params tab='') tagName="li" activeClass="is-active" data-test-tab=oTab.label}}
{{#link-to 'vault.cluster.secrets.backend.list-root' (query-params tab='')}}
{{oTab.label}}
{{/link-to}}
{{/link-to}}
{{/if}}
{{/each}}
{{#link-to 'vault.cluster.secrets.backend.configuration' tagName="li" activeClass="is-active"}}
{{#link-to 'vault.cluster.secrets.backend.configuration' }}
Configuration
{{/link-to}}
{{/link-to}}
</ul>
</nav>
</div>
{{else}}
{{!-- if there are no tabs in the options, we'll hardcode them here --}}
<div class="box is-bottomless is-marginless is-fullwidth is-paddingless">
<nav class="tabs sub-nav">
<ul>
{{#if (contains model.type (supported-secret-backends))}}
{{#link-to 'vault.cluster.secrets.backend.list-root' tagName="li" activeClass="is-active" current-when="vault.cluster.secrets.backend.list-root vault.cluster.secrets.backend.list"}}
{{#link-to 'vault.cluster.secrets.backend.list-root'}}
{{capitalize (pluralize options.item)}}
{{/link-to}}
{{/link-to}}
{{/if}}
{{#link-to 'vault.cluster.secrets.backend.configuration' tagName="li" activeClass="is-active"}}
{{#link-to 'vault.cluster.secrets.backend.configuration' }}
Configuration
{{/link-to}}
{{/link-to}}
</ul>
</nav>
</div>
{{/if}}
{{/with}}