open-vault/ui/app/templates/components/secret-list-header.hbs
2019-05-09 10:00:55 -06:00

135 lines
4.7 KiB
Handlebars

{{#with (options-for-backend model.engineType) as |options|}}
<PageHeader as |p|>
<p.top>
{{#key-value-header
baseKey=baseKey
path="vault.cluster.secrets.backend.list"
root=backendCrumb
}}
<li>
<span class="sep">&#x0002f;</span>
{{#link-to "vault.cluster.secrets"}}
secrets
{{/link-to}}
</li>
{{/key-value-header}}
</p.top>
<p.levelLeft>
<h1 class="title is-3">
{{i-con glyph=(or (concat "enable/" model.engineType) "enable/secrets") size=24 class="has-text-grey-light"}}
{{model.id}}
{{#if (eq model.options.version 2)}}
<span class="tag">
Version 2
</span>
{{/if}}
</h1>
</p.levelLeft>
</PageHeader>
{{#if options.tabs}}
<div class="tabs-container box is-bottomless is-marginless is-fullwidth is-paddingless">
<nav class="tabs">
<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' data-test-configuration-tab=true}}
Configuration
{{/link-to}}
{{/link-to}}
</ul>
</nav>
</div>
{{else}}
{{!-- if there are no tabs in the options, we'll hardcode them here --}}
<div class="tabs-container box is-bottomless is-marginless is-fullwidth is-paddingless">
<nav class="tabs">
<ul>
{{#if (contains model.engineType (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' data-test-configuration-tab=true}}
Configuration
{{/link-to}}
{{/link-to}}
</ul>
</nav>
</div>
{{/if}}
{{/with}}
{{#if (or hasItems (or isConfigurable (not isConfigurableTab)))}}
<Toolbar>
{{#if hasItems}}
<ToolbarFilters>
{{navigate-input
enterpriseProduct="vault"
filterFocusDidChange=(action "setFilterFocus")
filterDidChange=(action "setFilter")
filter=filter
filterMatchesKey=filterMatchesKey
firstPartialMatch=firstPartialMatch
baseKey=(get baseKey "id")
shouldNavigateTree=options.navigateTree
placeholder=options.searchPlaceholder
mode=(if (eq tab 'certs') 'secrets-cert' 'secrets')
data-test-nav-input=true
}}
{{#if filterFocused}}
{{#if filterMatchesKey}}
{{#unless filterIsFolder}}
<p class="input-hint">
<kbd>Enter</kbd> to view {{filter}}
</p>
{{/unless}}
{{/if}}
{{#if firstPartialMatch}}
<p class="input-hint">
<kbd>Tab</kbd> to autocomplete
</p>
{{/if}}
{{/if}}
</ToolbarFilters>
{{/if}}
<ToolbarActions>
{{#if (and isConfigurable isConfigurableTab)}}
<ToolbarLink
@params={{array 'vault.cluster.settings.configure-secret-backend' model.id}}
@data-test-secret-backend-configure=true
>
Configure
</ToolbarLink>
{{else}}
<ToolbarSecretLink
@secret=''
@mode="create"
@type="add"
@queryParams={{query-params initialKey=(or filter baseKey.id)}}
@data-test-secret-create=true
>
{{options.create}}
</ToolbarSecretLink>
{{/if}}
</ToolbarActions>
</Toolbar>
{{/if}}