open-vault/ui/app/templates/components/secret-list-header.hbs

82 lines
2.8 KiB
Handlebars

{{#let (options-for-backend @model.engineType) as |options|}}
<PageHeader as |p|>
<p.top>
<KeyValueHeader @baseKey={{@baseKey}} @path="vault.cluster.secrets.backend.list" @root={{@backendCrumb}}>
<li>
<span class="sep">
/
</span>
<LinkTo @route="vault.cluster.secrets">
secrets
</LinkTo>
</li>
</KeyValueHeader>
</p.top>
<p.levelLeft>
<h1 class="title is-3">
<Icon @name={{@model.icon}} @size="24" class="has-text-grey-light" />
{{@model.id}}
{{#if this.isKV}}
<span class="tag" data-test-kv-version-badge>
Version
{{or @model.options.version "1"}}
</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" aria-label="secret tabs">
<ul>
{{#if options.hasOverview}}
<LinkTo @route="vault.cluster.secrets.backend.overview" data-test-tab="overview">
Overview
</LinkTo>
{{/if}}
{{#each options.tabs as |oTab|}}
{{#if oTab.tab}}
<SecretListHeaderTab
@displayName={{options.displayName}}
@id={{@model.id}}
@path={{oTab.checkCapabilitiesPath}}
@label={{oTab.label}}
@tab={{oTab.tab}}
/>
{{else}}
<SecretListHeaderTab
@displayName={{options.displayName}}
@id={{@model.id}}
@path={{oTab.checkCapabilitiesPath}}
@label={{oTab.label}}
@tab={{""}}
/>
{{/if}}
{{/each}}
<LinkTo @route="vault.cluster.secrets.backend.configuration" data-test-configuration-tab={{true}}>
Configuration
</LinkTo>
</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" aria-label="tabs">
<ul>
{{#if (contains @model.engineType (supported-secret-backends))}}
<LinkTo
@route="vault.cluster.secrets.backend.list-root"
@current-when="vault.cluster.secrets.backend.list-root vault.cluster.secrets.backend.list"
>
{{capitalize (pluralize options.item)}}
</LinkTo>
{{/if}}
<LinkTo @route="vault.cluster.secrets.backend.configuration" data-test-configuration-tab={{true}}>
Configuration
</LinkTo>
</ul>
</nav>
</div>
{{/if}}
{{/let}}